├── .gitignore
├── Gemfile
├── Gemfile.lock
├── LICENSE.md
├── Procfile
├── README.md
├── app.rb
├── config.ru
├── fly.toml
├── lib
└── Github.rb
├── public
├── avatar_list.json
├── css
│ ├── magic
│ │ ├── magic.css
│ │ ├── magic.min.css
│ │ └── magic.styl
│ └── style.css
├── font
│ ├── ArcadeClassic.otf
│ └── TRON.TTF
├── img
│ ├── ASSETS.md
│ ├── background.gif
│ ├── bit
│ │ ├── bit.gif
│ │ ├── false.gif
│ │ └── true.gif
│ ├── busted.gif
│ ├── characters-extra
│ │ ├── castor.gif
│ │ ├── derezzed-blue.png
│ │ ├── derezzed-red.png
│ │ ├── flynn-young.png
│ │ ├── infected-program.png
│ │ ├── infection.png
│ │ ├── logo.png
│ │ ├── recognizer.png
│ │ └── special-logo.gif
│ ├── characters
│ │ ├── ada.png
│ │ ├── black_guard.png
│ │ ├── calchas.png
│ │ ├── clu.png
│ │ ├── clu2.png
│ │ ├── damaged_program.png
│ │ ├── data_pusher_new_1.png
│ │ ├── data_pusher_new_2.png
│ │ ├── data_pusher_old_1.png
│ │ ├── data_pusher_old_2.png
│ │ ├── data_pusher_old_3.png
│ │ ├── dumont.png
│ │ ├── dyson.png
│ │ ├── flynn.png
│ │ ├── flynn_converted.png
│ │ ├── giles.png
│ │ ├── guard.png
│ │ ├── iso_female_1.png
│ │ ├── iso_female_3.png
│ │ ├── iso_male_1.png
│ │ ├── iso_male_2.png
│ │ ├── iso_male_3.png
│ │ ├── jarvis.png
│ │ ├── jet.png
│ │ ├── kevin_flynn.png
│ │ ├── mcp.gif
│ │ ├── old_iso_male.png
│ │ ├── ophelia.png
│ │ ├── paige.png
│ │ ├── perl.png
│ │ ├── quorra.png
│ │ ├── ram.png
│ │ ├── rinzler.png
│ │ ├── rinzler_converted.png
│ │ ├── sam.png
│ │ ├── sark.png
│ │ ├── sarks_lieutenant.png
│ │ ├── tron.png
│ │ ├── tron_uprising.png
│ │ ├── yori.png
│ │ ├── young_iso_female.png
│ │ └── young_iso_male.png
│ ├── disk
│ │ ├── black-blue.gif
│ │ ├── black-red.gif
│ │ ├── black-yellow.gif
│ │ ├── blue-purple.gif
│ │ ├── blue-white-new.gif
│ │ ├── blue-white.gif
│ │ ├── loading.gif
│ │ ├── red-white.gif
│ │ └── yellow-white.gif
│ └── favicon.ico
├── js
│ └── noty
│ │ ├── jquery.noty.js
│ │ ├── layouts
│ │ ├── bottom.js
│ │ ├── bottomCenter.js
│ │ ├── bottomLeft.js
│ │ ├── bottomRight.js
│ │ ├── center.js
│ │ ├── centerLeft.js
│ │ ├── centerRight.js
│ │ ├── inline.js
│ │ ├── top.js
│ │ ├── topCenter.js
│ │ ├── topLeft.js
│ │ └── topRight.js
│ │ ├── packaged
│ │ ├── jquery.noty.packaged.js
│ │ └── jquery.noty.packaged.min.js
│ │ ├── promise.js
│ │ └── themes
│ │ └── default.js
└── sounds
│ ├── scherzo.mp3
│ └── scherzo.ogg
└── views
├── error.erb
├── error_input.erb
├── error_program.erb
├── error_rage_quit.erb
├── error_rate_limit.erb
├── fight.erb
├── footer.erb
├── index.erb
├── layout.erb
├── layout2.erb
└── not_found.erb
/.gitignore:
--------------------------------------------------------------------------------
1 | Created by http://www.gitignore.io
2 |
3 | ### OSX ###
4 | .DS_Store
5 | .AppleDouble
6 | .LSOverride
7 |
8 | # Icon must ends with two \r.
9 | Icon
10 |
11 |
12 | # Thumbnails
13 | ._*
14 |
15 | # Files that might appear on external disk
16 | .Spotlight-V100
17 | .Trashes
18 |
19 |
20 | ### vim ###
21 | [._]*.s[a-w][a-z]
22 | [._]s[a-w][a-z]
23 | *.un~
24 | Session.vim
25 | .netrwhist
26 | *~
27 |
28 | .vscode/
29 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 | ruby "3.2.0"
3 |
4 | gem 'octokit'
5 | gem 'sinatra'
6 | gem 'thin'
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | addressable (2.8.1)
5 | public_suffix (>= 2.0.2, < 6.0)
6 | daemons (1.4.1)
7 | eventmachine (1.2.7)
8 | faraday (2.6.0)
9 | faraday-net_http (>= 2.0, < 3.1)
10 | ruby2_keywords (>= 0.0.4)
11 | faraday-net_http (3.0.1)
12 | mustermann (3.0.0)
13 | ruby2_keywords (~> 0.0.1)
14 | octokit (6.0.0)
15 | faraday (>= 1, < 3)
16 | sawyer (~> 0.9)
17 | public_suffix (5.0.0)
18 | rack (2.2.6.2)
19 | rack-protection (3.0.4)
20 | rack
21 | ruby2_keywords (0.0.5)
22 | sawyer (0.9.2)
23 | addressable (>= 2.3.5)
24 | faraday (>= 0.17.3, < 3)
25 | sinatra (3.0.4)
26 | mustermann (~> 3.0)
27 | rack (~> 2.2, >= 2.2.4)
28 | rack-protection (= 3.0.4)
29 | tilt (~> 2.0)
30 | thin (1.8.1)
31 | daemons (~> 1.0, >= 1.0.9)
32 | eventmachine (~> 1.0, >= 1.0.4)
33 | rack (>= 1, < 3)
34 | tilt (2.0.11)
35 |
36 | PLATFORMS
37 | arm64-darwin-22
38 | x86_64-darwin-21
39 | x86_64-linux
40 |
41 | DEPENDENCIES
42 | octokit
43 | sinatra
44 | thin
45 |
46 | RUBY VERSION
47 | ruby 3.2.0p0
48 |
49 | BUNDLED WITH
50 | 2.3.11
51 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | # License
2 |
3 | This project is not associated with GitHub, [Tron franchise](https://en.wikipedia.org/wiki/Tron_(franchise)) or Disney.
4 | This app is licensed under the MIT terms. However all graphic creations are licensed under a different license.
5 |
6 | See __GITRON Pixel Art__ in ```public/img/```
7 |
8 | ```
9 | The MIT License (MIT)
10 |
11 | Copyright (c) 2014 GITRON
12 |
13 | Permission is hereby granted, free of charge, to any person obtaining a copy
14 | of this software and associated documentation files (the "Software"), to deal
15 | in the Software without restriction, including without limitation the rights
16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 | copies of the Software, and to permit persons to whom the Software is
18 | furnished to do so, subject to the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be included in
21 | all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29 | THE SOFTWARE.THE SOFTWARE.
30 | ```
31 |
32 | ## Contributing
33 |
34 | 1. Fork it
35 | 2. Create your feature branch (`git checkout -b my-new-feature`)
36 | 3. Commit your changes (`git commit -am 'Add some feature'`)
37 | 4. Push to the branch (`git push origin my-new-feature`)
38 | 5. Create new Pull Request
39 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: bundle exec rackup config.ru -p $PORT
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # Gitron
6 |
7 | >Greetings, programs!
8 |
9 | Have you ever wondered how your *github repository* would look like on a **TRON grid**?
10 |
11 | ## Description
12 |
13 | This is a web game based on [TRON](http://en.wikipedia.org/wiki/Tron) universe. Every repository on GitHub can be a TRON character *(sam, clu, flynn, tron, etc.)* and can fight against other repositories.
14 |
15 | The score is based on:
16 |
17 | * repository size
18 | * number of releases
19 | * number of contributors
20 |
21 | **issues** instead will be subtracted to the main score of your repository.
22 | The avatar is generated based on your repository **stars**, more stars it gets more important is the character generated :sunglasses:
23 |
24 | Winner is chosen according to the higher score of the two programs fighting.
25 |
26 | Beware the program who loses will be subject to immediate **deresolution**!
27 |
28 | 
29 |
30 | ## Achievements
31 |
32 | These are just a few achievements you can unlock in **Gitron**.
33 |
34 | Achievement | Description
35 | ----------- | -----
36 | THE GRID | Enter The Grid
37 | FOUND ZUSE | Find a way to see Zuse *(the guy with the white hair)*
38 | ISOMORPHIC | Discover and ISO
39 | PURGE | Dereze an ISO
40 | TRON LIVES | Is Tron still alive?
41 | FAITH IN USERS | Dereze the poor Jarvis
42 | BETRAYAL | When Clu 2 derezzed Tron
43 | END OF LINE | Destroy Master Control Program
44 | THE CREATOR | ???
45 |
46 | ## Assets
47 |
48 | Check out :zap: [THIS](https://github.com/syxanash/gitron/blob/master/public/img/ASSETS.md):zap: page for awesome pixel art!
49 |
50 | 
51 |
52 | ## Installation
53 |
54 | This app is written in Ruby using Sinatra.
55 |
56 | ```
57 | gem install octokit
58 | git clone git://github.com/syxanash/gitron
59 | bundle install
60 | ruby app.rb
61 | ```
62 |
63 | ## See also
64 |
65 | Here listed a few things I used for developing this project.
66 |
67 | * [github-high-scores](https://github.com/leereilly/github-high-scores) by Lee Reilly. I was highly inspired by his work.
68 | * [Sinatra](http://www.sinatrarb.com/) a Ruby web framework
69 | * [noty](https://github.com/needim/noty) jquery notification plugin
70 | * [magic](https://github.com/miniMAC/magic) a couple of very nice CSS3 animations I used
71 | * [github API](https://developer.github.com/v3/)
72 |
73 | ## Bugs & known issues
74 |
75 | * __MCP__ apparently is still alive...
76 |
77 | ## Easter eggs
78 |
79 | :rabbit:
80 |
81 | * look up for the source code if you're interested
82 |
83 | ## About
84 |
85 | This is just a summer project I developed after finishing a few exams for university. I really hope you like it as much as I liked creating it!
86 |
87 | Let's see if your programs are lucky enough to fight for his own user.
88 |
89 | 
90 |
--------------------------------------------------------------------------------
/app.rb:
--------------------------------------------------------------------------------
1 | require 'sinatra'
2 | require 'json'
3 | require 'base64'
4 | require './lib/Github'
5 |
6 | # Public: github.com API key used in order to have higher rate limit
7 | GITHUB_API_KEY = ENV.fetch('GITHUB_API_KEY')
8 |
9 | COOKIE_NAME = 'ach'.freeze
10 |
11 | set :show_exceptions, false
12 |
13 | before do
14 | # variables used to set various achievements
15 |
16 | @achievements = Array.new
17 |
18 | begin
19 | @github_client = Github.new(GITHUB_API_KEY)
20 | rescue RateLimitError
21 | redirect '/errors/limit'
22 | end
23 |
24 | @achievement_list = {
25 | zuse: 'FOUND ZUSE',
26 | grid: 'THE GRID',
27 | iso: 'ISOMORPHIC',
28 | tron: 'TRON LIVES',
29 | faith: 'FAITH IN USERS',
30 | mcp: 'END OF LINE',
31 | purge: 'PURGE',
32 | betrayal: 'BETRAYAL'
33 | }
34 |
35 | # if all achievements have been unlocked
36 | # set the last achievement
37 |
38 | all_achievements = true
39 |
40 | @achievement_list.values.each do |item|
41 | next if achieved?(item)
42 | all_achievements = false
43 | end
44 |
45 | if all_achievements && !achieved?('THE CREATOR')
46 | @achievements.push('THE CREATOR')
47 | save(@achievements)
48 | end
49 | end
50 |
51 | not_found do
52 | erb :not_found, :layout => :layout2
53 | end
54 |
55 | error do
56 | @error_message = env['sinatra.error'].message
57 | erb :error
58 | end
59 |
60 | get '/errors/limit' do
61 | erb :error_rate_limit
62 | end
63 |
64 | before %r{\/errors\/(input|reponame|ragequit)} do
65 | unless achieved?(@achievement_list[:zuse])
66 | @achievements.push(@achievement_list[:zuse])
67 | save(@achievements)
68 | end
69 | end
70 |
71 | get '/errors/input' do
72 | erb :error_input
73 | end
74 |
75 | get '/errors/reponame' do
76 | erb :error_program
77 | end
78 |
79 | get '/errors/ragequit' do
80 | erb :error_rage_quit
81 | end
82 |
83 | before '/*' do
84 | unless achieved?(@achievement_list[:grid])
85 | @achievements.push(@achievement_list[:grid])
86 | save(@achievements)
87 | end
88 | end
89 |
90 | get '/' do
91 | if params[:first_repo] && params[:second_repo]
92 | first_name, first_repo = get_github(sanitize_input(params[:first_repo]))
93 | second_name, second_repo = get_github(sanitize_input(params[:second_repo]))
94 |
95 | if first_name && first_repo && second_name && second_repo
96 | redirect "/#{first_name}/#{first_repo}/vs/#{second_name}/#{second_repo}"
97 | else
98 | redirect '/errors/input'
99 | end
100 | else
101 | erb :index
102 | end
103 | end
104 |
105 | get '/:first_name/:first_repo/vs/:second_name/:second_repo/?' do
106 | @players = Array.new
107 |
108 | # parse GET parameters
109 |
110 | first_name, first_repo = params[:first_name], params[:first_repo]
111 | second_name, second_repo = params[:second_name], params[:second_repo]
112 |
113 | # check if user enters the same repo twice
114 |
115 | if first_name == second_name && first_repo == second_repo
116 | redirect '/errors/ragequit'
117 | end
118 |
119 | @players.push(name: first_name, repo: first_repo)
120 | @players.push(name: second_name, repo: second_repo)
121 |
122 | @players.each do |player|
123 | begin
124 | @github_client.set_repository(player[:name], player[:repo])
125 |
126 | player[:score] = @github_client.score
127 | player[:avatar], player[:disk] = @github_client.generate_avatar
128 | player[:branches], player[:contribs] = @github_client.additional_disk_info
129 | rescue RepoNotFoundError
130 | redirect '/errors/reponame'
131 | end
132 | end
133 |
134 | # compare two scores to choose the higher for winner
135 | # if tie then randomly choose the winner
136 | # the winner is identified by an index between 0 and 1
137 | # this index is used to access to the item in @players
138 |
139 | # @winner_index and @loser_index
140 | # will be also used in views file fight.erb
141 |
142 | if @players[0][:score] > @players[1][:score]
143 | @winner_index = 0
144 | elsif @players[0][:score] < @players[1][:score]
145 | @winner_index = 1
146 | else
147 | @winner_index = Random.rand(2)
148 | end
149 |
150 | # check if new achievements have been unlocked
151 | # okay, the following code block is just pure shit
152 | # I'll update it one day, I swear!
153 |
154 | @loser_index = (@winner_index + 1) % 2
155 |
156 | @players.each_with_index do |player, i|
157 | if i == @winner_index
158 | if (player[:avatar] == 'rinzler.png' || player[:avatar] == 'tron_uprising.png') &&
159 | !achieved?(@achievement_list[:tron])
160 | @achievements.push(@achievement_list[:tron])
161 | elsif player[:avatar] == 'clu2.png' &&
162 | (@players[@loser_index][:avatar] == 'rinzler_converted.png' ||
163 | @players[@loser_index][:avatar] == 'tron.png' ||
164 | @players[@loser_index][:avatar] == 'tron_uprising.png') &&
165 | !achieved?(@achievement_list[:betrayal])
166 | @achievements.push(@achievement_list[:betrayal])
167 | end
168 |
169 | # checking ISO avatars (for github members repos)
170 | if iso_avatar?(player[:avatar]) && !achieved?(@achievement_list[:iso])
171 | @achievements.push(@achievement_list[:iso])
172 | elsif (!iso_avatar?(player[:avatar]) &&
173 | iso_avatar?(@players[@loser_index][:avatar])) && !achieved?(@achievement_list[:purge])
174 | @achievements.push(@achievement_list[:purge])
175 | end
176 | else # check loser of the current fight
177 | if player[:avatar] == 'mcp.gif' && !achieved?(@achievement_list[:mcp])
178 | @achievements.push(@achievement_list[:mcp])
179 | elsif player[:avatar] == 'jarvis.png' && !achieved?(@achievement_list[:faith])
180 | @achievements.push(@achievement_list[:faith])
181 | end
182 | end
183 | end
184 |
185 | # if new achievements have been unlocked save
186 | # the list inside the main cookie
187 |
188 | if @achievements.size != 0
189 | save(@achievements)
190 | end
191 |
192 | # yes, I warned you it was shit...
193 |
194 | erb :fight
195 | end
196 |
197 | get '/avatar/:user/:repository' do
198 | user, repository = params[:user], params[:repository]
199 |
200 | begin
201 | @github_client.set_repository(user, repository)
202 | avatar, disk = @github_client.generate_avatar
203 |
204 | send_file "public/img/characters/#{avatar}"
205 | rescue RepoNotFoundError
206 | send_file "public/img/characters-extra/castor.gif", :type => :gif
207 | end
208 | end
209 |
210 | get '/avatar/disk/:user/:repository' do
211 | user, repository = params[:user], params[:repository]
212 |
213 | begin
214 | @github_client.set_repository(user, repository)
215 | avatar, disk = @github_client.generate_avatar
216 |
217 | send_file "public/img/disk/#{disk}"
218 | rescue RepoNotFoundError
219 | send_file "public/img/characters-extra/castor.gif", :type => :gif
220 | end
221 | end
222 |
223 | helpers do
224 | def bake(key, content, expire = 290_304_000)
225 | response.set_cookie(
226 | key,
227 | value: content,
228 | expires: Time.now + expire,
229 | path: '/'
230 | )
231 | end
232 |
233 | def save(new_list)
234 | # save the current unlocked achievements list
235 | # and update the list with new achievements
236 |
237 | current_list = fetch
238 | current_list += new_list
239 |
240 | # save the list inside a json array and update the cookie
241 |
242 | json_content = current_list.to_json
243 | bake(COOKIE_NAME, Base64.encode64(json_content))
244 | end
245 |
246 | def achieved?(achievement)
247 | list = fetch
248 |
249 | list.include?(achievement)
250 | end
251 |
252 | def fetch
253 | achievements = Array.new
254 |
255 | cookie = request.cookies[COOKIE_NAME]
256 | json_array = Base64.decode64(cookie.to_s)
257 |
258 | achievements = JSON.parse(json_array) if json_array != ''
259 |
260 | achievements
261 | end
262 |
263 | def iso_avatar?(avatar)
264 | isos_avatar = %w(
265 | ophelia.png giles.png quorra.png ada.png calchas.png
266 | young_iso_male.png young_iso_female.png old_iso_male.png
267 | iso_female_1.png iso_male_1.png iso_male_2.png
268 | iso_male_3.png iso_female_3.png
269 | )
270 |
271 | iso_avatar = false
272 |
273 | isos_avatar.each do |iso|
274 | next unless iso == avatar
275 | iso_avatar = true
276 | end
277 |
278 | iso_avatar
279 | end
280 | end
281 |
282 | # Public: Sanitize input from a github url specified via argument.
283 | # Kinldy provided by github.com/leereilly/github-high-scores.
284 | #
285 | # url - url to sanitize
286 | #
287 | # Returns the url sanitized
288 | def sanitize_input(url)
289 | url = url.downcase
290 |
291 | # Special rules for Github URLs starting with 'github.com'
292 | if url[0..9] == 'github.com'
293 | url = 'https://www.github.com' + url[9..url.size]
294 |
295 | # Special rules for Github URLs starting with 'www.github.com'
296 | elsif url[0..13] == 'www.github.com'
297 | url = 'https://www.github.com' + url[13..url.size]
298 | end
299 |
300 | # Special rules for Github URLs ending in 'git'
301 | if url[-4,4] == '.git'
302 | url = url[0..-5]
303 | end
304 |
305 | url = url.gsub('http://', 'https://')
306 | url = url.gsub('git@github.com:', 'https://www.github.com/')
307 | url = url.gsub('git://', 'https://www.')
308 |
309 | # If someone just passes in user/repo e.g. leereilly/leereilly.net
310 | tokens = url.split('/')
311 | if tokens.size == 2
312 | url = "https://www.github.com/#{tokens[0]}/#{tokens[1]}"
313 | end
314 |
315 | url
316 | end
317 |
318 | def get_github(sanitized_github_url)
319 | user = sanitized_github_url.split('/')[3]
320 | repo = sanitized_github_url.split('/')[4]
321 |
322 | return user, repo
323 | end
324 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'bundler'
3 | Bundler.require
4 | require './app'
5 | run Sinatra::Application
6 |
--------------------------------------------------------------------------------
/fly.toml:
--------------------------------------------------------------------------------
1 | # fly.toml file generated for gitron on 2022-11-09T16:24:36Z
2 |
3 | app = "gitron"
4 | kill_signal = "SIGINT"
5 | kill_timeout = 5
6 | processes = []
7 |
8 | [build]
9 | builder = "heroku/buildpacks:20"
10 |
11 | [env]
12 | PORT = "8080"
13 |
14 | [experimental]
15 | allowed_public_ports = []
16 | auto_rollback = true
17 |
18 | [[services]]
19 | http_checks = []
20 | internal_port = 8080
21 | processes = ["app"]
22 | protocol = "tcp"
23 | script_checks = []
24 | [services.concurrency]
25 | hard_limit = 25
26 | soft_limit = 20
27 | type = "connections"
28 |
29 | [[services.ports]]
30 | force_https = true
31 | handlers = ["http"]
32 | port = 80
33 |
34 | [[services.ports]]
35 | handlers = ["tls", "http"]
36 | port = 443
37 |
38 | [[services.tcp_checks]]
39 | grace_period = "1s"
40 | interval = "15s"
41 | restart_limit = 0
42 | timeout = "2s"
43 |
--------------------------------------------------------------------------------
/lib/Github.rb:
--------------------------------------------------------------------------------
1 | require 'octokit'
2 |
3 | class RepoNotFoundError < StandardError; end
4 | class RateLimitError < StandardError; end
5 |
6 | # Public: Contains various methods for fetching info from
7 | # Github repos.
8 | class Github
9 | # Public: json file containing avatars file name.
10 | AVATAR_LIST = 'public/avatar_list.json'.freeze
11 |
12 | # array positions for avatar types
13 | OLD_GRID_AVATARS = 0
14 | NEW_GRID_AVATARS = 1
15 | ISOS_AVATARS = 2
16 |
17 | # Public: Initialize github client specifying the API key
18 | # via argument. API key will be used in order to
19 | # have higher rate limit.
20 | # Visit: https://developer.github.com/v3/#rate-limiting
21 | #
22 | # api_key - string of api key provided by github
23 | #
24 | # Returns nothing.
25 | # Raises RateLimitError if github.com API requests reaches limit.
26 | def initialize(api_key)
27 | @client = Octokit::Client.new(
28 | access_token: api_key,
29 | auto_traversal: true,
30 | per_page: 100
31 | )
32 |
33 | raise RateLimitError, 'rate limit exceeded!' if @client.rate_limit.remaining == 0
34 | end
35 |
36 | # Public: Set a repository to fetch public info from.
37 | # This is mandatory in order to use either score or generate_avatar
38 | #
39 | # owner - repo's owner
40 | # repo - repository name
41 | #
42 | # Returns nothing.
43 | # Raises RepoNotFoundError if repository does not exist on github.com
44 | def set_repository(owner, repo)
45 | @my_repository = "#{owner}/#{repo}"
46 |
47 | unless @client.repository? @my_repository
48 | raise RepoNotFoundError, 'repository does not exist!'
49 | end
50 |
51 | # build repository information
52 | @repo_info = {
53 | size: @client.repository(@my_repository).size,
54 | forks: @client.repository(@my_repository).forks_count,
55 | stars: @client.repository(@my_repository).stargazers_count,
56 | date: @client.repository(@my_repository).created_at,
57 | branches: calc_total(@my_repository, 'branches'),
58 | releases: calc_total(@my_repository, 'releases'),
59 | contribs: calc_total(@my_repository, 'contribs')
60 | }
61 | end
62 |
63 | # Thank you snowe wherever you are!
64 | # https://stackoverflow.com/a/43374518
65 | def calc_total(repo, repo_info)
66 | begin
67 | number_of_items_in_first_page = @client.send(repo_info, repo).size
68 | repo_sum = 0
69 | if number_of_items_in_first_page >= 100
70 | links = @client.last_response.rels
71 |
72 | unless links.empty?
73 | last_page_url = links[:last].href
74 |
75 | /.*page=(?\d+)/ =~ last_page_url
76 | repo_sum += (page_num.to_i - 1) * 100 # we add the last page manually
77 | repo_sum += links[:last].get.data.size
78 | end
79 | else
80 | repo_sum += number_of_items_in_first_page
81 | end
82 | rescue Octokit::Forbidden
83 | # used in rare cases like torvalds/linux
84 |
85 | repo_sum = '∞'
86 | end
87 |
88 | repo_sum
89 | end
90 |
91 | # Public: get branches and number of contributors for a repository
92 | #
93 | # Returns number of branches
94 | # Returns number of contributors
95 | def additional_disk_info
96 | raise "repository hasn't been set!" unless @my_repository
97 |
98 | return @repo_info[:branches], @repo_info[:contribs]
99 | end
100 |
101 |
102 | # Public: Calculate a score from public github repository
103 | # information.
104 | #
105 | # Returns the score calculated.
106 | def score
107 | raise "repository hasn't been set!" unless @my_repository
108 |
109 | issues ||= 0
110 | main_score ||= 0
111 |
112 | if @client.repository(@my_repository).has_issues?
113 | issues = @client.issues(@my_repository).size
114 | end
115 |
116 | # calculate score by adding repository size releases and
117 | # contributors. If contributors number is "infinity" then
118 | # use the forks number instead (thanks torvalds/linux)
119 |
120 | main_score = @repo_info[:size].to_i +
121 | @repo_info[:releases].to_i +
122 | (@repo_info[:contribs] == '∞' ?
123 | @repo_info[:forks].to_i : @repo_info[:contribs].to_i)
124 |
125 | if issues < main_score
126 | main_score -= issues
127 | end
128 |
129 | main_score
130 | end
131 |
132 | # Public: generate avatar based on public repository information.
133 | # Both disk and avatar name are values contained
134 | # in avatar_list.json file.
135 | #
136 | # Returns avatar file name.
137 | # Returns disk gif file name.
138 | def generate_avatar
139 | raise "repository hasn't been set!" unless @my_repository
140 |
141 | json_file_content = File.read(AVATAR_LIST)
142 | avatars = JSON.parse(json_file_content)
143 |
144 | # check if repo owner is github staff
145 | owner = @my_repository.split('/')[0]
146 | github_member = @client.user(owner).company == 'GitHub'
147 |
148 | grid ||= OLD_GRID_AVATARS
149 |
150 | # if github staff use ISOs avatar
151 |
152 | if github_member
153 | grid = ISOS_AVATARS
154 | elsif @repo_info[:date].to_s > '2010-12-29' # :D
155 | grid = NEW_GRID_AVATARS
156 | end
157 |
158 | avatar ||= ''
159 | disk_color ||= ''
160 |
161 | avatars.each do |score, item|
162 | if @repo_info[:stars] >= score.to_i
163 | if item.is_a?(Array)
164 | item[grid].each do |name, disk|
165 | avatar = name
166 | disk_color = disk
167 | end
168 | else
169 | item.each do |name, disk|
170 | avatar = name
171 | disk_color = disk
172 | end
173 | end
174 |
175 | break
176 | end
177 | end
178 |
179 | return avatar, disk_color
180 | end
181 | end
182 |
--------------------------------------------------------------------------------
/public/avatar_list.json:
--------------------------------------------------------------------------------
1 | {
2 | "300000": {
3 | "kevin_flynn.png": "black-blue.gif"
4 | },
5 |
6 | "100000": {
7 | "mcp.gif": "red-white.gif"
8 | },
9 |
10 | "50000": {
11 | "jet.png": "blue-purple.gif"
12 | },
13 |
14 | "10000": [
15 | { "tron.png": "blue-white.gif" },
16 | { "tron_uprising.png": "blue-white-new.gif" },
17 | { "ophelia.png": "blue-white-new.gif" }
18 | ],
19 |
20 | "5500": [
21 | { "sark.png": "red-white.gif" },
22 | { "clu2.png": "black-yellow.gif" },
23 | { "giles.png": "black-blue.gif" }
24 | ],
25 |
26 | "5000": [
27 | { "flynn.png": "blue-white.gif" },
28 | { "rinzler_converted.png": "black-blue.gif" },
29 | { "quorra.png": "black-blue.gif" }
30 | ],
31 |
32 | "2500": [
33 | { "flynn_converted.png": "red-white.gif" },
34 | { "rinzler.png": "black-red.gif" },
35 | { "ada.png": "black-blue.gif" }
36 | ],
37 |
38 | "1500": [
39 | { "clu.png": "yellow-white.gif" },
40 | { "sam.png": "black-blue.gif" },
41 | { "calchas.png": "black-blue.gif" }
42 | ],
43 |
44 | "1000": [
45 | { "yori.png": "blue-white.gif" },
46 | { "jarvis.png": "black-red.gif" },
47 | { "young_iso_male.png": "black-blue.gif" }
48 | ],
49 |
50 | "500": [
51 | { "ram.png": "blue-white.gif" },
52 | { "dyson.png": "black-red.gif" },
53 | { "young_iso_female.png": "black-blue.gif" }
54 | ],
55 |
56 | "250": [
57 | { "sarks_lieutenant.png": "red-white.gif" },
58 | { "paige.png": "black-red.gif" },
59 | { "old_iso_male.png": "black-blue.gif" }
60 | ],
61 |
62 |
63 | "200": [
64 | { "guard.png": "red-white.gif" },
65 | { "black_guard.png": "black-red.gif" },
66 | { "iso_female_1.png": "black-blue.gif" }
67 | ],
68 |
69 | "150": [
70 | { "dumont.png": "blue-white.gif" },
71 | { "perl.png": "black-blue.gif" },
72 | { "iso_male_1.png": "black-blue.gif" }
73 | ],
74 |
75 | "100": [
76 | { "data_pusher_old_1.png": "yellow-white.gif" },
77 | { "damaged_program.png": "black-blue.gif" },
78 | { "iso_male_2.png": "black-blue.gif" }
79 | ],
80 |
81 | "50": [
82 | { "data_pusher_old_2.png": "red-white.gif" },
83 | { "data_pusher_new_1.png": "black-blue.gif" },
84 | { "iso_male_3.png": "black-blue.gif" }
85 | ],
86 |
87 | "0": [
88 | { "data_pusher_old_3.png": "yellow-white.gif" },
89 | { "data_pusher_new_2.png": "black-blue.gif" },
90 | { "iso_female_3.png": "black-blue.gif" }
91 | ]
92 | }
93 |
--------------------------------------------------------------------------------
/public/css/magic/magic.styl:
--------------------------------------------------------------------------------
1 | // vendor prefixes, thanks Stylus
2 |
3 | //schema of all prefixes
4 | vendor(prop,arguments)
5 | -webkit-{prop} arguments
6 | -moz-{prop} arguments
7 | -ms-{prop} arguments
8 | -o-{prop} arguments
9 | {prop} arguments
10 |
11 | // Propertys and values(arguments)
12 | animation-name()
13 | vendor('animation-name',arguments)
14 | animation-duration()
15 | vendor('animation-duration',arguments)
16 | animation-fill-mode()
17 | vendor('animation-fill-mode',arguments)
18 | transform-origin()
19 | vendor('transform-origin',arguments)
20 | transform()
21 | vendor('transform',arguments)
22 | animation-timing-function()
23 | vendor('animation-timing-function',arguments)
24 | //http://caniuse.com/#feat=css-filters
25 | filter() //This css property is only supported in -webkit- engine for now
26 | -webkit-filter : arguments
27 | backface-visibility() // only Opera not supported
28 | vendor('backface-visibility',arguments)
29 |
30 | // start animations
31 | body
32 | backface-visibility: hidden
33 |
34 | .magictime
35 | animation-duration: 1s
36 | animation-fill-mode: both
37 |
38 |
39 | @keyframes magic
40 | 0%
41 | opacity: 1
42 | transform-origin: 100% 200%
43 | transform: scale(1.0,1.0) rotate(0deg)
44 | 100%
45 | opacity: 0
46 | transform-origin: 200% 500%
47 | transform: scale(0.0,0.0) rotate(270deg)
48 |
49 |
50 | .magic
51 | animation-name: magic
52 |
53 |
54 | @keyframes openDownLeft
55 | 0%
56 | transform-origin: bottom left
57 | transform: rotate(0deg)
58 | animation-timing-function: ease-out
59 | 100%
60 | transform-origin: bottom left
61 | transform: rotate(-110deg)
62 | animation-timing-function: ease-in-out
63 |
64 |
65 | .openDownLeft
66 | animation-name: openDownLeft
67 |
68 |
69 | @keyframes openDownRight
70 | 0%
71 | transform-origin: bottom right
72 | transform: rotate(0deg)
73 | animation-timing-function: ease-out
74 | 100%
75 | transform-origin: bottom right
76 | transform: rotate(110deg)
77 | animation-timing-function: ease-in-out
78 |
79 |
80 | .openDownRight
81 | animation-name: openDownRight
82 |
83 |
84 | @keyframes openUpLeft
85 | 0%
86 | transform-origin: top left
87 | transform: rotate(0deg)
88 | animation-timing-function: ease-out
89 | 100%
90 | transform-origin: top left
91 | transform: rotate(110deg)
92 | animation-timing-function: ease-in-out
93 |
94 |
95 | .openUpLeft
96 | animation-name: openUpLeft
97 |
98 |
99 | @keyframes openUpRight
100 | 0%
101 | transform-origin: top right
102 | transform: rotate(0deg)
103 | animation-timing-function: ease-out
104 | 100%
105 | transform-origin: top right
106 | transform: rotate(-110deg)
107 | animation-timing-function: ease-in-out
108 |
109 |
110 | .openUpRight
111 | animation-name: openUpRight
112 |
113 |
114 | @keyframes openDownLeftReturn
115 | 0%
116 | transform-origin: bottom left
117 | transform: rotate(-110deg)
118 | animation-timing-function: ease-in-out
119 | 100%
120 | transform-origin: bottom left
121 | transform: rotate(0deg)
122 | animation-timing-function: ease-out
123 |
124 |
125 | .openDownLeftReturn
126 | animation-name: openDownLeftReturn
127 |
128 |
129 | @keyframes openDownRightReturn
130 | 0%
131 | transform-origin: bottom right
132 | transform: rotate(110deg)
133 | animation-timing-function: ease-in-out
134 | 100%
135 | transform-origin: bottom right
136 | transform: rotate(0deg)
137 | animation-timing-function: ease-out
138 |
139 |
140 | .openDownRightReturn
141 | animation-name: openDownRightReturn
142 |
143 |
144 | @keyframes openUpLeftReturn
145 | 0%
146 | transform-origin: top left
147 | transform: rotate(110deg)
148 | animation-timing-function: ease-in-out
149 | 100%
150 | transform-origin: top left
151 | transform: rotate(0deg)
152 | animation-timing-function: ease-out
153 |
154 |
155 | .openUpLeftReturn
156 | animation-name: openUpLeftReturn
157 |
158 |
159 | @keyframes openUpRightReturn
160 | 0%
161 | transform-origin: top right
162 | transform: rotate(-110deg)
163 | animation-timing-function: ease-in-out
164 | 100%
165 | transform-origin: top right
166 | transform: rotate(0deg)
167 | animation-timing-function: ease-out
168 |
169 |
170 | .openUpRightReturn
171 | animation-name: openUpRightReturn
172 |
173 |
174 | @keyframes openDownLeftOut
175 | 0%
176 | opacity: 1
177 | transform-origin: bottom left
178 | transform: rotate(0deg)
179 | animation-timing-function: ease-out
180 | 100%
181 | opacity: 0
182 | transform-origin: bottom left
183 | transform: rotate(-110deg)
184 | animation-timing-function: ease-in-o
185 |
186 |
187 | .openDownLeftOut
188 | animation-name: openDownLeftOut
189 |
190 |
191 | @keyframes openDownRightOut
192 | 0%
193 | opacity: 1
194 | transform-origin: bottom right
195 | transform: rotate(0deg)
196 | animation-timing-function: ease-out
197 | 100%
198 | opacity: 0
199 | transform-origin: bottom right
200 | transform: rotate(110deg)
201 | animation-timing-function: ease-in-o
202 |
203 |
204 | .openDownRightOut
205 | animation-name: openDownRightOut
206 |
207 |
208 | @keyframes openUpLeftOut
209 | 0%
210 | opacity: 1
211 | transform-origin: top left
212 | transform: rotate(0deg)
213 | animation-timing-function: ease-out
214 | 100%
215 | opacity: 0
216 | transform-origin: top left
217 | transform: rotate(110deg)
218 | animation-timing-function: ease-in-o
219 |
220 |
221 | .openUpLeftOut
222 | animation-name: openUpLeftOut
223 |
224 |
225 | @keyframes openUpRightOut
226 | 0%
227 | opacity: 1
228 | transform-origin: top right
229 | transform: rotate(0deg)
230 | animation-timing-function: ease-out
231 | 100%
232 | opacity: 0
233 | transform-origin: top right
234 | transform: rotate(-110deg)
235 | animation-timing-function: ease-in-o
236 |
237 |
238 | .openUpRightOut
239 | animation-name: openUpRightOut
240 |
241 |
242 | @keyframes perspectiveDown
243 | 0%
244 | transform-origin: 0 100%
245 | transform: perspective(800px) rotateX(0deg)
246 | 100%
247 | transform-origin: 0 100%
248 | transform: perspective(800px) rotateX(-180deg)
249 |
250 |
251 | .perspectiveDown
252 | backface-visibility: visible !important
253 | animation-name: perspectiveDown
254 |
255 |
256 | @keyframes perspectiveLeft
257 | 0%
258 | transform-origin: 0 0
259 | transform: perspective(800px) rotateY(0deg)
260 | 100%
261 | transform-origin: 0 0
262 | transform: perspective(800px) rotateY(-180deg)
263 |
264 |
265 | .perspectiveLeft
266 | backface-visibility: visible !important
267 | animation-name: perspectiveLeft
268 |
269 |
270 | @keyframes perspectiveRight
271 | 0%
272 | transform-origin: 100% 0
273 | transform: perspective(800px) rotateY(0deg)
274 | 100%
275 | transform-origin: 100% 0
276 | transform: perspective(800px) rotateY(180deg)
277 |
278 |
279 | .perspectiveRight
280 | backface-visibility: visible !important
281 | animation-name: perspectiveRight
282 |
283 |
284 | @keyframes perspectiveUp
285 | 0%
286 | transform-origin: 0 0
287 | transform: perspective(800px) rotateX(0deg)
288 | 100%
289 | transform-origin: 0 0
290 | transform: perspective(800px) rotateX(180deg)
291 |
292 |
293 | .perspectiveUp
294 | backface-visibility: visible !important
295 | animation-name: perspectiveUp
296 |
297 |
298 | @keyframes perspectiveDownReturn
299 | 0%
300 | transform-origin: 0 100%
301 | transform: perspective(800px) rotateX(-180deg)
302 | 100%
303 | transform-origin: 0 100%
304 | transform: perspective(800px) rotateX(0deg)
305 |
306 |
307 | .perspectiveDownReturn
308 | backface-visibility: visible !important
309 | animation-name: perspectiveDownReturn
310 |
311 |
312 | @keyframes perspectiveLeftReturn
313 | 0%
314 | transform-origin: 0 0
315 | transform: perspective(800px) rotateY(-180deg)
316 | 100%
317 | transform-origin: 0 0
318 | transform: perspective(800px) rotateY(0deg)
319 |
320 |
321 | .perspectiveLeftReturn
322 | backface-visibility: visible !important
323 | animation-name: perspectiveLeftReturn
324 |
325 |
326 | @keyframes perspectiveRightReturn
327 | 0%
328 | transform-origin: 100% 0
329 | transform: perspective(800px) rotateY(180deg)
330 | 100%
331 | transform-origin: 100% 0
332 | transform: perspective(800px) rotateY(0deg)
333 |
334 |
335 | .perspectiveRightReturn
336 | backface-visibility: visible !important
337 | animation-name: perspectiveRightReturn
338 |
339 |
340 | @keyframes perspectiveUpReturn
341 | 0%
342 | transform-origin: 0 0
343 | transform: perspective(800px) rotateX(180deg)
344 | 100%
345 | transform-origin: 0 0
346 | transform: perspective(800px) rotateX(0deg)
347 |
348 |
349 | .perspectiveUpReturn
350 | backface-visibility: visible !important
351 | animation-name: perspectiveUpReturn
352 |
353 |
354 | @keyframes puffIn
355 | 0%
356 | opacity: 0
357 | transform-origin: 50% 50%
358 | transform: scale(2.0,2.0)
359 | filter: blur(2px)
360 | 100%
361 | opacity: 1
362 | transform-origin: 50% 50%
363 | transform: scale(1.0,1.0)
364 |
365 |
366 | .puffIn
367 | animation-name: puffIn
368 |
369 |
370 | @keyframes puffOut
371 | 0%
372 | opacity: 1
373 | transform-origin: 50% 50%
374 | transform: scale(1.0,1.0)
375 | 100%
376 | opacity: 0
377 | transform-origin: 50% 50%
378 | transform: scale(2.0,2.0)
379 | filter: blur(2px)
380 |
381 |
382 | .puffOut
383 | animation-name: puffOut
384 |
385 |
386 | @keyframes rotateDown
387 | 0%
388 | transform-origin: 0 0
389 | transform: perspective(800px) rotateX(0deg) translateZ(0px)
390 | 100%
391 | opacity: 0
392 | transform-origin: 50% 100%
393 | transform: perspective(800px) rotateX(-180deg) translateZ(300px)
394 |
395 |
396 | .rotateDown
397 | backface-visibility: visible !important
398 | animation-name: rotateDown
399 |
400 |
401 | @keyframes rotateLeft
402 | 0%
403 | transform-origin: 0 0
404 | transform: perspective(800px) rotateY(0deg) translateZ(0px)
405 | 100%
406 | opacity: 0
407 | transform-origin: 50% 0
408 | transform: perspective(800px) rotateY(180deg) translateZ(300px)
409 |
410 |
411 | .rotateLeft
412 | backface-visibility: visible !important
413 | animation-name: rotateLeft
414 |
415 |
416 | @keyframes rotateRight
417 | 0%
418 | transform-origin: 0 0
419 | transform: perspective(800px) rotateY(0deg) translate3d(0px)
420 | 100%
421 | opacity: 0
422 | transform-origin: 50% 0
423 | transform: perspective(800px) rotateY(-180deg) translateZ(150px)
424 |
425 |
426 | .rotateRight
427 | backface-visibility: visible !important
428 | animation-name: rotateRight
429 |
430 |
431 | @keyframes rotateUp
432 | 0%
433 | transform-origin: 0 0
434 | transform: perspective(800px) rotateX(0deg) translateZ(0px)
435 | 100%
436 | opacity: 0
437 | transform-origin: 50% 0
438 | transform: perspective(800px) rotateX(180deg) translateZ(100px)
439 |
440 |
441 | .rotateUp
442 | backface-visibility: visible !important
443 | animation-name: rotateUp
444 |
445 |
446 | @keyframes slideDown
447 | 0%
448 | transform-origin: 0 0
449 | transform: translateY(0%)
450 | 100%
451 | transform-origin: 0 0
452 | transform: translateY(100%)
453 |
454 |
455 | .slideDown
456 | animation-name: slideDown
457 |
458 |
459 | @keyframes slideLeft
460 | 0%
461 | transform-origin: 0 0
462 | transform: translateX(0%)
463 | 100%
464 | transform-origin: 0 0
465 | transform: translateX(-100%)
466 |
467 |
468 | .slideLeft
469 | animation-name: slideLeft
470 |
471 |
472 | @keyframes slideRight
473 | 0%
474 | transform-origin: 0 0
475 | transform: translateX(0%)
476 | 100%
477 | transform-origin: 0 0
478 | transform: translateX(100%)
479 |
480 |
481 | .slideRight
482 | animation-name: slideRight
483 |
484 |
485 | @keyframes slideUp
486 | 0%
487 | transform-origin: 0 0
488 | transform: translateY(0%)
489 | 100%
490 | transform-origin: 0 0
491 | transform: translateY(-100%)
492 |
493 |
494 | .slideUp
495 | animation-name: slideUp
496 |
497 |
498 | @keyframes slideDownReturn
499 | 0%
500 | transform-origin: 0 0
501 | transform: translateY(100%)
502 | 100%
503 | transform-origin: 0 0
504 | transform: translateY(0%)
505 |
506 |
507 | .slideDownReturn
508 | animation-name: slideDownReturn
509 |
510 |
511 | @keyframes slideLeftReturn
512 | 0%
513 | transform-origin: 0 0
514 | transform: translateX(-100%)
515 | 100%
516 | transform-origin: 0 0
517 | transform: translateX(0%)
518 |
519 |
520 | .slideLeftReturn
521 | animation-name: slideLeftReturn
522 |
523 |
524 | @keyframes slideRightReturn
525 | 0%
526 | transform-origin: 0 0
527 | transform: translateX(100%)
528 | 100%
529 | transform-origin: 0 0
530 | transform: translateX(0%)
531 |
532 |
533 | .slideRightReturn
534 | animation-name: slideRightReturn
535 |
536 |
537 | @keyframes slideUpReturn
538 | 0%
539 | transform-origin: 0 0
540 | transform: translateY(-100%)
541 | 100%
542 | transform-origin: 0 0
543 | transform: translateY(0%)
544 |
545 |
546 | .slideUpReturn
547 | animation-name: slideUpReturn
548 |
549 |
550 | @keyframes swap
551 | 0%
552 | opacity: 0
553 | transform-origin: 0 100%
554 | transform: scale(0.0,0.0) translate(-700px,0px)
555 | 100%
556 | opacity: 1
557 | transform-origin: 100% 100%
558 | transform: scale(1.0,1.0) translate(0px,0px)
559 |
560 |
561 | .swap
562 | animation-name: swap
563 |
564 |
565 | @keyframes twisterInDown
566 | 0%
567 | opacity: 0
568 | transform-origin: 0 100%
569 | transform: scale(0.0,0.0) rotate(360deg) translateY(-100%)
570 | 30%
571 | transform-origin: 0 100%
572 | transform: scale(0.0,0.0) rotate(360deg) translateY(-100%)
573 | 100%
574 | opacity: 1
575 | transform-origin: 100% 100%
576 | transform: scale(1.0,1.0) rotate(0deg) translateY(0%)
577 |
578 |
579 | .twisterInDown
580 | animation-name: twisterInDown
581 |
582 |
583 | @keyframes twisterInUp
584 | 0%
585 | opacity: 0
586 | transform-origin: 100% 0
587 | transform: scale(0.0,0.0) rotate(360deg) translateY(100%)
588 | 30%
589 | transform-origin: 100% 0
590 | transform: scale(0.0,0.0) rotate(360deg) translateY(100%)
591 | 100%
592 | opacity: 1
593 | transform-origin: 0 0
594 | transform: scale(1.0,1.0) rotate(0deg) translateY(0)
595 |
596 |
597 | .twisterInUp
598 | animation-name: twisterInUp
599 |
600 |
601 | @keyframes vanishIn
602 | 0%
603 | opacity: 0
604 | transform-origin: 50% 50%
605 | transform: scale(2.0,2.0)
606 | filter: blur(90px)
607 | 100%
608 | opacity: 1
609 | transform-origin: 50% 50%
610 | transform: scale(1.0,1.0)
611 |
612 |
613 | .vanishIn
614 | animation-name: vanishIn
615 |
616 |
617 | @keyframes vanishOut
618 | 0%
619 | opacity: 1
620 | transform-origin: 50% 50%
621 | transform: scale(1.0,1.0)
622 | 100%
623 | opacity: 0
624 | transform-origin: 50% 50%
625 | transform: scale(2.0,2.0)
626 | filter: blur(20px)
627 |
628 |
629 | .vanishOut
630 | animation-name: vanishOut
631 |
632 |
633 | @keyframes swashOut
634 | 0%
635 | opacity: 1
636 | transform-origin: 50% 50%
637 | transform: scale(1.0,1.0)
638 | 80%
639 | opacity: 1
640 | transform-origin: 50% 50%
641 | transform: scale(0.9,0.9)
642 | 100%
643 | opacity: 0
644 | transform-origin: 50% 50%
645 | transform: scale(0.0,0.0)
646 |
647 |
648 | .swashOut
649 | animation-name: swashOut
650 |
651 |
652 | @keyframes swashIn
653 | 0%
654 | opacity: 0
655 | transform-origin: 50% 50%
656 | transform: scale(0.0,0.0)
657 | 90%
658 | opacity: 1
659 | transform-origin: 50% 50%
660 | transform: scale(0.9,0.9)
661 | 100%
662 | transform-origin: 50% 50%
663 | transform: scale(1.0,1.0)
664 |
665 |
666 | .swashIn
667 | animation-name: swashIn
668 |
669 |
670 | @keyframes foolishOut
671 | 0%
672 | opacity: 1
673 | transform-origin: 50% 50%
674 | transform: scale(1.0,1.0) rotate(360deg)
675 | 20%
676 | opacity: 1
677 | transform-origin: 0% 0%
678 | transform: scale(0.5,0.5) rotate(0deg)
679 | 40%
680 | opacity: 1
681 | transform-origin: 100% 0%
682 | transform: scale(0.5,0.5) rotate(0deg)
683 | 60%
684 | opacity: 1
685 | transform-origin: 100%% 100%
686 | transform: scale(0.5,0.5) rotate(0deg)
687 | 80%
688 | opacity: 1
689 | transform-origin: 0% 100%
690 | transform: scale(0.5,0.5) rotate(0deg)
691 | 100%
692 | opacity: 0
693 | transform-origin: 50% 50%
694 | transform: scale(0.0,0.0) rotate(0deg)
695 |
696 |
697 | .foolishOut
698 | animation-name: foolishOut
699 |
700 |
701 | @keyframes foolishIn
702 | 0%
703 | opacity: 0
704 | transform-origin: 50% 50%
705 | transform: scale(0.0,0.0) rotate(360deg)
706 | 20%
707 | opacity: 1
708 | transform-origin: 0% 100%
709 | transform: scale(0.5,0.5) rotate(0deg)
710 | 40%
711 | opacity: 1
712 | transform-origin: 100% 100%
713 | transform: scale(0.5,0.5) rotate(0deg)
714 | 60%
715 | opacity: 1
716 | transform-origin: 100%% 0%
717 | transform: scale(0.5,0.5) rotate(0deg)
718 | 80%
719 | opacity: 1
720 | transform-origin: 0% 0%
721 | transform: scale(0.5,0.5) rotate(0deg)
722 | 100%
723 | opacity: 1
724 | transform-origin: 50% 50%
725 | transform: scale(1.0,1.0) rotate(0deg)
726 |
727 |
728 | .foolishIn
729 | animation-name: foolishIn
730 |
731 |
732 | @keyframes holeOut
733 | 0%
734 | opacity: 1
735 | transform-origin: 50% 50%
736 | transform: scale(1.0,1.0) rotateY(0deg)
737 | 100%
738 | opacity: 0
739 | transform-origin: 50% 50%
740 | transform: scale(0.0,0.0) rotateY(180deg)
741 |
742 |
743 | .holeOut
744 | animation-name: holeOut
745 |
746 |
747 | @keyframes tinRightOut
748 | 0%, 20%, 40%, 50%
749 | opacity: 1
750 | transform: scale(1.0,1.0) translateX(0)
751 | 10%, 30%
752 | opacity: 1
753 | transform: scale(1.1,1.1) translateX(0)
754 | 100%
755 | opacity: 0
756 | transform: scale(1.0,1.0) translateX(900%)
757 |
758 |
759 | .tinRightOut
760 | animation-name: tinRightOut
761 |
762 |
763 | @keyframes tinLeftOut
764 | 0%, 20%, 40%, 50%
765 | opacity: 1
766 | transform: scale(1.0,1.0) translateX(0)
767 | 10%, 30%
768 | opacity: 1
769 | transform: scale(1.1,1.1) translateX(0)
770 | 100%
771 | opacity: 0
772 | transform: scale(1.0,1.0) translateX(-900%)
773 |
774 |
775 | .tinLeftOut
776 | animation-name: tinLeftOut
777 |
778 |
779 | @keyframes tinUpOut
780 | 0%, 20%, 40%, 50%
781 | opacity: 1
782 | transform: scale(1.0,1.0) translateY(0)
783 | 10%, 30%
784 | opacity: 1
785 | transform: scale(1.1,1.1) translateY(0)
786 | 100%
787 | opacity: 0
788 | transform: scale(1.0,1.0) translateY(-900%)
789 |
790 |
791 | .tinUpOut
792 | animation-name: tinUpOut
793 |
794 |
795 | @keyframes tinDownOut
796 | 0%, 20%, 40%, 50%
797 | opacity: 1
798 | transform: scale(1.0,1.0) translateY(0)
799 | 10%, 30%
800 | opacity: 1
801 | transform: scale(1.1,1.1) translateY(0)
802 | 100%
803 | opacity: 0
804 | transform: scale(1.0,1.0) translateY(900%)
805 |
806 |
807 | .tinDownOut
808 | animation-name: tinDownOut
809 |
810 |
811 | @keyframes tinRightIn
812 | 0%
813 | opacity: 0
814 | transform: scale(1.0,1.0) translateX(900%)
815 | 50%, 70%, 90%
816 | opacity: 1
817 | transform: scale(1.1,1.1) translateX(0)
818 | 60%, 80%, 100%
819 | opacity: 1
820 | transform: scale(1.0,1.0) translateX(0)
821 |
822 |
823 | .tinRightIn
824 | animation-name: tinRightIn
825 |
826 |
827 | @keyframes tinLeftIn
828 | 0%
829 | opacity: 0
830 | transform: scale(1.0,1.0) translateX(-900%)
831 | 50%, 70%, 90%
832 | opacity: 1
833 | transform: scale(1.1,1.1) translateX(0)
834 | 60%, 80%, 100%
835 | opacity: 1
836 | transform: scale(1.0,1.0) translateX(0)
837 |
838 |
839 | .tinLeftIn
840 | animation-name: tinLeftIn
841 |
842 |
843 | @keyframes tinUpIn
844 | 0%
845 | opacity: 0
846 | transform: scale(1.0,1.0) translateY(-900%)
847 | 50%, 70%, 90%
848 | opacity: 1
849 | transform: scale(1.1,1.1) translateY(0)
850 | 60%, 80%, 100%
851 | opacity: 1
852 | transform: scale(1.0,1.0) translateY(0)
853 |
854 |
855 | .tinUpIn
856 | animation-name: tinUpIn
857 |
858 |
859 | @keyframes tinDownIn
860 | 0%
861 | opacity: 0
862 | transform: scale(1.0,1.0) translateY(900%)
863 | 50%, 70%, 90%
864 | opacity: 1
865 | transform: scale(1.1,1.1) translateY(0)
866 | 60%, 80%, 100%
867 | opacity: 1
868 | transform: scale(1.0,1.0) translateY(0)
869 |
870 |
871 | .tinDownIn
872 | animation-name: tinDownIn
873 |
874 |
875 | @keyframes bombRightOut
876 | 0%
877 | opacity: 1
878 | transform-origin: 50% 50%
879 | transform: rotate(0deg)
880 | filter: blur(0px)
881 | 50%
882 | opacity: 1
883 | transform-origin: 200% 50%
884 | transform: rotate(160deg)
885 | filter: blur(0px)
886 | 100%
887 | opacity: 0
888 | transform-origin: 200% 50%
889 | transform: rotate(160deg)
890 | filter: blur(20px)
891 |
892 |
893 | .bombRightOut
894 | animation-name: bombRightOut
895 |
896 |
897 | @keyframes bombLeftOut
898 | 0%
899 | opacity: 1
900 | transform-origin: 50% 50%
901 | transform: rotate(0deg)
902 | filter: blur(0px)
903 | 50%
904 | opacity: 1
905 | transform-origin: -100% 50%
906 | transform: rotate(-160deg)
907 | filter: blur(0px)
908 | 100%
909 | opacity: 0
910 | transform-origin: -100% 50%
911 | transform: rotate(-160deg)
912 | filter: blur(20px)
913 |
914 | .bombLeftOut
915 | animation-name: bombLeftOut
916 |
--------------------------------------------------------------------------------
/public/css/style.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "ArcadeClassic";
3 | src: url("/font/ArcadeClassic.otf") format("opentype");
4 | }
5 |
6 | @font-face {
7 | font-family: "TRON";
8 | src: url("/font/TRON.TTF") format("truetype");
9 | }
10 |
11 | /* Standard Elements */
12 |
13 | html,
14 | body {
15 | margin: 0;
16 | padding: 0;
17 | height: 100%;
18 | }
19 |
20 | /* Body content */
21 |
22 | body {
23 | font-family: "ArcadeClassic";
24 | font-size: 20px;
25 | letter-spacing: 2px;
26 | word-spacing: 0.5em;
27 | color: white;
28 |
29 | background-image: url("/img/background.gif");
30 | }
31 |
32 | /* comments colors */
33 |
34 | #comments {
35 | color: #00ff00;
36 | }
37 |
38 | /* logo */
39 |
40 | #logo {
41 | font-family: "TRON";
42 | font-size: 30px;
43 | color: white;
44 | padding-top: 5px;
45 | padding-bottom: 30px;
46 | }
47 |
48 | /* mascot (the real image displayed in homepage) */
49 |
50 | #mascot {
51 | padding-bottom: 20px;
52 | }
53 |
54 | /* container */
55 |
56 | #container {
57 | min-height: 100%;
58 | position: relative;
59 | }
60 |
61 | /* content */
62 |
63 | #content {
64 | text-align: center;
65 |
66 | padding: 10px;
67 |
68 | /*
69 | change the following value if footer
70 | goes over page content, for example "fight" button
71 | */
72 |
73 | padding-bottom: 170px;
74 | }
75 |
76 | /* message box */
77 |
78 | #message_box {
79 | padding-left: 10px;
80 | padding-right: 10px;
81 | }
82 |
83 | /* button menu */
84 |
85 | #button_menu {
86 | padding-bottom: 20px;
87 | }
88 |
89 | #button_menu a {
90 | text-decoration: none;
91 | }
92 |
93 | /* style of buttons */
94 |
95 | .button_link {
96 | padding: 5px 10px;
97 | background: #1d3069;
98 | color: #FFF;
99 |
100 | border: solid 2px #ffd220;
101 |
102 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
103 |
104 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
105 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
106 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
107 | }
108 |
109 | .button_link a {
110 | color: white;
111 | text-decoration: none;
112 | }
113 |
114 | .button_link:hover {
115 | background: #395fcf;
116 | text-decoration: none;
117 | }
118 |
119 | .button_link:active {
120 | -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
121 | -moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
122 | box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
123 |
124 | background: #15234d;
125 | }
126 |
127 | /* text input */
128 |
129 | input {
130 | color: #ffd220;
131 | font-family: ArcadeClassic;
132 | /* font-weight: bold; */
133 | font-size: 24px;
134 |
135 | border: 2px solid #54d8ef;
136 |
137 | background-color: #192a44;
138 | }
139 |
140 | /* place holder for the input box */
141 |
142 | ::-webkit-input-placeholder { /* WebKit, Blink, Edge */
143 | color: #51533b;
144 | }
145 | :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
146 | color: #51533b;
147 | opacity: 1;
148 | }
149 | ::-moz-placeholder { /* Mozilla Firefox 19+ */
150 | color: #51533b;
151 | opacity: 1;
152 | }
153 | :-ms-input-placeholder { /* Internet Explorer 10-11 */
154 | color: #51533b;
155 | }
156 | :placeholder-shown { /* Standard (https://drafts.csswg.org/selectors-4/#placeholder) */
157 | color: #51533b;
158 | }
159 |
160 | /* info_box */
161 |
162 | #info_box {
163 | background-color: #192a44;
164 | color: white;
165 | border: 5px solid #ffd220;
166 |
167 | padding: 5px;
168 |
169 | clear: both;
170 | }
171 |
172 | #info_box a {
173 | text-decoration: none;
174 | color: #54d8ef;
175 | }
176 |
177 | #info_box a:hover {
178 | text-decoration: underline;
179 | }
180 |
181 | /* achievement box */
182 |
183 | #achieve_box {
184 | background-color: #192a44;
185 | color: white;
186 | border: 5px solid #ffd220;
187 |
188 | padding: 5px;
189 |
190 | text-align: center;
191 | clear: both;
192 | }
193 |
194 | /* footer */
195 |
196 | #footer {
197 | width: 100%;
198 | position: absolute;
199 | bottom: 0;
200 | left: 0;
201 |
202 | background-color: #192a44;
203 | color: white;
204 |
205 | border-top: 5px solid #ffd220;
206 |
207 | text-align: center;
208 | }
209 |
210 | #footer a {
211 | color: #54d8ef;
212 | text-decoration: none;
213 | }
214 |
215 | #footer a:hover {
216 | text-decoration: underline;
217 | }
218 |
219 | /* style for buttons placed in footer */
220 |
221 | #footer .button_link {
222 | color: white;
223 | }
224 |
225 | #footer .button_link:hover {
226 | text-decoration: none;
227 | }
228 |
--------------------------------------------------------------------------------
/public/font/ArcadeClassic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/font/ArcadeClassic.otf
--------------------------------------------------------------------------------
/public/font/TRON.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/font/TRON.TTF
--------------------------------------------------------------------------------
/public/img/ASSETS.md:
--------------------------------------------------------------------------------
1 | # GITRON Pixel Art
2 |
3 | Here are a few pixel art I draw for Gitron web app.
4 | To find out more about the characters checkout the [Tron Wiki](https://tron.fandom.com/wiki/Tron_Wiki)
5 |
6 | # Avatar API
7 |
8 | If you'd like to see your own GitHub repository as a Tron character just query these endpoints:
9 |
10 | ```
11 | https://gitron.fly.dev/avatar/:github_username/:github_repository_name
12 |
13 | https://gitron.fly.dev/avatar/disk/:github_username/:github_repository_name
14 | ```
15 |
16 | Example: http://gitron.fly.dev/avatar/syxanash/gitron
17 |
18 | ## Fighting Characters
19 |
20 | Old grid programs | New grid programs | ISOs
21 | ------------------|-------------------|-----
22 | data pusher old | data pusher new | iso female
23 |  |  | 
24 | data pusher old | data pusher new | iso male
25 |  |  | 
26 | data pusher old | damaged program | iso male
27 |  |  | 
28 | Dumont | Perl | iso male
29 |  |  | 
30 | Guard | Black Guard | iso female
31 |  |  | 
32 | Sark's Lieutenant | Paige | old iso male
33 |  |  | 
34 | Ram | Dyson | young iso female
35 |  |  | 
36 | Yori | Jarvis | young iso male
37 |  |  | 
38 | Clu 1.0 | Sam Flynn | Calchas
39 |  |  | 
40 | Kevin Flynn (red) | Rinzler (red) | Ada
41 |  |  | 
42 | Kevin Flynn (blue) | Rinzler (blue) | Quorra
43 |  |  | 
44 | Sark | Clu 2.0 | Giles
45 |  |  | 
46 | Tron | Tron (Uprising) | Ophelia (Radia)
47 |  |  | 
48 |
49 | ## Special Fighting Characters
50 |
51 | Tron 2.0 | Tron (1982) | Tron: Legacy
52 | ---------|-------------|-------------
53 | Jet Bradley | Master Control Program | Kevin Flynn
54 |  |  | 
55 |
56 | ## Identity disc
57 |
58 | New grid | Old grid | Special
59 | ---------|----------|--------
60 |  |  | 
61 |  |  | 
62 |  | |
63 |
64 | ## BIT
65 |
66 | Steady | False | true
67 | -------|-------|-----
68 |  |  | 
69 |
70 | ## Other Characters
71 |
72 | Castor| Flynn | Infection
73 | ------|-------|----------
74 |  |  |  
75 |
76 | ## Logo
77 |
78 | Recognizer | Logo 1 | Logo 2 | Loading
79 | -----------|--------|--------|--------
80 |  |  |  | 
81 |
82 | ## License
83 |
84 | All rights reserved for images and assets inside `./img/` directory.
85 |
86 | _don't you dare making an NFT out of these! :)_
87 |
--------------------------------------------------------------------------------
/public/img/background.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/background.gif
--------------------------------------------------------------------------------
/public/img/bit/bit.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/bit/bit.gif
--------------------------------------------------------------------------------
/public/img/bit/false.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/bit/false.gif
--------------------------------------------------------------------------------
/public/img/bit/true.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/bit/true.gif
--------------------------------------------------------------------------------
/public/img/busted.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/busted.gif
--------------------------------------------------------------------------------
/public/img/characters-extra/castor.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters-extra/castor.gif
--------------------------------------------------------------------------------
/public/img/characters-extra/derezzed-blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters-extra/derezzed-blue.png
--------------------------------------------------------------------------------
/public/img/characters-extra/derezzed-red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters-extra/derezzed-red.png
--------------------------------------------------------------------------------
/public/img/characters-extra/flynn-young.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters-extra/flynn-young.png
--------------------------------------------------------------------------------
/public/img/characters-extra/infected-program.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters-extra/infected-program.png
--------------------------------------------------------------------------------
/public/img/characters-extra/infection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters-extra/infection.png
--------------------------------------------------------------------------------
/public/img/characters-extra/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters-extra/logo.png
--------------------------------------------------------------------------------
/public/img/characters-extra/recognizer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters-extra/recognizer.png
--------------------------------------------------------------------------------
/public/img/characters-extra/special-logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters-extra/special-logo.gif
--------------------------------------------------------------------------------
/public/img/characters/ada.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/ada.png
--------------------------------------------------------------------------------
/public/img/characters/black_guard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/black_guard.png
--------------------------------------------------------------------------------
/public/img/characters/calchas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/calchas.png
--------------------------------------------------------------------------------
/public/img/characters/clu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/clu.png
--------------------------------------------------------------------------------
/public/img/characters/clu2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/clu2.png
--------------------------------------------------------------------------------
/public/img/characters/damaged_program.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/damaged_program.png
--------------------------------------------------------------------------------
/public/img/characters/data_pusher_new_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/data_pusher_new_1.png
--------------------------------------------------------------------------------
/public/img/characters/data_pusher_new_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/data_pusher_new_2.png
--------------------------------------------------------------------------------
/public/img/characters/data_pusher_old_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/data_pusher_old_1.png
--------------------------------------------------------------------------------
/public/img/characters/data_pusher_old_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/data_pusher_old_2.png
--------------------------------------------------------------------------------
/public/img/characters/data_pusher_old_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/data_pusher_old_3.png
--------------------------------------------------------------------------------
/public/img/characters/dumont.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/dumont.png
--------------------------------------------------------------------------------
/public/img/characters/dyson.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/dyson.png
--------------------------------------------------------------------------------
/public/img/characters/flynn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/flynn.png
--------------------------------------------------------------------------------
/public/img/characters/flynn_converted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/flynn_converted.png
--------------------------------------------------------------------------------
/public/img/characters/giles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/giles.png
--------------------------------------------------------------------------------
/public/img/characters/guard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/guard.png
--------------------------------------------------------------------------------
/public/img/characters/iso_female_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/iso_female_1.png
--------------------------------------------------------------------------------
/public/img/characters/iso_female_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/iso_female_3.png
--------------------------------------------------------------------------------
/public/img/characters/iso_male_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/iso_male_1.png
--------------------------------------------------------------------------------
/public/img/characters/iso_male_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/iso_male_2.png
--------------------------------------------------------------------------------
/public/img/characters/iso_male_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/iso_male_3.png
--------------------------------------------------------------------------------
/public/img/characters/jarvis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/jarvis.png
--------------------------------------------------------------------------------
/public/img/characters/jet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/jet.png
--------------------------------------------------------------------------------
/public/img/characters/kevin_flynn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/kevin_flynn.png
--------------------------------------------------------------------------------
/public/img/characters/mcp.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/mcp.gif
--------------------------------------------------------------------------------
/public/img/characters/old_iso_male.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/old_iso_male.png
--------------------------------------------------------------------------------
/public/img/characters/ophelia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/ophelia.png
--------------------------------------------------------------------------------
/public/img/characters/paige.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/paige.png
--------------------------------------------------------------------------------
/public/img/characters/perl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/perl.png
--------------------------------------------------------------------------------
/public/img/characters/quorra.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/quorra.png
--------------------------------------------------------------------------------
/public/img/characters/ram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/ram.png
--------------------------------------------------------------------------------
/public/img/characters/rinzler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/rinzler.png
--------------------------------------------------------------------------------
/public/img/characters/rinzler_converted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/rinzler_converted.png
--------------------------------------------------------------------------------
/public/img/characters/sam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/sam.png
--------------------------------------------------------------------------------
/public/img/characters/sark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/sark.png
--------------------------------------------------------------------------------
/public/img/characters/sarks_lieutenant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/sarks_lieutenant.png
--------------------------------------------------------------------------------
/public/img/characters/tron.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/tron.png
--------------------------------------------------------------------------------
/public/img/characters/tron_uprising.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/tron_uprising.png
--------------------------------------------------------------------------------
/public/img/characters/yori.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/yori.png
--------------------------------------------------------------------------------
/public/img/characters/young_iso_female.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/young_iso_female.png
--------------------------------------------------------------------------------
/public/img/characters/young_iso_male.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/characters/young_iso_male.png
--------------------------------------------------------------------------------
/public/img/disk/black-blue.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/disk/black-blue.gif
--------------------------------------------------------------------------------
/public/img/disk/black-red.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/disk/black-red.gif
--------------------------------------------------------------------------------
/public/img/disk/black-yellow.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/disk/black-yellow.gif
--------------------------------------------------------------------------------
/public/img/disk/blue-purple.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/disk/blue-purple.gif
--------------------------------------------------------------------------------
/public/img/disk/blue-white-new.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/disk/blue-white-new.gif
--------------------------------------------------------------------------------
/public/img/disk/blue-white.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/disk/blue-white.gif
--------------------------------------------------------------------------------
/public/img/disk/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/disk/loading.gif
--------------------------------------------------------------------------------
/public/img/disk/red-white.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/disk/red-white.gif
--------------------------------------------------------------------------------
/public/img/disk/yellow-white.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/disk/yellow-white.gif
--------------------------------------------------------------------------------
/public/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/img/favicon.ico
--------------------------------------------------------------------------------
/public/js/noty/jquery.noty.js:
--------------------------------------------------------------------------------
1 | /**
2 | * noty - jQuery Notification Plugin v2.2.2
3 | * Contributors: https://github.com/needim/noty/graphs/contributors
4 | *
5 | * Examples and Documentation - http://needim.github.com/noty/
6 | *
7 | * Licensed under the MIT licenses:
8 | * http://www.opensource.org/licenses/mit-license.php
9 | *
10 | **/
11 |
12 | if (typeof Object.create !== 'function') {
13 | Object.create = function (o) {
14 | function F() {
15 | }
16 |
17 | F.prototype = o;
18 | return new F();
19 | };
20 | }
21 |
22 | (function ($) {
23 |
24 | var NotyObject = {
25 |
26 | init:function (options) {
27 |
28 | // Mix in the passed in options with the default options
29 | this.options = $.extend({}, $.noty.defaults, options);
30 |
31 | this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout];
32 |
33 | if ($.noty.themes[this.options.theme])
34 | this.options.theme = $.noty.themes[this.options.theme];
35 | else
36 | options.themeClassName = this.options.theme;
37 |
38 | delete options.layout;
39 | delete options.theme;
40 |
41 | this.options = $.extend({}, this.options, this.options.layout.options);
42 | this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random() * 1000000));
43 |
44 | this.options = $.extend({}, this.options, options);
45 |
46 | // Build the noty dom initial structure
47 | this._build();
48 |
49 | // return this so we can chain/use the bridge with less code.
50 | return this;
51 | }, // end init
52 |
53 | _build:function () {
54 |
55 | // Generating noty bar
56 | var $bar = $('
').attr('id', this.options.id);
57 | $bar.append(this.options.template).find('.noty_text').html(this.options.text);
58 |
59 | this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar;
60 |
61 | if (this.options.themeClassName)
62 | this.$bar.addClass(this.options.themeClassName).addClass('noty_container_type_' + this.options.type);
63 |
64 | // Set buttons if available
65 | if (this.options.buttons) {
66 |
67 | // If we have button disable closeWith & timeout options
68 | this.options.closeWith = [];
69 | this.options.timeout = false;
70 |
71 | var $buttons = $('
').addClass('noty_buttons');
72 |
73 | (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons);
74 |
75 | var self = this;
76 |
77 | $.each(this.options.buttons, function (i, button) {
78 | var $button = $(' ').addClass((button.addClass) ? button.addClass : 'gray').html(button.text).attr('id', button.id ? button.id : 'button-' + i)
79 | .appendTo(self.$bar.find('.noty_buttons'))
80 | .bind('click', function () {
81 | if ($.isFunction(button.onClick)) {
82 | button.onClick.call($button, self);
83 | }
84 | });
85 | });
86 | }
87 |
88 | // For easy access
89 | this.$message = this.$bar.find('.noty_message');
90 | this.$closeButton = this.$bar.find('.noty_close');
91 | this.$buttons = this.$bar.find('.noty_buttons');
92 |
93 | $.noty.store[this.options.id] = this; // store noty for api
94 |
95 | }, // end _build
96 |
97 | show:function () {
98 |
99 | var self = this;
100 |
101 | (self.options.custom) ? self.options.custom.find(self.options.layout.container.selector).append(self.$bar) : $(self.options.layout.container.selector).append(self.$bar);
102 |
103 | if (self.options.theme && self.options.theme.style)
104 | self.options.theme.style.apply(self);
105 |
106 | ($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {});
107 |
108 | self.$bar.addClass(self.options.layout.addClass);
109 |
110 | self.options.layout.container.style.apply($(self.options.layout.container.selector));
111 |
112 | self.showing = true;
113 |
114 | if (self.options.theme && self.options.theme.style)
115 | self.options.theme.callback.onShow.apply(this);
116 |
117 | if ($.inArray('click', self.options.closeWith) > -1)
118 | self.$bar.css('cursor', 'pointer').one('click', function (evt) {
119 | self.stopPropagation(evt);
120 | if (self.options.callback.onCloseClick) {
121 | self.options.callback.onCloseClick.apply(self);
122 | }
123 | self.close();
124 | });
125 |
126 | if ($.inArray('hover', self.options.closeWith) > -1)
127 | self.$bar.one('mouseenter', function () {
128 | self.close();
129 | });
130 |
131 | if ($.inArray('button', self.options.closeWith) > -1)
132 | self.$closeButton.one('click', function (evt) {
133 | self.stopPropagation(evt);
134 | self.close();
135 | });
136 |
137 | if ($.inArray('button', self.options.closeWith) == -1)
138 | self.$closeButton.remove();
139 |
140 | if (self.options.callback.onShow)
141 | self.options.callback.onShow.apply(self);
142 |
143 | self.$bar.animate(
144 | self.options.animation.open,
145 | self.options.animation.speed,
146 | self.options.animation.easing,
147 | function () {
148 | if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
149 | self.showing = false;
150 | self.shown = true;
151 | });
152 |
153 | // If noty is have a timeout option
154 | if (self.options.timeout)
155 | self.$bar.delay(self.options.timeout).promise().done(function () {
156 | self.close();
157 | });
158 |
159 | return this;
160 |
161 | }, // end show
162 |
163 | close:function () {
164 |
165 | if (this.closed) return;
166 | if (this.$bar && this.$bar.hasClass('i-am-closing-now')) return;
167 |
168 | var self = this;
169 |
170 | if (this.showing) {
171 | self.$bar.queue(
172 | function () {
173 | self.close.apply(self);
174 | }
175 | )
176 | return;
177 | }
178 |
179 | if (!this.shown && !this.showing) { // If we are still waiting in the queue just delete from queue
180 | var queue = [];
181 | $.each($.noty.queue, function (i, n) {
182 | if (n.options.id != self.options.id) {
183 | queue.push(n);
184 | }
185 | });
186 | $.noty.queue = queue;
187 | return;
188 | }
189 |
190 | self.$bar.addClass('i-am-closing-now');
191 |
192 | if (self.options.callback.onClose) {
193 | self.options.callback.onClose.apply(self);
194 | }
195 |
196 | self.$bar.clearQueue().stop().animate(
197 | self.options.animation.close,
198 | self.options.animation.speed,
199 | self.options.animation.easing,
200 | function () {
201 | if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self);
202 | })
203 | .promise().done(function () {
204 |
205 | // Modal Cleaning
206 | if (self.options.modal) {
207 | $.notyRenderer.setModalCount(-1);
208 | if ($.notyRenderer.getModalCount() == 0) $('.noty_modal').fadeOut('fast', function () {
209 | $(this).remove();
210 | });
211 | }
212 |
213 | // Layout Cleaning
214 | $.notyRenderer.setLayoutCountFor(self, -1);
215 | if ($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove();
216 |
217 | // Make sure self.$bar has not been removed before attempting to remove it
218 | if (typeof self.$bar !== 'undefined' && self.$bar !== null ) {
219 | self.$bar.remove();
220 | self.$bar = null;
221 | self.closed = true;
222 | }
223 |
224 | delete $.noty.store[self.options.id]; // deleting noty from store
225 |
226 | if(self.options.theme.callback && self.options.theme.callback.onClose) {
227 | self.options.theme.callback.onClose.apply(self);
228 | }
229 |
230 | if (!self.options.dismissQueue) {
231 | // Queue render
232 | $.noty.ontap = true;
233 |
234 | $.notyRenderer.render();
235 | }
236 |
237 | if (self.options.maxVisible > 0 && self.options.dismissQueue) {
238 | $.notyRenderer.render();
239 | }
240 | })
241 |
242 | }, // end close
243 |
244 | setText:function (text) {
245 | if (!this.closed) {
246 | this.options.text = text;
247 | this.$bar.find('.noty_text').html(text);
248 | }
249 | return this;
250 | },
251 |
252 | setType:function (type) {
253 | if (!this.closed) {
254 | this.options.type = type;
255 | this.options.theme.style.apply(this);
256 | this.options.theme.callback.onShow.apply(this);
257 | }
258 | return this;
259 | },
260 |
261 | setTimeout:function (time) {
262 | if (!this.closed) {
263 | var self = this;
264 | this.options.timeout = time;
265 | self.$bar.delay(self.options.timeout).promise().done(function () {
266 | self.close();
267 | });
268 | }
269 | return this;
270 | },
271 |
272 | stopPropagation:function (evt) {
273 | evt = evt || window.event;
274 | if (typeof evt.stopPropagation !== "undefined") {
275 | evt.stopPropagation();
276 | } else {
277 | evt.cancelBubble = true;
278 | }
279 | },
280 |
281 | closed:false,
282 | showing:false,
283 | shown:false
284 |
285 | }; // end NotyObject
286 |
287 | $.notyRenderer = {};
288 |
289 | $.notyRenderer.init = function (options) {
290 |
291 | // Renderer creates a new noty
292 | var notification = Object.create(NotyObject).init(options);
293 |
294 | if (notification.options.killer)
295 | $.noty.closeAll();
296 |
297 | (notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification);
298 |
299 | $.notyRenderer.render();
300 |
301 | return ($.noty.returns == 'object') ? notification : notification.options.id;
302 | };
303 |
304 | $.notyRenderer.render = function () {
305 |
306 | var instance = $.noty.queue[0];
307 |
308 | if ($.type(instance) === 'object') {
309 | if (instance.options.dismissQueue) {
310 | if (instance.options.maxVisible > 0) {
311 | if ($(instance.options.layout.container.selector + ' li').length < instance.options.maxVisible) {
312 | $.notyRenderer.show($.noty.queue.shift());
313 | } else {
314 |
315 | }
316 | } else {
317 | $.notyRenderer.show($.noty.queue.shift());
318 | }
319 | } else {
320 | if ($.noty.ontap) {
321 | $.notyRenderer.show($.noty.queue.shift());
322 | $.noty.ontap = false;
323 | }
324 | }
325 | } else {
326 | $.noty.ontap = true; // Queue is over
327 | }
328 |
329 | };
330 |
331 | $.notyRenderer.show = function (notification) {
332 |
333 | if (notification.options.modal) {
334 | $.notyRenderer.createModalFor(notification);
335 | $.notyRenderer.setModalCount(+1);
336 | }
337 |
338 | // Where is the container?
339 | if (notification.options.custom) {
340 | if (notification.options.custom.find(notification.options.layout.container.selector).length == 0) {
341 | notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new'));
342 | } else {
343 | notification.options.custom.find(notification.options.layout.container.selector).removeClass('i-am-new');
344 | }
345 | } else {
346 | if ($(notification.options.layout.container.selector).length == 0) {
347 | $('body').append($(notification.options.layout.container.object).addClass('i-am-new'));
348 | } else {
349 | $(notification.options.layout.container.selector).removeClass('i-am-new');
350 | }
351 | }
352 |
353 | $.notyRenderer.setLayoutCountFor(notification, +1);
354 |
355 | notification.show();
356 | };
357 |
358 | $.notyRenderer.createModalFor = function (notification) {
359 | if ($('.noty_modal').length == 0) {
360 | var modal = $('
').addClass('noty_modal').addClass(notification.options.theme).data('noty_modal_count', 0);
361 |
362 | if (notification.options.theme.modal && notification.options.theme.modal.css)
363 | modal.css(notification.options.theme.modal.css);
364 |
365 | modal.prependTo($('body')).fadeIn('fast');
366 | }
367 | };
368 |
369 | $.notyRenderer.getLayoutCountFor = function (notification) {
370 | return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
371 | };
372 |
373 | $.notyRenderer.setLayoutCountFor = function (notification, arg) {
374 | return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg);
375 | };
376 |
377 | $.notyRenderer.getModalCount = function () {
378 | return $('.noty_modal').data('noty_modal_count') || 0;
379 | };
380 |
381 | $.notyRenderer.setModalCount = function (arg) {
382 | return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg);
383 | };
384 |
385 | // This is for custom container
386 | $.fn.noty = function (options) {
387 | options.custom = $(this);
388 | return $.notyRenderer.init(options);
389 | };
390 |
391 | $.noty = {};
392 | $.noty.queue = [];
393 | $.noty.ontap = true;
394 | $.noty.layouts = {};
395 | $.noty.themes = {};
396 | $.noty.returns = 'object';
397 | $.noty.store = {};
398 |
399 | $.noty.get = function (id) {
400 | return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
401 | };
402 |
403 | $.noty.close = function (id) {
404 | return $.noty.get(id) ? $.noty.get(id).close() : false;
405 | };
406 |
407 | $.noty.setText = function (id, text) {
408 | return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
409 | };
410 |
411 | $.noty.setType = function (id, type) {
412 | return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
413 | };
414 |
415 | $.noty.clearQueue = function () {
416 | $.noty.queue = [];
417 | };
418 |
419 | $.noty.closeAll = function () {
420 | $.noty.clearQueue();
421 | $.each($.noty.store, function (id, noty) {
422 | noty.close();
423 | });
424 | };
425 |
426 | var windowAlert = window.alert;
427 |
428 | $.noty.consumeAlert = function (options) {
429 | window.alert = function (text) {
430 | if (options)
431 | options.text = text;
432 | else
433 | options = {text:text};
434 |
435 | $.notyRenderer.init(options);
436 | };
437 | };
438 |
439 | $.noty.stopConsumeAlert = function () {
440 | window.alert = windowAlert;
441 | };
442 |
443 | $.noty.defaults = {
444 | layout:'top',
445 | theme:'defaultTheme',
446 | type:'alert',
447 | text:'',
448 | dismissQueue:true,
449 | template:'',
450 | animation:{
451 | open:{height:'toggle'},
452 | close:{height:'toggle'},
453 | easing:'swing',
454 | speed:500
455 | },
456 | timeout:false,
457 | force:false,
458 | modal:false,
459 | maxVisible:5,
460 | killer: false,
461 | closeWith:['click'],
462 | callback:{
463 | onShow:function () {
464 | },
465 | afterShow:function () {
466 | },
467 | onClose:function () {
468 | },
469 | afterClose:function () {
470 | },
471 | onCloseClick:function () {
472 | }
473 | },
474 | buttons:false
475 | };
476 |
477 | $(window).resize(function () {
478 | $.each($.noty.layouts, function (index, layout) {
479 | layout.container.style.apply($(layout.container.selector));
480 | });
481 | });
482 |
483 | })(jQuery);
484 |
485 | // Helpers
486 | window.noty = function noty(options) {
487 | return jQuery.notyRenderer.init(options);
488 | };
489 |
--------------------------------------------------------------------------------
/public/js/noty/layouts/bottom.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.bottom = {
4 | name: 'bottom',
5 | options: {},
6 | container: {
7 | object: '',
8 | selector: 'ul#noty_bottom_layout_container',
9 | style: function() {
10 | $(this).css({
11 | bottom: 0,
12 | left: '5%',
13 | position: 'fixed',
14 | width: '90%',
15 | height: 'auto',
16 | margin: 0,
17 | padding: 0,
18 | listStyleType: 'none',
19 | zIndex: 9999999
20 | });
21 | }
22 | },
23 | parent: {
24 | object: ' ',
25 | selector: 'li',
26 | css: {}
27 | },
28 | css: {
29 | display: 'none'
30 | },
31 | addClass: ''
32 | };
33 |
34 | })(jQuery);
--------------------------------------------------------------------------------
/public/js/noty/layouts/bottomCenter.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.bottomCenter = {
4 | name: 'bottomCenter',
5 | options: { // overrides options
6 |
7 | },
8 | container: {
9 | object: '',
10 | selector: 'ul#noty_bottomCenter_layout_container',
11 | style: function() {
12 | $(this).css({
13 | bottom: 20,
14 | left: 0,
15 | position: 'fixed',
16 | width: '310px',
17 | height: 'auto',
18 | margin: 0,
19 | padding: 0,
20 | listStyleType: 'none',
21 | zIndex: 10000000
22 | });
23 |
24 | $(this).css({
25 | left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
26 | });
27 | }
28 | },
29 | parent: {
30 | object: ' ',
31 | selector: 'li',
32 | css: {}
33 | },
34 | css: {
35 | display: 'none',
36 | width: '310px'
37 | },
38 | addClass: ''
39 | };
40 |
41 | })(jQuery);
42 |
--------------------------------------------------------------------------------
/public/js/noty/layouts/bottomLeft.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.bottomLeft = {
4 | name: 'bottomLeft',
5 | options: { // overrides options
6 |
7 | },
8 | container: {
9 | object: '',
10 | selector: 'ul#noty_bottomLeft_layout_container',
11 | style: function() {
12 | $(this).css({
13 | bottom: 20,
14 | left: 20,
15 | position: 'fixed',
16 | width: '310px',
17 | height: 'auto',
18 | margin: 0,
19 | padding: 0,
20 | listStyleType: 'none',
21 | zIndex: 10000000
22 | });
23 |
24 | if (window.innerWidth < 600) {
25 | $(this).css({
26 | left: 5
27 | });
28 | }
29 | }
30 | },
31 | parent: {
32 | object: ' ',
33 | selector: 'li',
34 | css: {}
35 | },
36 | css: {
37 | display: 'none',
38 | width: '310px'
39 | },
40 | addClass: ''
41 | };
42 |
43 | })(jQuery);
--------------------------------------------------------------------------------
/public/js/noty/layouts/bottomRight.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.bottomRight = {
4 | name: 'bottomRight',
5 | options: { // overrides options
6 |
7 | },
8 | container: {
9 | object: '',
10 | selector: 'ul#noty_bottomRight_layout_container',
11 | style: function() {
12 | $(this).css({
13 | bottom: 20,
14 | right: 20,
15 | position: 'fixed',
16 | width: '310px',
17 | height: 'auto',
18 | margin: 0,
19 | padding: 0,
20 | listStyleType: 'none',
21 | zIndex: 10000000
22 | });
23 |
24 | if (window.innerWidth < 600) {
25 | $(this).css({
26 | right: 5
27 | });
28 | }
29 | }
30 | },
31 | parent: {
32 | object: ' ',
33 | selector: 'li',
34 | css: {}
35 | },
36 | css: {
37 | display: 'none',
38 | width: '310px'
39 | },
40 | addClass: ''
41 | };
42 |
43 | })(jQuery);
--------------------------------------------------------------------------------
/public/js/noty/layouts/center.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.center = {
4 | name: 'center',
5 | options: { // overrides options
6 |
7 | },
8 | container: {
9 | object: '',
10 | selector: 'ul#noty_center_layout_container',
11 | style: function() {
12 | $(this).css({
13 | position: 'fixed',
14 | width: '310px',
15 | height: 'auto',
16 | margin: 0,
17 | padding: 0,
18 | listStyleType: 'none',
19 | zIndex: 10000000
20 | });
21 |
22 | // getting hidden height
23 | var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
24 | $("body").append(dupe);
25 | dupe.find('.i-am-closing-now').remove();
26 | dupe.find('li').css('display', 'block');
27 | var actual_height = dupe.height();
28 | dupe.remove();
29 |
30 | if ($(this).hasClass('i-am-new')) {
31 | $(this).css({
32 | left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
33 | top: ($(window).height() - actual_height) / 2 + 'px'
34 | });
35 | } else {
36 | $(this).animate({
37 | left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
38 | top: ($(window).height() - actual_height) / 2 + 'px'
39 | }, 500);
40 | }
41 |
42 | }
43 | },
44 | parent: {
45 | object: ' ',
46 | selector: 'li',
47 | css: {}
48 | },
49 | css: {
50 | display: 'none',
51 | width: '310px'
52 | },
53 | addClass: ''
54 | };
55 |
56 | })(jQuery);
--------------------------------------------------------------------------------
/public/js/noty/layouts/centerLeft.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.centerLeft = {
4 | name: 'centerLeft',
5 | options: { // overrides options
6 |
7 | },
8 | container: {
9 | object: '',
10 | selector: 'ul#noty_centerLeft_layout_container',
11 | style: function() {
12 | $(this).css({
13 | left: 20,
14 | position: 'fixed',
15 | width: '310px',
16 | height: 'auto',
17 | margin: 0,
18 | padding: 0,
19 | listStyleType: 'none',
20 | zIndex: 10000000
21 | });
22 |
23 | // getting hidden height
24 | var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
25 | $("body").append(dupe);
26 | dupe.find('.i-am-closing-now').remove();
27 | dupe.find('li').css('display', 'block');
28 | var actual_height = dupe.height();
29 | dupe.remove();
30 |
31 | if ($(this).hasClass('i-am-new')) {
32 | $(this).css({
33 | top: ($(window).height() - actual_height) / 2 + 'px'
34 | });
35 | } else {
36 | $(this).animate({
37 | top: ($(window).height() - actual_height) / 2 + 'px'
38 | }, 500);
39 | }
40 |
41 | if (window.innerWidth < 600) {
42 | $(this).css({
43 | left: 5
44 | });
45 | }
46 |
47 | }
48 | },
49 | parent: {
50 | object: ' ',
51 | selector: 'li',
52 | css: {}
53 | },
54 | css: {
55 | display: 'none',
56 | width: '310px'
57 | },
58 | addClass: ''
59 | };
60 |
61 | })(jQuery);
62 |
--------------------------------------------------------------------------------
/public/js/noty/layouts/centerRight.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.centerRight = {
4 | name: 'centerRight',
5 | options: { // overrides options
6 |
7 | },
8 | container: {
9 | object: '',
10 | selector: 'ul#noty_centerRight_layout_container',
11 | style: function() {
12 | $(this).css({
13 | right: 20,
14 | position: 'fixed',
15 | width: '310px',
16 | height: 'auto',
17 | margin: 0,
18 | padding: 0,
19 | listStyleType: 'none',
20 | zIndex: 10000000
21 | });
22 |
23 | // getting hidden height
24 | var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
25 | $("body").append(dupe);
26 | dupe.find('.i-am-closing-now').remove();
27 | dupe.find('li').css('display', 'block');
28 | var actual_height = dupe.height();
29 | dupe.remove();
30 |
31 | if ($(this).hasClass('i-am-new')) {
32 | $(this).css({
33 | top: ($(window).height() - actual_height) / 2 + 'px'
34 | });
35 | } else {
36 | $(this).animate({
37 | top: ($(window).height() - actual_height) / 2 + 'px'
38 | }, 500);
39 | }
40 |
41 | if (window.innerWidth < 600) {
42 | $(this).css({
43 | right: 5
44 | });
45 | }
46 |
47 | }
48 | },
49 | parent: {
50 | object: ' ',
51 | selector: 'li',
52 | css: {}
53 | },
54 | css: {
55 | display: 'none',
56 | width: '310px'
57 | },
58 | addClass: ''
59 | };
60 |
61 | })(jQuery);
62 |
--------------------------------------------------------------------------------
/public/js/noty/layouts/inline.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.inline = {
4 | name: 'inline',
5 | options: {},
6 | container: {
7 | object: '',
8 | selector: 'ul.noty_inline_layout_container',
9 | style: function() {
10 | $(this).css({
11 | width: '100%',
12 | height: 'auto',
13 | margin: 0,
14 | padding: 0,
15 | listStyleType: 'none',
16 | zIndex: 9999999
17 | });
18 | }
19 | },
20 | parent: {
21 | object: ' ',
22 | selector: 'li',
23 | css: {}
24 | },
25 | css: {
26 | display: 'none'
27 | },
28 | addClass: ''
29 | };
30 |
31 | })(jQuery);
--------------------------------------------------------------------------------
/public/js/noty/layouts/top.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.top = {
4 | name: 'top',
5 | options: {},
6 | container: {
7 | object: '',
8 | selector: 'ul#noty_top_layout_container',
9 | style: function() {
10 | $(this).css({
11 | top: 0,
12 | left: '5%',
13 | position: 'fixed',
14 | width: '90%',
15 | height: 'auto',
16 | margin: 0,
17 | padding: 0,
18 | listStyleType: 'none',
19 | zIndex: 9999999
20 | });
21 | }
22 | },
23 | parent: {
24 | object: ' ',
25 | selector: 'li',
26 | css: {}
27 | },
28 | css: {
29 | display: 'none'
30 | },
31 | addClass: ''
32 | };
33 |
34 | })(jQuery);
--------------------------------------------------------------------------------
/public/js/noty/layouts/topCenter.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.topCenter = {
4 | name: 'topCenter',
5 | options: { // overrides options
6 |
7 | },
8 | container: {
9 | object: '',
10 | selector: 'ul#noty_topCenter_layout_container',
11 | style: function() {
12 | $(this).css({
13 | top: 20,
14 | left: 0,
15 | position: 'fixed',
16 | width: '310px',
17 | height: 'auto',
18 | margin: 0,
19 | padding: 0,
20 | listStyleType: 'none',
21 | zIndex: 10000000
22 | });
23 |
24 | $(this).css({
25 | left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
26 | });
27 | }
28 | },
29 | parent: {
30 | object: ' ',
31 | selector: 'li',
32 | css: {}
33 | },
34 | css: {
35 | display: 'none',
36 | width: '310px'
37 | },
38 | addClass: ''
39 | };
40 |
41 | })(jQuery);
42 |
--------------------------------------------------------------------------------
/public/js/noty/layouts/topLeft.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.topLeft = {
4 | name: 'topLeft',
5 | options: { // overrides options
6 |
7 | },
8 | container: {
9 | object: '',
10 | selector: 'ul#noty_topLeft_layout_container',
11 | style: function() {
12 | $(this).css({
13 | top: 20,
14 | left: 20,
15 | position: 'fixed',
16 | width: '310px',
17 | height: 'auto',
18 | margin: 0,
19 | padding: 0,
20 | listStyleType: 'none',
21 | zIndex: 10000000
22 | });
23 |
24 | if (window.innerWidth < 600) {
25 | $(this).css({
26 | left: 5
27 | });
28 | }
29 | }
30 | },
31 | parent: {
32 | object: ' ',
33 | selector: 'li',
34 | css: {}
35 | },
36 | css: {
37 | display: 'none',
38 | width: '310px'
39 | },
40 | addClass: ''
41 | };
42 |
43 | })(jQuery);
--------------------------------------------------------------------------------
/public/js/noty/layouts/topRight.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.layouts.topRight = {
4 | name: 'topRight',
5 | options: { // overrides options
6 |
7 | },
8 | container: {
9 | object: '',
10 | selector: 'ul#noty_topRight_layout_container',
11 | style: function() {
12 | $(this).css({
13 | top: 20,
14 | right: 20,
15 | position: 'fixed',
16 | width: '310px',
17 | height: 'auto',
18 | margin: 0,
19 | padding: 0,
20 | listStyleType: 'none',
21 | zIndex: 10000000
22 | });
23 |
24 | if (window.innerWidth < 600) {
25 | $(this).css({
26 | right: 5
27 | });
28 | }
29 | }
30 | },
31 | parent: {
32 | object: ' ',
33 | selector: 'li',
34 | css: {}
35 | },
36 | css: {
37 | display: 'none',
38 | width: '310px'
39 | },
40 | addClass: ''
41 | };
42 |
43 | })(jQuery);
--------------------------------------------------------------------------------
/public/js/noty/packaged/jquery.noty.packaged.js:
--------------------------------------------------------------------------------
1 | /**
2 | * noty - jQuery Notification Plugin v2.2.2
3 | * Contributors: https://github.com/needim/noty/graphs/contributors
4 | *
5 | * Examples and Documentation - http://needim.github.com/noty/
6 | *
7 | * Licensed under the MIT licenses:
8 | * http://www.opensource.org/licenses/mit-license.php
9 | *
10 | **/
11 |
12 | if (typeof Object.create !== 'function') {
13 | Object.create = function (o) {
14 | function F() {
15 | }
16 |
17 | F.prototype = o;
18 | return new F();
19 | };
20 | }
21 |
22 | (function ($) {
23 |
24 | var NotyObject = {
25 |
26 | init:function (options) {
27 |
28 | // Mix in the passed in options with the default options
29 | this.options = $.extend({}, $.noty.defaults, options);
30 |
31 | this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout];
32 |
33 | if ($.noty.themes[this.options.theme])
34 | this.options.theme = $.noty.themes[this.options.theme];
35 | else
36 | options.themeClassName = this.options.theme;
37 |
38 | delete options.layout;
39 | delete options.theme;
40 |
41 | this.options = $.extend({}, this.options, this.options.layout.options);
42 | this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random() * 1000000));
43 |
44 | this.options = $.extend({}, this.options, options);
45 |
46 | // Build the noty dom initial structure
47 | this._build();
48 |
49 | // return this so we can chain/use the bridge with less code.
50 | return this;
51 | }, // end init
52 |
53 | _build:function () {
54 |
55 | // Generating noty bar
56 | var $bar = $('
').attr('id', this.options.id);
57 | $bar.append(this.options.template).find('.noty_text').html(this.options.text);
58 |
59 | this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar;
60 |
61 | if (this.options.themeClassName)
62 | this.$bar.addClass(this.options.themeClassName).addClass('noty_container_type_' + this.options.type);
63 |
64 | // Set buttons if available
65 | if (this.options.buttons) {
66 |
67 | // If we have button disable closeWith & timeout options
68 | this.options.closeWith = [];
69 | this.options.timeout = false;
70 |
71 | var $buttons = $('
').addClass('noty_buttons');
72 |
73 | (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons);
74 |
75 | var self = this;
76 |
77 | $.each(this.options.buttons, function (i, button) {
78 | var $button = $(' ').addClass((button.addClass) ? button.addClass : 'gray').html(button.text).attr('id', button.id ? button.id : 'button-' + i)
79 | .appendTo(self.$bar.find('.noty_buttons'))
80 | .bind('click', function () {
81 | if ($.isFunction(button.onClick)) {
82 | button.onClick.call($button, self);
83 | }
84 | });
85 | });
86 | }
87 |
88 | // For easy access
89 | this.$message = this.$bar.find('.noty_message');
90 | this.$closeButton = this.$bar.find('.noty_close');
91 | this.$buttons = this.$bar.find('.noty_buttons');
92 |
93 | $.noty.store[this.options.id] = this; // store noty for api
94 |
95 | }, // end _build
96 |
97 | show:function () {
98 |
99 | var self = this;
100 |
101 | (self.options.custom) ? self.options.custom.find(self.options.layout.container.selector).append(self.$bar) : $(self.options.layout.container.selector).append(self.$bar);
102 |
103 | if (self.options.theme && self.options.theme.style)
104 | self.options.theme.style.apply(self);
105 |
106 | ($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {});
107 |
108 | self.$bar.addClass(self.options.layout.addClass);
109 |
110 | self.options.layout.container.style.apply($(self.options.layout.container.selector));
111 |
112 | self.showing = true;
113 |
114 | if (self.options.theme && self.options.theme.style)
115 | self.options.theme.callback.onShow.apply(this);
116 |
117 | if ($.inArray('click', self.options.closeWith) > -1)
118 | self.$bar.css('cursor', 'pointer').one('click', function (evt) {
119 | self.stopPropagation(evt);
120 | if (self.options.callback.onCloseClick) {
121 | self.options.callback.onCloseClick.apply(self);
122 | }
123 | self.close();
124 | });
125 |
126 | if ($.inArray('hover', self.options.closeWith) > -1)
127 | self.$bar.one('mouseenter', function () {
128 | self.close();
129 | });
130 |
131 | if ($.inArray('button', self.options.closeWith) > -1)
132 | self.$closeButton.one('click', function (evt) {
133 | self.stopPropagation(evt);
134 | self.close();
135 | });
136 |
137 | if ($.inArray('button', self.options.closeWith) == -1)
138 | self.$closeButton.remove();
139 |
140 | if (self.options.callback.onShow)
141 | self.options.callback.onShow.apply(self);
142 |
143 | self.$bar.animate(
144 | self.options.animation.open,
145 | self.options.animation.speed,
146 | self.options.animation.easing,
147 | function () {
148 | if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
149 | self.showing = false;
150 | self.shown = true;
151 | });
152 |
153 | // If noty is have a timeout option
154 | if (self.options.timeout)
155 | self.$bar.delay(self.options.timeout).promise().done(function () {
156 | self.close();
157 | });
158 |
159 | return this;
160 |
161 | }, // end show
162 |
163 | close:function () {
164 |
165 | if (this.closed) return;
166 | if (this.$bar && this.$bar.hasClass('i-am-closing-now')) return;
167 |
168 | var self = this;
169 |
170 | if (this.showing) {
171 | self.$bar.queue(
172 | function () {
173 | self.close.apply(self);
174 | }
175 | )
176 | return;
177 | }
178 |
179 | if (!this.shown && !this.showing) { // If we are still waiting in the queue just delete from queue
180 | var queue = [];
181 | $.each($.noty.queue, function (i, n) {
182 | if (n.options.id != self.options.id) {
183 | queue.push(n);
184 | }
185 | });
186 | $.noty.queue = queue;
187 | return;
188 | }
189 |
190 | self.$bar.addClass('i-am-closing-now');
191 |
192 | if (self.options.callback.onClose) {
193 | self.options.callback.onClose.apply(self);
194 | }
195 |
196 | self.$bar.clearQueue().stop().animate(
197 | self.options.animation.close,
198 | self.options.animation.speed,
199 | self.options.animation.easing,
200 | function () {
201 | if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self);
202 | })
203 | .promise().done(function () {
204 |
205 | // Modal Cleaning
206 | if (self.options.modal) {
207 | $.notyRenderer.setModalCount(-1);
208 | if ($.notyRenderer.getModalCount() == 0) $('.noty_modal').fadeOut('fast', function () {
209 | $(this).remove();
210 | });
211 | }
212 |
213 | // Layout Cleaning
214 | $.notyRenderer.setLayoutCountFor(self, -1);
215 | if ($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove();
216 |
217 | // Make sure self.$bar has not been removed before attempting to remove it
218 | if (typeof self.$bar !== 'undefined' && self.$bar !== null ) {
219 | self.$bar.remove();
220 | self.$bar = null;
221 | self.closed = true;
222 | }
223 |
224 | delete $.noty.store[self.options.id]; // deleting noty from store
225 |
226 | if(self.options.theme.callback && self.options.theme.callback.onClose) {
227 | self.options.theme.callback.onClose.apply(self);
228 | }
229 |
230 | if (!self.options.dismissQueue) {
231 | // Queue render
232 | $.noty.ontap = true;
233 |
234 | $.notyRenderer.render();
235 | }
236 |
237 | if (self.options.maxVisible > 0 && self.options.dismissQueue) {
238 | $.notyRenderer.render();
239 | }
240 | })
241 |
242 | }, // end close
243 |
244 | setText:function (text) {
245 | if (!this.closed) {
246 | this.options.text = text;
247 | this.$bar.find('.noty_text').html(text);
248 | }
249 | return this;
250 | },
251 |
252 | setType:function (type) {
253 | if (!this.closed) {
254 | this.options.type = type;
255 | this.options.theme.style.apply(this);
256 | this.options.theme.callback.onShow.apply(this);
257 | }
258 | return this;
259 | },
260 |
261 | setTimeout:function (time) {
262 | if (!this.closed) {
263 | var self = this;
264 | this.options.timeout = time;
265 | self.$bar.delay(self.options.timeout).promise().done(function () {
266 | self.close();
267 | });
268 | }
269 | return this;
270 | },
271 |
272 | stopPropagation:function (evt) {
273 | evt = evt || window.event;
274 | if (typeof evt.stopPropagation !== "undefined") {
275 | evt.stopPropagation();
276 | } else {
277 | evt.cancelBubble = true;
278 | }
279 | },
280 |
281 | closed:false,
282 | showing:false,
283 | shown:false
284 |
285 | }; // end NotyObject
286 |
287 | $.notyRenderer = {};
288 |
289 | $.notyRenderer.init = function (options) {
290 |
291 | // Renderer creates a new noty
292 | var notification = Object.create(NotyObject).init(options);
293 |
294 | if (notification.options.killer)
295 | $.noty.closeAll();
296 |
297 | (notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification);
298 |
299 | $.notyRenderer.render();
300 |
301 | return ($.noty.returns == 'object') ? notification : notification.options.id;
302 | };
303 |
304 | $.notyRenderer.render = function () {
305 |
306 | var instance = $.noty.queue[0];
307 |
308 | if ($.type(instance) === 'object') {
309 | if (instance.options.dismissQueue) {
310 | if (instance.options.maxVisible > 0) {
311 | if ($(instance.options.layout.container.selector + ' li').length < instance.options.maxVisible) {
312 | $.notyRenderer.show($.noty.queue.shift());
313 | } else {
314 |
315 | }
316 | } else {
317 | $.notyRenderer.show($.noty.queue.shift());
318 | }
319 | } else {
320 | if ($.noty.ontap) {
321 | $.notyRenderer.show($.noty.queue.shift());
322 | $.noty.ontap = false;
323 | }
324 | }
325 | } else {
326 | $.noty.ontap = true; // Queue is over
327 | }
328 |
329 | };
330 |
331 | $.notyRenderer.show = function (notification) {
332 |
333 | if (notification.options.modal) {
334 | $.notyRenderer.createModalFor(notification);
335 | $.notyRenderer.setModalCount(+1);
336 | }
337 |
338 | // Where is the container?
339 | if (notification.options.custom) {
340 | if (notification.options.custom.find(notification.options.layout.container.selector).length == 0) {
341 | notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new'));
342 | } else {
343 | notification.options.custom.find(notification.options.layout.container.selector).removeClass('i-am-new');
344 | }
345 | } else {
346 | if ($(notification.options.layout.container.selector).length == 0) {
347 | $('body').append($(notification.options.layout.container.object).addClass('i-am-new'));
348 | } else {
349 | $(notification.options.layout.container.selector).removeClass('i-am-new');
350 | }
351 | }
352 |
353 | $.notyRenderer.setLayoutCountFor(notification, +1);
354 |
355 | notification.show();
356 | };
357 |
358 | $.notyRenderer.createModalFor = function (notification) {
359 | if ($('.noty_modal').length == 0) {
360 | var modal = $('
').addClass('noty_modal').addClass(notification.options.theme).data('noty_modal_count', 0);
361 |
362 | if (notification.options.theme.modal && notification.options.theme.modal.css)
363 | modal.css(notification.options.theme.modal.css);
364 |
365 | modal.prependTo($('body')).fadeIn('fast');
366 | }
367 | };
368 |
369 | $.notyRenderer.getLayoutCountFor = function (notification) {
370 | return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
371 | };
372 |
373 | $.notyRenderer.setLayoutCountFor = function (notification, arg) {
374 | return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg);
375 | };
376 |
377 | $.notyRenderer.getModalCount = function () {
378 | return $('.noty_modal').data('noty_modal_count') || 0;
379 | };
380 |
381 | $.notyRenderer.setModalCount = function (arg) {
382 | return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg);
383 | };
384 |
385 | // This is for custom container
386 | $.fn.noty = function (options) {
387 | options.custom = $(this);
388 | return $.notyRenderer.init(options);
389 | };
390 |
391 | $.noty = {};
392 | $.noty.queue = [];
393 | $.noty.ontap = true;
394 | $.noty.layouts = {};
395 | $.noty.themes = {};
396 | $.noty.returns = 'object';
397 | $.noty.store = {};
398 |
399 | $.noty.get = function (id) {
400 | return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
401 | };
402 |
403 | $.noty.close = function (id) {
404 | return $.noty.get(id) ? $.noty.get(id).close() : false;
405 | };
406 |
407 | $.noty.setText = function (id, text) {
408 | return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
409 | };
410 |
411 | $.noty.setType = function (id, type) {
412 | return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
413 | };
414 |
415 | $.noty.clearQueue = function () {
416 | $.noty.queue = [];
417 | };
418 |
419 | $.noty.closeAll = function () {
420 | $.noty.clearQueue();
421 | $.each($.noty.store, function (id, noty) {
422 | noty.close();
423 | });
424 | };
425 |
426 | var windowAlert = window.alert;
427 |
428 | $.noty.consumeAlert = function (options) {
429 | window.alert = function (text) {
430 | if (options)
431 | options.text = text;
432 | else
433 | options = {text:text};
434 |
435 | $.notyRenderer.init(options);
436 | };
437 | };
438 |
439 | $.noty.stopConsumeAlert = function () {
440 | window.alert = windowAlert;
441 | };
442 |
443 | $.noty.defaults = {
444 | layout:'top',
445 | theme:'defaultTheme',
446 | type:'alert',
447 | text:'',
448 | dismissQueue:true,
449 | template:'',
450 | animation:{
451 | open:{height:'toggle'},
452 | close:{height:'toggle'},
453 | easing:'swing',
454 | speed:500
455 | },
456 | timeout:false,
457 | force:false,
458 | modal:false,
459 | maxVisible:5,
460 | killer: false,
461 | closeWith:['click'],
462 | callback:{
463 | onShow:function () {
464 | },
465 | afterShow:function () {
466 | },
467 | onClose:function () {
468 | },
469 | afterClose:function () {
470 | },
471 | onCloseClick:function () {
472 | }
473 | },
474 | buttons:false
475 | };
476 |
477 | $(window).resize(function () {
478 | $.each($.noty.layouts, function (index, layout) {
479 | layout.container.style.apply($(layout.container.selector));
480 | });
481 | });
482 |
483 | })(jQuery);
484 |
485 | // Helpers
486 | window.noty = function noty(options) {
487 | return jQuery.notyRenderer.init(options);
488 | };
489 |
490 | (function($) {
491 |
492 | $.noty.layouts.bottom = {
493 | name: 'bottom',
494 | options: {},
495 | container: {
496 | object: '',
497 | selector: 'ul#noty_bottom_layout_container',
498 | style: function() {
499 | $(this).css({
500 | bottom: 0,
501 | left: '5%',
502 | position: 'fixed',
503 | width: '90%',
504 | height: 'auto',
505 | margin: 0,
506 | padding: 0,
507 | listStyleType: 'none',
508 | zIndex: 9999999
509 | });
510 | }
511 | },
512 | parent: {
513 | object: ' ',
514 | selector: 'li',
515 | css: {}
516 | },
517 | css: {
518 | display: 'none'
519 | },
520 | addClass: ''
521 | };
522 |
523 | })(jQuery);
524 | (function($) {
525 |
526 | $.noty.layouts.bottomCenter = {
527 | name: 'bottomCenter',
528 | options: { // overrides options
529 |
530 | },
531 | container: {
532 | object: '',
533 | selector: 'ul#noty_bottomCenter_layout_container',
534 | style: function() {
535 | $(this).css({
536 | bottom: 20,
537 | left: 0,
538 | position: 'fixed',
539 | width: '310px',
540 | height: 'auto',
541 | margin: 0,
542 | padding: 0,
543 | listStyleType: 'none',
544 | zIndex: 10000000
545 | });
546 |
547 | $(this).css({
548 | left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
549 | });
550 | }
551 | },
552 | parent: {
553 | object: ' ',
554 | selector: 'li',
555 | css: {}
556 | },
557 | css: {
558 | display: 'none',
559 | width: '310px'
560 | },
561 | addClass: ''
562 | };
563 |
564 | })(jQuery);
565 |
566 | (function($) {
567 |
568 | $.noty.layouts.bottomLeft = {
569 | name: 'bottomLeft',
570 | options: { // overrides options
571 |
572 | },
573 | container: {
574 | object: '',
575 | selector: 'ul#noty_bottomLeft_layout_container',
576 | style: function() {
577 | $(this).css({
578 | bottom: 20,
579 | left: 20,
580 | position: 'fixed',
581 | width: '310px',
582 | height: 'auto',
583 | margin: 0,
584 | padding: 0,
585 | listStyleType: 'none',
586 | zIndex: 10000000
587 | });
588 |
589 | if (window.innerWidth < 600) {
590 | $(this).css({
591 | left: 5
592 | });
593 | }
594 | }
595 | },
596 | parent: {
597 | object: ' ',
598 | selector: 'li',
599 | css: {}
600 | },
601 | css: {
602 | display: 'none',
603 | width: '310px'
604 | },
605 | addClass: ''
606 | };
607 |
608 | })(jQuery);
609 | (function($) {
610 |
611 | $.noty.layouts.bottomRight = {
612 | name: 'bottomRight',
613 | options: { // overrides options
614 |
615 | },
616 | container: {
617 | object: '',
618 | selector: 'ul#noty_bottomRight_layout_container',
619 | style: function() {
620 | $(this).css({
621 | bottom: 20,
622 | right: 20,
623 | position: 'fixed',
624 | width: '310px',
625 | height: 'auto',
626 | margin: 0,
627 | padding: 0,
628 | listStyleType: 'none',
629 | zIndex: 10000000
630 | });
631 |
632 | if (window.innerWidth < 600) {
633 | $(this).css({
634 | right: 5
635 | });
636 | }
637 | }
638 | },
639 | parent: {
640 | object: ' ',
641 | selector: 'li',
642 | css: {}
643 | },
644 | css: {
645 | display: 'none',
646 | width: '310px'
647 | },
648 | addClass: ''
649 | };
650 |
651 | })(jQuery);
652 | (function($) {
653 |
654 | $.noty.layouts.center = {
655 | name: 'center',
656 | options: { // overrides options
657 |
658 | },
659 | container: {
660 | object: '',
661 | selector: 'ul#noty_center_layout_container',
662 | style: function() {
663 | $(this).css({
664 | position: 'fixed',
665 | width: '310px',
666 | height: 'auto',
667 | margin: 0,
668 | padding: 0,
669 | listStyleType: 'none',
670 | zIndex: 10000000
671 | });
672 |
673 | // getting hidden height
674 | var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
675 | $("body").append(dupe);
676 | dupe.find('.i-am-closing-now').remove();
677 | dupe.find('li').css('display', 'block');
678 | var actual_height = dupe.height();
679 | dupe.remove();
680 |
681 | if ($(this).hasClass('i-am-new')) {
682 | $(this).css({
683 | left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
684 | top: ($(window).height() - actual_height) / 2 + 'px'
685 | });
686 | } else {
687 | $(this).animate({
688 | left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
689 | top: ($(window).height() - actual_height) / 2 + 'px'
690 | }, 500);
691 | }
692 |
693 | }
694 | },
695 | parent: {
696 | object: ' ',
697 | selector: 'li',
698 | css: {}
699 | },
700 | css: {
701 | display: 'none',
702 | width: '310px'
703 | },
704 | addClass: ''
705 | };
706 |
707 | })(jQuery);
708 | (function($) {
709 |
710 | $.noty.layouts.centerLeft = {
711 | name: 'centerLeft',
712 | options: { // overrides options
713 |
714 | },
715 | container: {
716 | object: '',
717 | selector: 'ul#noty_centerLeft_layout_container',
718 | style: function() {
719 | $(this).css({
720 | left: 20,
721 | position: 'fixed',
722 | width: '310px',
723 | height: 'auto',
724 | margin: 0,
725 | padding: 0,
726 | listStyleType: 'none',
727 | zIndex: 10000000
728 | });
729 |
730 | // getting hidden height
731 | var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
732 | $("body").append(dupe);
733 | dupe.find('.i-am-closing-now').remove();
734 | dupe.find('li').css('display', 'block');
735 | var actual_height = dupe.height();
736 | dupe.remove();
737 |
738 | if ($(this).hasClass('i-am-new')) {
739 | $(this).css({
740 | top: ($(window).height() - actual_height) / 2 + 'px'
741 | });
742 | } else {
743 | $(this).animate({
744 | top: ($(window).height() - actual_height) / 2 + 'px'
745 | }, 500);
746 | }
747 |
748 | if (window.innerWidth < 600) {
749 | $(this).css({
750 | left: 5
751 | });
752 | }
753 |
754 | }
755 | },
756 | parent: {
757 | object: ' ',
758 | selector: 'li',
759 | css: {}
760 | },
761 | css: {
762 | display: 'none',
763 | width: '310px'
764 | },
765 | addClass: ''
766 | };
767 |
768 | })(jQuery);
769 |
770 | (function($) {
771 |
772 | $.noty.layouts.centerRight = {
773 | name: 'centerRight',
774 | options: { // overrides options
775 |
776 | },
777 | container: {
778 | object: '',
779 | selector: 'ul#noty_centerRight_layout_container',
780 | style: function() {
781 | $(this).css({
782 | right: 20,
783 | position: 'fixed',
784 | width: '310px',
785 | height: 'auto',
786 | margin: 0,
787 | padding: 0,
788 | listStyleType: 'none',
789 | zIndex: 10000000
790 | });
791 |
792 | // getting hidden height
793 | var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
794 | $("body").append(dupe);
795 | dupe.find('.i-am-closing-now').remove();
796 | dupe.find('li').css('display', 'block');
797 | var actual_height = dupe.height();
798 | dupe.remove();
799 |
800 | if ($(this).hasClass('i-am-new')) {
801 | $(this).css({
802 | top: ($(window).height() - actual_height) / 2 + 'px'
803 | });
804 | } else {
805 | $(this).animate({
806 | top: ($(window).height() - actual_height) / 2 + 'px'
807 | }, 500);
808 | }
809 |
810 | if (window.innerWidth < 600) {
811 | $(this).css({
812 | right: 5
813 | });
814 | }
815 |
816 | }
817 | },
818 | parent: {
819 | object: ' ',
820 | selector: 'li',
821 | css: {}
822 | },
823 | css: {
824 | display: 'none',
825 | width: '310px'
826 | },
827 | addClass: ''
828 | };
829 |
830 | })(jQuery);
831 |
832 | (function($) {
833 |
834 | $.noty.layouts.inline = {
835 | name: 'inline',
836 | options: {},
837 | container: {
838 | object: '',
839 | selector: 'ul.noty_inline_layout_container',
840 | style: function() {
841 | $(this).css({
842 | width: '100%',
843 | height: 'auto',
844 | margin: 0,
845 | padding: 0,
846 | listStyleType: 'none',
847 | zIndex: 9999999
848 | });
849 | }
850 | },
851 | parent: {
852 | object: ' ',
853 | selector: 'li',
854 | css: {}
855 | },
856 | css: {
857 | display: 'none'
858 | },
859 | addClass: ''
860 | };
861 |
862 | })(jQuery);
863 | (function($) {
864 |
865 | $.noty.layouts.top = {
866 | name: 'top',
867 | options: {},
868 | container: {
869 | object: '',
870 | selector: 'ul#noty_top_layout_container',
871 | style: function() {
872 | $(this).css({
873 | top: 0,
874 | left: '5%',
875 | position: 'fixed',
876 | width: '90%',
877 | height: 'auto',
878 | margin: 0,
879 | padding: 0,
880 | listStyleType: 'none',
881 | zIndex: 9999999
882 | });
883 | }
884 | },
885 | parent: {
886 | object: ' ',
887 | selector: 'li',
888 | css: {}
889 | },
890 | css: {
891 | display: 'none'
892 | },
893 | addClass: ''
894 | };
895 |
896 | })(jQuery);
897 | (function($) {
898 |
899 | $.noty.layouts.topCenter = {
900 | name: 'topCenter',
901 | options: { // overrides options
902 |
903 | },
904 | container: {
905 | object: '',
906 | selector: 'ul#noty_topCenter_layout_container',
907 | style: function() {
908 | $(this).css({
909 | top: 20,
910 | left: 0,
911 | position: 'fixed',
912 | width: '310px',
913 | height: 'auto',
914 | margin: 0,
915 | padding: 0,
916 | listStyleType: 'none',
917 | zIndex: 10000000
918 | });
919 |
920 | $(this).css({
921 | left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
922 | });
923 | }
924 | },
925 | parent: {
926 | object: ' ',
927 | selector: 'li',
928 | css: {}
929 | },
930 | css: {
931 | display: 'none',
932 | width: '310px'
933 | },
934 | addClass: ''
935 | };
936 |
937 | })(jQuery);
938 |
939 | (function($) {
940 |
941 | $.noty.layouts.topLeft = {
942 | name: 'topLeft',
943 | options: { // overrides options
944 |
945 | },
946 | container: {
947 | object: '',
948 | selector: 'ul#noty_topLeft_layout_container',
949 | style: function() {
950 | $(this).css({
951 | top: 20,
952 | left: 20,
953 | position: 'fixed',
954 | width: '310px',
955 | height: 'auto',
956 | margin: 0,
957 | padding: 0,
958 | listStyleType: 'none',
959 | zIndex: 10000000
960 | });
961 |
962 | if (window.innerWidth < 600) {
963 | $(this).css({
964 | left: 5
965 | });
966 | }
967 | }
968 | },
969 | parent: {
970 | object: ' ',
971 | selector: 'li',
972 | css: {}
973 | },
974 | css: {
975 | display: 'none',
976 | width: '310px'
977 | },
978 | addClass: ''
979 | };
980 |
981 | })(jQuery);
982 | (function($) {
983 |
984 | $.noty.layouts.topRight = {
985 | name: 'topRight',
986 | options: { // overrides options
987 |
988 | },
989 | container: {
990 | object: '',
991 | selector: 'ul#noty_topRight_layout_container',
992 | style: function() {
993 | $(this).css({
994 | top: 20,
995 | right: 20,
996 | position: 'fixed',
997 | width: '310px',
998 | height: 'auto',
999 | margin: 0,
1000 | padding: 0,
1001 | listStyleType: 'none',
1002 | zIndex: 10000000
1003 | });
1004 |
1005 | if (window.innerWidth < 600) {
1006 | $(this).css({
1007 | right: 5
1008 | });
1009 | }
1010 | }
1011 | },
1012 | parent: {
1013 | object: ' ',
1014 | selector: 'li',
1015 | css: {}
1016 | },
1017 | css: {
1018 | display: 'none',
1019 | width: '310px'
1020 | },
1021 | addClass: ''
1022 | };
1023 |
1024 | })(jQuery);
1025 | (function($) {
1026 |
1027 | $.noty.themes.defaultTheme = {
1028 | name: 'defaultTheme',
1029 | helpers: {
1030 | borderFix: function() {
1031 | if (this.options.dismissQueue) {
1032 | var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector;
1033 | switch (this.options.layout.name) {
1034 | case 'top':
1035 | $(selector).css({borderRadius: '0px 0px 0px 0px'});
1036 | $(selector).last().css({borderRadius: '0px 0px 5px 5px'}); break;
1037 | case 'topCenter': case 'topLeft': case 'topRight':
1038 | case 'bottomCenter': case 'bottomLeft': case 'bottomRight':
1039 | case 'center': case 'centerLeft': case 'centerRight': case 'inline':
1040 | $(selector).css({borderRadius: '0px 0px 0px 0px'});
1041 | $(selector).first().css({'border-top-left-radius': '5px', 'border-top-right-radius': '5px'});
1042 | $(selector).last().css({'border-bottom-left-radius': '5px', 'border-bottom-right-radius': '5px'}); break;
1043 | case 'bottom':
1044 | $(selector).css({borderRadius: '0px 0px 0px 0px'});
1045 | $(selector).first().css({borderRadius: '5px 5px 0px 0px'}); break;
1046 | default: break;
1047 | }
1048 | }
1049 | }
1050 | },
1051 | modal: {
1052 | css: {
1053 | position: 'fixed',
1054 | width: '100%',
1055 | height: '100%',
1056 | backgroundColor: '#000',
1057 | zIndex: 10000,
1058 | opacity: 0.6,
1059 | display: 'none',
1060 | left: 0,
1061 | top: 0
1062 | }
1063 | },
1064 | style: function() {
1065 |
1066 | this.$bar.css({
1067 | overflow: 'hidden',
1068 | background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"
1069 | });
1070 |
1071 | this.$message.css({
1072 | fontSize: '13px',
1073 | lineHeight: '16px',
1074 | textAlign: 'center',
1075 | padding: '8px 10px 9px',
1076 | width: 'auto',
1077 | position: 'relative'
1078 | });
1079 |
1080 | this.$closeButton.css({
1081 | position: 'absolute',
1082 | top: 4, right: 4,
1083 | width: 10, height: 10,
1084 | background: "url(data:image/png;base64,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)",
1085 | display: 'none',
1086 | cursor: 'pointer'
1087 | });
1088 |
1089 | this.$buttons.css({
1090 | padding: 5,
1091 | textAlign: 'right',
1092 | borderTop: '1px solid #ccc',
1093 | backgroundColor: '#fff'
1094 | });
1095 |
1096 | this.$buttons.find('button').css({
1097 | marginLeft: 5
1098 | });
1099 |
1100 | this.$buttons.find('button:first').css({
1101 | marginLeft: 0
1102 | });
1103 |
1104 | this.$bar.bind({
1105 | mouseenter: function() { $(this).find('.noty_close').stop().fadeTo('normal',1); },
1106 | mouseleave: function() { $(this).find('.noty_close').stop().fadeTo('normal',0); }
1107 | });
1108 |
1109 | switch (this.options.layout.name) {
1110 | case 'top':
1111 | this.$bar.css({
1112 | borderRadius: '0px 0px 5px 5px',
1113 | borderBottom: '2px solid #eee',
1114 | borderLeft: '2px solid #eee',
1115 | borderRight: '2px solid #eee',
1116 | boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1117 | });
1118 | break;
1119 | case 'topCenter': case 'center': case 'bottomCenter': case 'inline':
1120 | this.$bar.css({
1121 | borderRadius: '5px',
1122 | border: '1px solid #eee',
1123 | boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1124 | });
1125 | this.$message.css({fontSize: '13px', textAlign: 'center'});
1126 | break;
1127 | case 'topLeft': case 'topRight':
1128 | case 'bottomLeft': case 'bottomRight':
1129 | case 'centerLeft': case 'centerRight':
1130 | this.$bar.css({
1131 | borderRadius: '5px',
1132 | border: '1px solid #eee',
1133 | boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1134 | });
1135 | this.$message.css({fontSize: '13px', textAlign: 'left'});
1136 | break;
1137 | case 'bottom':
1138 | this.$bar.css({
1139 | borderRadius: '5px 5px 0px 0px',
1140 | borderTop: '2px solid #eee',
1141 | borderLeft: '2px solid #eee',
1142 | borderRight: '2px solid #eee',
1143 | boxShadow: "0 -2px 4px rgba(0, 0, 0, 0.1)"
1144 | });
1145 | break;
1146 | default:
1147 | this.$bar.css({
1148 | border: '2px solid #eee',
1149 | boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1150 | });
1151 | break;
1152 | }
1153 |
1154 | switch (this.options.type) {
1155 | case 'alert': case 'notification':
1156 | this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
1157 | case 'warning':
1158 | this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'});
1159 | this.$buttons.css({borderTop: '1px solid #FFC237'}); break;
1160 | case 'error':
1161 | this.$bar.css({backgroundColor: 'red', borderColor: 'darkred', color: '#FFF'});
1162 | this.$message.css({fontWeight: 'bold'});
1163 | this.$buttons.css({borderTop: '1px solid darkred'}); break;
1164 | case 'information':
1165 | this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF'});
1166 | this.$buttons.css({borderTop: '1px solid #0B90C4'}); break;
1167 | case 'success':
1168 | this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen'});
1169 | this.$buttons.css({borderTop: '1px solid #50C24E'});break;
1170 | default:
1171 | this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
1172 | }
1173 | },
1174 | callback: {
1175 | onShow: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); },
1176 | onClose: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); }
1177 | }
1178 | };
1179 |
1180 | })(jQuery);
1181 |
--------------------------------------------------------------------------------
/public/js/noty/packaged/jquery.noty.packaged.min.js:
--------------------------------------------------------------------------------
1 | "function"!=typeof Object.create&&(Object.create=function(a){function b(){}return b.prototype=a,new b}),function(a){var b={init:function(b){return this.options=a.extend({},a.noty.defaults,b),this.options.layout=this.options.custom?a.noty.layouts.inline:a.noty.layouts[this.options.layout],a.noty.themes[this.options.theme]?this.options.theme=a.noty.themes[this.options.theme]:b.themeClassName=this.options.theme,delete b.layout,delete b.theme,this.options=a.extend({},this.options,this.options.layout.options),this.options.id="noty_"+(new Date).getTime()*Math.floor(1e6*Math.random()),this.options=a.extend({},this.options,b),this._build(),this},_build:function(){var b=a('
').attr("id",this.options.id);if(b.append(this.options.template).find(".noty_text").html(this.options.text),this.$bar=null!==this.options.layout.parent.object?a(this.options.layout.parent.object).css(this.options.layout.parent.css).append(b):b,this.options.themeClassName&&this.$bar.addClass(this.options.themeClassName).addClass("noty_container_type_"+this.options.type),this.options.buttons){this.options.closeWith=[],this.options.timeout=!1;var c=a("
").addClass("noty_buttons");null!==this.options.layout.parent.object?this.$bar.find(".noty_bar").append(c):this.$bar.append(c);var d=this;a.each(this.options.buttons,function(b,c){var e=a(" ").addClass(c.addClass?c.addClass:"gray").html(c.text).attr("id",c.id?c.id:"button-"+b).appendTo(d.$bar.find(".noty_buttons")).bind("click",function(){a.isFunction(c.onClick)&&c.onClick.call(e,d)})})}this.$message=this.$bar.find(".noty_message"),this.$closeButton=this.$bar.find(".noty_close"),this.$buttons=this.$bar.find(".noty_buttons"),a.noty.store[this.options.id]=this},show:function(){var b=this;return b.options.custom?b.options.custom.find(b.options.layout.container.selector).append(b.$bar):a(b.options.layout.container.selector).append(b.$bar),b.options.theme&&b.options.theme.style&&b.options.theme.style.apply(b),"function"===a.type(b.options.layout.css)?this.options.layout.css.apply(b.$bar):b.$bar.css(this.options.layout.css||{}),b.$bar.addClass(b.options.layout.addClass),b.options.layout.container.style.apply(a(b.options.layout.container.selector)),b.showing=!0,b.options.theme&&b.options.theme.style&&b.options.theme.callback.onShow.apply(this),a.inArray("click",b.options.closeWith)>-1&&b.$bar.css("cursor","pointer").one("click",function(a){b.stopPropagation(a),b.options.callback.onCloseClick&&b.options.callback.onCloseClick.apply(b),b.close()}),a.inArray("hover",b.options.closeWith)>-1&&b.$bar.one("mouseenter",function(){b.close()}),a.inArray("button",b.options.closeWith)>-1&&b.$closeButton.one("click",function(a){b.stopPropagation(a),b.close()}),-1==a.inArray("button",b.options.closeWith)&&b.$closeButton.remove(),b.options.callback.onShow&&b.options.callback.onShow.apply(b),b.$bar.animate(b.options.animation.open,b.options.animation.speed,b.options.animation.easing,function(){b.options.callback.afterShow&&b.options.callback.afterShow.apply(b),b.showing=!1,b.shown=!0}),b.options.timeout&&b.$bar.delay(b.options.timeout).promise().done(function(){b.close()}),this},close:function(){if(!(this.closed||this.$bar&&this.$bar.hasClass("i-am-closing-now"))){var b=this;if(this.showing)return b.$bar.queue(function(){b.close.apply(b)}),void 0;if(!this.shown&&!this.showing){var c=[];return a.each(a.noty.queue,function(a,d){d.options.id!=b.options.id&&c.push(d)}),a.noty.queue=c,void 0}b.$bar.addClass("i-am-closing-now"),b.options.callback.onClose&&b.options.callback.onClose.apply(b),b.$bar.clearQueue().stop().animate(b.options.animation.close,b.options.animation.speed,b.options.animation.easing,function(){b.options.callback.afterClose&&b.options.callback.afterClose.apply(b)}).promise().done(function(){b.options.modal&&(a.notyRenderer.setModalCount(-1),0==a.notyRenderer.getModalCount()&&a(".noty_modal").fadeOut("fast",function(){a(this).remove()})),a.notyRenderer.setLayoutCountFor(b,-1),0==a.notyRenderer.getLayoutCountFor(b)&&a(b.options.layout.container.selector).remove(),"undefined"!=typeof b.$bar&&null!==b.$bar&&(b.$bar.remove(),b.$bar=null,b.closed=!0),delete a.noty.store[b.options.id],b.options.theme.callback&&b.options.theme.callback.onClose&&b.options.theme.callback.onClose.apply(b),b.options.dismissQueue||(a.noty.ontap=!0,a.notyRenderer.render()),b.options.maxVisible>0&&b.options.dismissQueue&&a.notyRenderer.render()})}},setText:function(a){return this.closed||(this.options.text=a,this.$bar.find(".noty_text").html(a)),this},setType:function(a){return this.closed||(this.options.type=a,this.options.theme.style.apply(this),this.options.theme.callback.onShow.apply(this)),this},setTimeout:function(a){if(!this.closed){var b=this;this.options.timeout=a,b.$bar.delay(b.options.timeout).promise().done(function(){b.close()})}return this},stopPropagation:function(a){a=a||window.event,"undefined"!=typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},closed:!1,showing:!1,shown:!1};a.notyRenderer={},a.notyRenderer.init=function(c){var d=Object.create(b).init(c);return d.options.killer&&a.noty.closeAll(),d.options.force?a.noty.queue.unshift(d):a.noty.queue.push(d),a.notyRenderer.render(),"object"==a.noty.returns?d:d.options.id},a.notyRenderer.render=function(){var b=a.noty.queue[0];"object"===a.type(b)?b.options.dismissQueue?b.options.maxVisible>0?a(b.options.layout.container.selector+" li").length").addClass("noty_modal").addClass(b.options.theme).data("noty_modal_count",0);b.options.theme.modal&&b.options.theme.modal.css&&c.css(b.options.theme.modal.css),c.prependTo(a("body")).fadeIn("fast")}},a.notyRenderer.getLayoutCountFor=function(b){return a(b.options.layout.container.selector).data("noty_layout_count")||0},a.notyRenderer.setLayoutCountFor=function(b,c){return a(b.options.layout.container.selector).data("noty_layout_count",a.notyRenderer.getLayoutCountFor(b)+c)},a.notyRenderer.getModalCount=function(){return a(".noty_modal").data("noty_modal_count")||0},a.notyRenderer.setModalCount=function(b){return a(".noty_modal").data("noty_modal_count",a.notyRenderer.getModalCount()+b)},a.fn.noty=function(b){return b.custom=a(this),a.notyRenderer.init(b)},a.noty={},a.noty.queue=[],a.noty.ontap=!0,a.noty.layouts={},a.noty.themes={},a.noty.returns="object",a.noty.store={},a.noty.get=function(b){return a.noty.store.hasOwnProperty(b)?a.noty.store[b]:!1},a.noty.close=function(b){return a.noty.get(b)?a.noty.get(b).close():!1},a.noty.setText=function(b,c){return a.noty.get(b)?a.noty.get(b).setText(c):!1},a.noty.setType=function(b,c){return a.noty.get(b)?a.noty.get(b).setType(c):!1},a.noty.clearQueue=function(){a.noty.queue=[]},a.noty.closeAll=function(){a.noty.clearQueue(),a.each(a.noty.store,function(a,b){b.close()})};var c=window.alert;a.noty.consumeAlert=function(b){window.alert=function(c){b?b.text=c:b={text:c},a.notyRenderer.init(b)}},a.noty.stopConsumeAlert=function(){window.alert=c},a.noty.defaults={layout:"top",theme:"defaultTheme",type:"alert",text:"",dismissQueue:!0,template:'',animation:{open:{height:"toggle"},close:{height:"toggle"},easing:"swing",speed:500},timeout:!1,force:!1,modal:!1,maxVisible:5,killer:!1,closeWith:["click"],callback:{onShow:function(){},afterShow:function(){},onClose:function(){},afterClose:function(){},onCloseClick:function(){}},buttons:!1},a(window).resize(function(){a.each(a.noty.layouts,function(b,c){c.container.style.apply(a(c.container.selector))})})}(jQuery),window.noty=function(a){return jQuery.notyRenderer.init(a)},function(a){a.noty.layouts.bottom={name:"bottom",options:{},container:{object:'',selector:"ul#noty_bottom_layout_container",style:function(){a(this).css({bottom:0,left:"5%",position:"fixed",width:"90%",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:9999999})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none"},addClass:""}}(jQuery),function(a){a.noty.layouts.bottomCenter={name:"bottomCenter",options:{},container:{object:'',selector:"ul#noty_bottomCenter_layout_container",style:function(){a(this).css({bottom:20,left:0,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),a(this).css({left:(a(window).width()-a(this).outerWidth(!1))/2+"px"})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.bottomLeft={name:"bottomLeft",options:{},container:{object:'',selector:"ul#noty_bottomLeft_layout_container",style:function(){a(this).css({bottom:20,left:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({left:5})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.bottomRight={name:"bottomRight",options:{},container:{object:'',selector:"ul#noty_bottomRight_layout_container",style:function(){a(this).css({bottom:20,right:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({right:5})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.center={name:"center",options:{},container:{object:'',selector:"ul#noty_center_layout_container",style:function(){a(this).css({position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7});var b=a(this).clone().css({visibility:"hidden",display:"block",position:"absolute",top:0,left:0}).attr("id","dupe");a("body").append(b),b.find(".i-am-closing-now").remove(),b.find("li").css("display","block");var c=b.height();b.remove(),a(this).hasClass("i-am-new")?a(this).css({left:(a(window).width()-a(this).outerWidth(!1))/2+"px",top:(a(window).height()-c)/2+"px"}):a(this).animate({left:(a(window).width()-a(this).outerWidth(!1))/2+"px",top:(a(window).height()-c)/2+"px"},500)}},parent:{object:" ",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.centerLeft={name:"centerLeft",options:{},container:{object:'',selector:"ul#noty_centerLeft_layout_container",style:function(){a(this).css({left:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7});var b=a(this).clone().css({visibility:"hidden",display:"block",position:"absolute",top:0,left:0}).attr("id","dupe");a("body").append(b),b.find(".i-am-closing-now").remove(),b.find("li").css("display","block");var c=b.height();b.remove(),a(this).hasClass("i-am-new")?a(this).css({top:(a(window).height()-c)/2+"px"}):a(this).animate({top:(a(window).height()-c)/2+"px"},500),window.innerWidth<600&&a(this).css({left:5})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.centerRight={name:"centerRight",options:{},container:{object:'',selector:"ul#noty_centerRight_layout_container",style:function(){a(this).css({right:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7});var b=a(this).clone().css({visibility:"hidden",display:"block",position:"absolute",top:0,left:0}).attr("id","dupe");a("body").append(b),b.find(".i-am-closing-now").remove(),b.find("li").css("display","block");var c=b.height();b.remove(),a(this).hasClass("i-am-new")?a(this).css({top:(a(window).height()-c)/2+"px"}):a(this).animate({top:(a(window).height()-c)/2+"px"},500),window.innerWidth<600&&a(this).css({right:5})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.inline={name:"inline",options:{},container:{object:'',selector:"ul.noty_inline_layout_container",style:function(){a(this).css({width:"100%",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:9999999})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none"},addClass:""}}(jQuery),function(a){a.noty.layouts.top={name:"top",options:{},container:{object:'',selector:"ul#noty_top_layout_container",style:function(){a(this).css({top:0,left:"5%",position:"fixed",width:"90%",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:9999999})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none"},addClass:""}}(jQuery),function(a){a.noty.layouts.topCenter={name:"topCenter",options:{},container:{object:'',selector:"ul#noty_topCenter_layout_container",style:function(){a(this).css({top:20,left:0,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),a(this).css({left:(a(window).width()-a(this).outerWidth(!1))/2+"px"})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.topLeft={name:"topLeft",options:{},container:{object:'',selector:"ul#noty_topLeft_layout_container",style:function(){a(this).css({top:20,left:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({left:5})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.topRight={name:"topRight",options:{},container:{object:'',selector:"ul#noty_topRight_layout_container",style:function(){a(this).css({top:20,right:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({right:5})}},parent:{object:" ",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.themes.defaultTheme={name:"defaultTheme",helpers:{borderFix:function(){if(this.options.dismissQueue){var b=this.options.layout.container.selector+" "+this.options.layout.parent.selector;switch(this.options.layout.name){case"top":a(b).css({borderRadius:"0px 0px 0px 0px"}),a(b).last().css({borderRadius:"0px 0px 5px 5px"});break;case"topCenter":case"topLeft":case"topRight":case"bottomCenter":case"bottomLeft":case"bottomRight":case"center":case"centerLeft":case"centerRight":case"inline":a(b).css({borderRadius:"0px 0px 0px 0px"}),a(b).first().css({"border-top-left-radius":"5px","border-top-right-radius":"5px"}),a(b).last().css({"border-bottom-left-radius":"5px","border-bottom-right-radius":"5px"});break;case"bottom":a(b).css({borderRadius:"0px 0px 0px 0px"}),a(b).first().css({borderRadius:"5px 5px 0px 0px"})}}}},modal:{css:{position:"fixed",width:"100%",height:"100%",backgroundColor:"#000",zIndex:1e4,opacity:.6,display:"none",left:0,top:0}},style:function(){switch(this.$bar.css({overflow:"hidden",background:"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"}),this.$message.css({fontSize:"13px",lineHeight:"16px",textAlign:"center",padding:"8px 10px 9px",width:"auto",position:"relative"}),this.$closeButton.css({position:"absolute",top:4,right:4,width:10,height:10,background:"url(data:image/png;base64,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)",display:"none",cursor:"pointer"}),this.$buttons.css({padding:5,textAlign:"right",borderTop:"1px solid #ccc",backgroundColor:"#fff"}),this.$buttons.find("button").css({marginLeft:5}),this.$buttons.find("button:first").css({marginLeft:0}),this.$bar.bind({mouseenter:function(){a(this).find(".noty_close").stop().fadeTo("normal",1)},mouseleave:function(){a(this).find(".noty_close").stop().fadeTo("normal",0)}}),this.options.layout.name){case"top":this.$bar.css({borderRadius:"0px 0px 5px 5px",borderBottom:"2px solid #eee",borderLeft:"2px solid #eee",borderRight:"2px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"});break;case"topCenter":case"center":case"bottomCenter":case"inline":this.$bar.css({borderRadius:"5px",border:"1px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}),this.$message.css({fontSize:"13px",textAlign:"center"});break;case"topLeft":case"topRight":case"bottomLeft":case"bottomRight":case"centerLeft":case"centerRight":this.$bar.css({borderRadius:"5px",border:"1px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}),this.$message.css({fontSize:"13px",textAlign:"left"});break;case"bottom":this.$bar.css({borderRadius:"5px 5px 0px 0px",borderTop:"2px solid #eee",borderLeft:"2px solid #eee",borderRight:"2px solid #eee",boxShadow:"0 -2px 4px rgba(0, 0, 0, 0.1)"});break;default:this.$bar.css({border:"2px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"})}switch(this.options.type){case"alert":case"notification":this.$bar.css({backgroundColor:"#FFF",borderColor:"#CCC",color:"#444"});break;case"warning":this.$bar.css({backgroundColor:"#FFEAA8",borderColor:"#FFC237",color:"#826200"}),this.$buttons.css({borderTop:"1px solid #FFC237"});break;case"error":this.$bar.css({backgroundColor:"red",borderColor:"darkred",color:"#FFF"}),this.$message.css({fontWeight:"bold"}),this.$buttons.css({borderTop:"1px solid darkred"});break;case"information":this.$bar.css({backgroundColor:"#57B7E2",borderColor:"#0B90C4",color:"#FFF"}),this.$buttons.css({borderTop:"1px solid #0B90C4"});break;case"success":this.$bar.css({backgroundColor:"lightgreen",borderColor:"#50C24E",color:"darkgreen"}),this.$buttons.css({borderTop:"1px solid #50C24E"});break;default:this.$bar.css({backgroundColor:"#FFF",borderColor:"#CCC",color:"#444"})}},callback:{onShow:function(){a.noty.themes.defaultTheme.helpers.borderFix.apply(this)},onClose:function(){a.noty.themes.defaultTheme.helpers.borderFix.apply(this)}}}}(jQuery);
--------------------------------------------------------------------------------
/public/js/noty/promise.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Noty Helpers Javascript From JQuery Javascript Library
3 | *
4 | * Ported by Maksim Pecherskiy. Original Licensing:
5 | *
6 | * http://jquery.com/
7 | *
8 | * Copyright 2011, John Resig
9 | * Dual licensed under the MIT or GPL Version 2 licenses.
10 | * http://jquery.org/license
11 | *
12 | * Includes Sizzle.js
13 | * http://sizzlejs.com/
14 | * Copyright 2011, The Dojo Foundation
15 | * Released under the MIT, BSD, and GPL Licenses.
16 | *
17 | * Date: Mon Nov 21 21:11:03 2011 -0500
18 | */
19 |
20 |
21 | (function(){
22 |
23 | // String to Object flags format cache
24 | var flagsCache = {};
25 |
26 | // Convert String-formatted flags into Object-formatted ones and store in cache
27 | function createFlags( flags ) {
28 | var object = flagsCache[ flags ] = {},
29 | i, length;
30 | flags = flags.split( /\s+/ );
31 | for ( i = 0, length = flags.length; i < length; i++ ) {
32 | object[ flags[i] ] = true;
33 | }
34 | return object;
35 | }
36 |
37 | jQuery.extend({
38 |
39 | _mark: function( elem, type ) {
40 | if ( elem ) {
41 | type = (type || "fx") + "mark";
42 | jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
43 | }
44 | },
45 |
46 | _unmark: function( force, elem, type ) {
47 | if ( force !== true ) {
48 | type = elem;
49 | elem = force;
50 | force = false;
51 | }
52 | if ( elem ) {
53 | type = type || "fx";
54 | var key = type + "mark",
55 | count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
56 | if ( count ) {
57 | jQuery.data( elem, key, count, true );
58 | } else {
59 | jQuery.removeData( elem, key, true );
60 | handleQueueMarkDefer( elem, type, "mark" );
61 | }
62 | }
63 | },
64 |
65 | queue: function( elem, type, data ) {
66 | if ( elem ) {
67 | type = (type || "fx") + "queue";
68 | var q = jQuery.data( elem, type, undefined, true );
69 | // Speed up dequeue by getting out quickly if this is just a lookup
70 | if ( data ) {
71 | if ( !q || jQuery.isArray(data) ) {
72 | q = jQuery.data( elem, type, jQuery.makeArray(data), true );
73 | } else {
74 | q.push( data );
75 | }
76 | }
77 | return q || [];
78 | }
79 | },
80 |
81 | dequeue: function( elem, type ) {
82 | type = type || "fx";
83 |
84 | var queue = jQuery.queue( elem, type ),
85 | fn = queue.shift(),
86 | defer;
87 |
88 | // If the fx queue is dequeued, always remove the progress sentinel
89 | if ( fn === "inprogress" ) {
90 | fn = queue.shift();
91 | }
92 |
93 | if ( fn ) {
94 | // Add a progress sentinel to prevent the fx queue from being
95 | // automatically dequeued
96 | if ( type === "fx" ) {
97 | queue.unshift("inprogress");
98 | }
99 |
100 | fn.call(elem, function() {
101 | jQuery.dequeue(elem, type);
102 | });
103 | }
104 |
105 | if ( !queue.length ) {
106 | jQuery.removeData( elem, type + "queue", true );
107 | handleQueueMarkDefer( elem, type, "queue" );
108 | }
109 | }
110 | });
111 |
112 | jQuery.fn.extend({
113 | queue: function( type, data ) {
114 | if ( typeof type !== "string" ) {
115 | data = type;
116 | type = "fx";
117 | }
118 |
119 | if ( data === undefined ) {
120 | return jQuery.queue( this[0], type );
121 | }
122 | return this.each(function() {
123 | var queue = jQuery.queue( this, type, data );
124 |
125 | if ( type === "fx" && queue[0] !== "inprogress" ) {
126 | jQuery.dequeue( this, type );
127 | }
128 | });
129 | },
130 | dequeue: function( type ) {
131 | return this.each(function() {
132 | jQuery.dequeue( this, type );
133 | });
134 | },
135 | // Based off of the plugin by Clint Helfers, with permission.
136 | // http://blindsignals.com/index.php/2009/07/jquery-delay/
137 | delay: function( time, type ) {
138 | time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
139 | type = type || "fx";
140 |
141 | return this.queue( type, function() {
142 | var elem = this;
143 | setTimeout(function() {
144 | jQuery.dequeue( elem, type );
145 | }, time );
146 | });
147 | },
148 | clearQueue: function( type ) {
149 | return this.queue( type || "fx", [] );
150 | },
151 | // Get a promise resolved when queues of a certain type
152 | // are emptied (fx is the type by default)
153 | promise: function( type, object ) {
154 | if ( typeof type !== "string" ) {
155 | object = type;
156 | type = undefined;
157 | }
158 | type = type || "fx";
159 | var defer = jQuery.Deferred(),
160 | elements = this,
161 | i = elements.length,
162 | count = 1,
163 | deferDataKey = type + "defer",
164 | queueDataKey = type + "queue",
165 | markDataKey = type + "mark",
166 | tmp;
167 | function resolve() {
168 | if ( !( --count ) ) {
169 | defer.resolveWith( elements, [ elements ] );
170 | }
171 | }
172 | while( i-- ) {
173 | if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
174 | ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
175 | jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
176 | jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
177 | count++;
178 | tmp.done( resolve );
179 | }
180 | }
181 | resolve();
182 | return defer.promise();
183 | }
184 | });
185 |
186 | function handleQueueMarkDefer( elem, type, src ) {
187 | var deferDataKey = type + "defer",
188 | queueDataKey = type + "queue",
189 | markDataKey = type + "mark",
190 | defer = jQuery._data( elem, deferDataKey );
191 | if ( defer &&
192 | ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
193 | ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
194 | // Give room for hard-coded callbacks to fire first
195 | // and eventually mark/queue something else on the element
196 | setTimeout( function() {
197 | if ( !jQuery._data( elem, queueDataKey ) &&
198 | !jQuery._data( elem, markDataKey ) ) {
199 | jQuery.removeData( elem, deferDataKey, true );
200 | defer.fire();
201 | }
202 | }, 0 );
203 | }
204 | }
205 |
206 |
207 |
208 | jQuery.Callbacks = function( flags ) {
209 |
210 | // Convert flags from String-formatted to Object-formatted
211 | // (we check in cache first)
212 | flags = flags ? ( /*flagsCache[ flags ] || */createFlags( flags ) ) : {};
213 |
214 | var // Actual callback list
215 | list = [],
216 | // Stack of fire calls for repeatable lists
217 | stack = [],
218 | // Last fire value (for non-forgettable lists)
219 | memory,
220 | // Flag to know if list is currently firing
221 | firing,
222 | // First callback to fire (used internally by add and fireWith)
223 | firingStart,
224 | // End of the loop when firing
225 | firingLength,
226 | // Index of currently firing callback (modified by remove if needed)
227 | firingIndex,
228 | // Add one or several callbacks to the list
229 | add = function( args ) {
230 | var i,
231 | length,
232 | elem,
233 | type,
234 | actual;
235 | for ( i = 0, length = args.length; i < length; i++ ) {
236 | elem = args[ i ];
237 | type = jQuery.type( elem );
238 | if ( type === "array" ) {
239 | // Inspect recursively
240 | add( elem );
241 | } else if ( type === "function" ) {
242 | // Add if not in unique mode and callback is not in
243 | if ( !flags.unique || !self.has( elem ) ) {
244 | list.push( elem );
245 | }
246 | }
247 | }
248 | },
249 | // Fire callbacks
250 | fire = function( context, args ) {
251 | args = args || [];
252 | memory = !flags.memory || [ context, args ];
253 | firing = true;
254 | firingIndex = firingStart || 0;
255 | firingStart = 0;
256 | firingLength = list.length;
257 | for ( ; list && firingIndex < firingLength; firingIndex++ ) {
258 | if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
259 | memory = true; // Mark as halted
260 | break;
261 | }
262 | }
263 | firing = false;
264 | if ( list ) {
265 | if ( !flags.once ) {
266 | if ( stack && stack.length ) {
267 | memory = stack.shift();
268 | self.fireWith( memory[ 0 ], memory[ 1 ] );
269 | }
270 | } else if ( memory === true ) {
271 | self.disable();
272 | } else {
273 | list = [];
274 | }
275 | }
276 | },
277 | // Actual Callbacks object
278 | self = {
279 | // Add a callback or a collection of callbacks to the list
280 | add: function() {
281 | if ( list ) {
282 | var length = list.length;
283 | add( arguments );
284 | // Do we need to add the callbacks to the
285 | // current firing batch?
286 | if ( firing ) {
287 | firingLength = list.length;
288 | // With memory, if we're not firing then
289 | // we should call right away, unless previous
290 | // firing was halted (stopOnFalse)
291 | } else if ( memory && memory !== true ) {
292 | firingStart = length;
293 | fire( memory[ 0 ], memory[ 1 ] );
294 | }
295 | }
296 | return this;
297 | },
298 | // Remove a callback from the list
299 | remove: function() {
300 | if ( list ) {
301 | var args = arguments,
302 | argIndex = 0,
303 | argLength = args.length;
304 | for ( ; argIndex < argLength ; argIndex++ ) {
305 | for ( var i = 0; i < list.length; i++ ) {
306 | if ( args[ argIndex ] === list[ i ] ) {
307 | // Handle firingIndex and firingLength
308 | if ( firing ) {
309 | if ( i <= firingLength ) {
310 | firingLength--;
311 | if ( i <= firingIndex ) {
312 | firingIndex--;
313 | }
314 | }
315 | }
316 | // Remove the element
317 | list.splice( i--, 1 );
318 | // If we have some unicity property then
319 | // we only need to do this once
320 | if ( flags.unique ) {
321 | break;
322 | }
323 | }
324 | }
325 | }
326 | }
327 | return this;
328 | },
329 | // Control if a given callback is in the list
330 | has: function( fn ) {
331 | if ( list ) {
332 | var i = 0,
333 | length = list.length;
334 | for ( ; i < length; i++ ) {
335 | if ( fn === list[ i ] ) {
336 | return true;
337 | }
338 | }
339 | }
340 | return false;
341 | },
342 | // Remove all callbacks from the list
343 | empty: function() {
344 | list = [];
345 | return this;
346 | },
347 | // Have the list do nothing anymore
348 | disable: function() {
349 | list = stack = memory = undefined;
350 | return this;
351 | },
352 | // Is it disabled?
353 | disabled: function() {
354 | return !list;
355 | },
356 | // Lock the list in its current state
357 | lock: function() {
358 | stack = undefined;
359 | if ( !memory || memory === true ) {
360 | self.disable();
361 | }
362 | return this;
363 | },
364 | // Is it locked?
365 | locked: function() {
366 | return !stack;
367 | },
368 | // Call all callbacks with the given context and arguments
369 | fireWith: function( context, args ) {
370 | if ( stack ) {
371 | if ( firing ) {
372 | if ( !flags.once ) {
373 | stack.push( [ context, args ] );
374 | }
375 | } else if ( !( flags.once && memory ) ) {
376 | fire( context, args );
377 | }
378 | }
379 | return this;
380 | },
381 | // Call all the callbacks with the given arguments
382 | fire: function() {
383 | self.fireWith( this, arguments );
384 | return this;
385 | },
386 | // To know if the callbacks have already been called at least once
387 | fired: function() {
388 | return !!memory;
389 | }
390 | };
391 |
392 | return self;
393 | };
394 |
395 |
396 |
397 | jQuery.fn.extend({
398 | // Get a promise resolved when queues of a certain type
399 | // are emptied (fx is the type by default)
400 | promise: function( type, object ) {
401 | if ( typeof type !== "string" ) {
402 | object = type;
403 | type = undefined;
404 | }
405 | type = type || "fx";
406 | var defer = jQuery.Deferred(),
407 | elements = this,
408 | i = elements.length,
409 | count = 1,
410 | deferDataKey = type + "defer",
411 | queueDataKey = type + "queue",
412 | markDataKey = type + "mark",
413 | tmp;
414 | function resolve() {
415 | if ( !( --count ) ) {
416 | defer.resolveWith( elements, [ elements ] );
417 | }
418 | }
419 | while( i-- ) {
420 | if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
421 | ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
422 | jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
423 | jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
424 | count++;
425 | tmp.add( resolve );
426 | }
427 | }
428 | resolve();
429 | return defer.promise();
430 | }
431 | });
432 | })();
--------------------------------------------------------------------------------
/public/js/noty/themes/default.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | $.noty.themes.defaultTheme = {
4 | name: 'defaultTheme',
5 | helpers: {
6 | borderFix: function() {
7 | if (this.options.dismissQueue) {
8 | var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector;
9 | switch (this.options.layout.name) {
10 | case 'top':
11 | $(selector).css({borderRadius: '0px 0px 0px 0px'});
12 | $(selector).last().css({borderRadius: '0px 0px 5px 5px'}); break;
13 | case 'topCenter': case 'topLeft': case 'topRight':
14 | case 'bottomCenter': case 'bottomLeft': case 'bottomRight':
15 | case 'center': case 'centerLeft': case 'centerRight': case 'inline':
16 | $(selector).css({borderRadius: '0px 0px 0px 0px'});
17 | $(selector).first().css({'border-top-left-radius': '5px', 'border-top-right-radius': '5px'});
18 | $(selector).last().css({'border-bottom-left-radius': '5px', 'border-bottom-right-radius': '5px'}); break;
19 | case 'bottom':
20 | $(selector).css({borderRadius: '0px 0px 0px 0px'});
21 | $(selector).first().css({borderRadius: '5px 5px 0px 0px'}); break;
22 | default: break;
23 | }
24 | }
25 | }
26 | },
27 | modal: {
28 | css: {
29 | position: 'fixed',
30 | width: '100%',
31 | height: '100%',
32 | backgroundColor: '#000',
33 | zIndex: 10000,
34 | opacity: 0.6,
35 | display: 'none',
36 | left: 0,
37 | top: 0
38 | }
39 | },
40 | style: function() {
41 |
42 | this.$bar.css({
43 | overflow: 'hidden',
44 | background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"
45 | });
46 |
47 | this.$message.css({
48 | fontSize: '13px',
49 | lineHeight: '16px',
50 | textAlign: 'center',
51 | padding: '8px 10px 9px',
52 | width: 'auto',
53 | position: 'relative'
54 | });
55 |
56 | this.$closeButton.css({
57 | position: 'absolute',
58 | top: 4, right: 4,
59 | width: 10, height: 10,
60 | background: "url(data:image/png;base64,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)",
61 | display: 'none',
62 | cursor: 'pointer'
63 | });
64 |
65 | this.$buttons.css({
66 | padding: 5,
67 | textAlign: 'right',
68 | borderTop: '1px solid #ccc',
69 | backgroundColor: '#fff'
70 | });
71 |
72 | this.$buttons.find('button').css({
73 | marginLeft: 5
74 | });
75 |
76 | this.$buttons.find('button:first').css({
77 | marginLeft: 0
78 | });
79 |
80 | this.$bar.bind({
81 | mouseenter: function() { $(this).find('.noty_close').stop().fadeTo('normal',1); },
82 | mouseleave: function() { $(this).find('.noty_close').stop().fadeTo('normal',0); }
83 | });
84 |
85 | switch (this.options.layout.name) {
86 | case 'top':
87 | this.$bar.css({
88 | borderRadius: '0px 0px 5px 5px',
89 | borderBottom: '2px solid #eee',
90 | borderLeft: '2px solid #eee',
91 | borderRight: '2px solid #eee',
92 | boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
93 | });
94 | break;
95 | case 'topCenter': case 'center': case 'bottomCenter': case 'inline':
96 | this.$bar.css({
97 | borderRadius: '5px',
98 | border: '1px solid #eee',
99 | boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
100 | });
101 | this.$message.css({fontSize: '13px', textAlign: 'center'});
102 | break;
103 | case 'topLeft': case 'topRight':
104 | case 'bottomLeft': case 'bottomRight':
105 | case 'centerLeft': case 'centerRight':
106 | this.$bar.css({
107 | borderRadius: '5px',
108 | border: '1px solid #eee',
109 | boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
110 | });
111 | this.$message.css({fontSize: '13px', textAlign: 'left'});
112 | break;
113 | case 'bottom':
114 | this.$bar.css({
115 | borderRadius: '5px 5px 0px 0px',
116 | borderTop: '2px solid #eee',
117 | borderLeft: '2px solid #eee',
118 | borderRight: '2px solid #eee',
119 | boxShadow: "0 -2px 4px rgba(0, 0, 0, 0.1)"
120 | });
121 | break;
122 | default:
123 | this.$bar.css({
124 | border: '2px solid #eee',
125 | boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
126 | });
127 | break;
128 | }
129 |
130 | switch (this.options.type) {
131 | case 'alert': case 'notification':
132 | this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
133 | case 'warning':
134 | this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'});
135 | this.$buttons.css({borderTop: '1px solid #FFC237'}); break;
136 | case 'error':
137 | this.$bar.css({backgroundColor: 'red', borderColor: 'darkred', color: '#FFF'});
138 | this.$message.css({fontWeight: 'bold'});
139 | this.$buttons.css({borderTop: '1px solid darkred'}); break;
140 | case 'information':
141 | this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF'});
142 | this.$buttons.css({borderTop: '1px solid #0B90C4'}); break;
143 | case 'success':
144 | this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen'});
145 | this.$buttons.css({borderTop: '1px solid #50C24E'});break;
146 | default:
147 | this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
148 | }
149 | },
150 | callback: {
151 | onShow: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); },
152 | onClose: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); }
153 | }
154 | };
155 |
156 | })(jQuery);
157 |
--------------------------------------------------------------------------------
/public/sounds/scherzo.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/sounds/scherzo.mp3
--------------------------------------------------------------------------------
/public/sounds/scherzo.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/syxanash/gitron/3b806066a8a4b0855dbc5d91c12b5979317042ad/public/sounds/scherzo.ogg
--------------------------------------------------------------------------------
/views/error.erb:
--------------------------------------------------------------------------------
1 | <%
2 | @title = 'Error'
3 | %>
4 |
5 |
10 |
11 |
12 |
13 | Error: <%= @error_message %>
14 |
15 | informing MCP immediately!
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/views/error_input.erb:
--------------------------------------------------------------------------------
1 | <%
2 | @title = 'Error repo not found!'
3 | %>
4 |
5 |
10 |
11 |
12 |
how could your programs fight if you don't even know their names? Enter a valid repository URL!
13 |
14 |
15 |
--------------------------------------------------------------------------------
/views/error_program.erb:
--------------------------------------------------------------------------------
1 | <%
2 | @title = 'Program not found!'
3 | %>
4 |
5 |
10 |
11 |
12 |
I beg your pardon, but I don't seem to know one of these programs on my grid!
13 |
14 |
15 |
--------------------------------------------------------------------------------
/views/error_rage_quit.erb:
--------------------------------------------------------------------------------
1 | <%
2 | @title = 'Error same repo twice!'
3 | %>
4 |
5 |
10 |
11 |
12 |
perhaps your program <%= @repo_name %> decided to commit a suicide? I am deeply sorry!
13 |
14 |
15 |
--------------------------------------------------------------------------------
/views/error_rate_limit.erb:
--------------------------------------------------------------------------------
1 | <%
2 | @title = 'API limit exceeded'
3 | %>
4 |
5 |
10 |
11 |
12 |
This grid has been temporarly closed due to a nasty infection, our data pushers are working on it!
13 | Retry in a few minutes...
14 |
15 |
16 |
--------------------------------------------------------------------------------
/views/fight.erb:
--------------------------------------------------------------------------------
1 | <%
2 | @title = "#{@players[0][:repo].capitalize} vs #{@players[1][:repo].capitalize}"
3 | winner = @players[@winner_index]
4 | loser = @players[@loser_index]
5 |
6 | # choose which derezzed image to display
7 | # for the looser checking the disk color
8 | derezzed_img = 'derezzed-red.png'
9 |
10 | if loser[:disk] =~ %r{blue}
11 | derezzed_img = 'derezzed-blue.png'
12 | end
13 |
14 | # beautify avatar file in order to show character name in disk info box
15 | character_name = winner[:avatar].gsub('_', ' ')[/.*(?=\..+$)/]
16 |
17 | # if user visits the fighting page then @players array will not
18 | # be nil in this case change the twitter sharing link
19 | twitter_link = "https://twitter.com/home?status=https://gitron.fly.dev/%20Greetings%20programs%20let's%20fight%20on%20%23GITRON"
20 |
21 | unless @players.nil?
22 | twitter_link = "https://twitter.com/home?status=Check%20out%20#{@players[0][:repo].capitalize}%20vs%20#{@players[1][:repo].capitalize}%20on%20%23GITRON%20http://gitron.fly.dev/#{@players[0][:name]}/#{@players[0][:repo]}/vs/#{@players[1][:name]}/#{@players[1][:repo]}"
23 | end
24 | %>
25 |
26 |
31 |
32 | <%
33 | @players.each_with_index do |player, i|
34 | if i == @winner_index
35 | %>
36 | Winner is <%= player[:repo] %> !
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | <% else %>
45 | <%= player[:repo] %> has been derezzed
46 |
47 | <% if player[:avatar] == 'jarvis.png' %>
48 | "Death to the Users!"
49 | <% end %>
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | <% end %>
58 | <% end %>
59 |
60 |
100 |
--------------------------------------------------------------------------------
/views/footer.erb:
--------------------------------------------------------------------------------
1 | © Gitron assets fork /r/tron
2 |
--------------------------------------------------------------------------------
/views/index.erb:
--------------------------------------------------------------------------------
1 | <%
2 | @title = 'Welcome'
3 | %>
4 |
5 |
6 |
7 |
8 | <%# if some achievements are unlocked change the logo %>
9 | <% if achieved?('THE CREATOR') %>
10 |
11 | <% elsif achieved?('BETRAYAL') %>
12 |
13 | <% else %>
14 |
15 | <% end %>
16 |
17 |
18 |
19 |
20 |
28 |
29 |
95 |
--------------------------------------------------------------------------------
/views/layout.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | GITRON -
9 | <%=
10 | # the @title variable will change depending on the inner page you are visiting
11 | "#{@title}"
12 | %>
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
Welcome to GIT RON
25 | <%= yield %>
26 |
27 |
28 |
39 |
40 | <%# show new achievements if unlocked %>
41 |
42 | <% @achievements.each do |message| %>
43 |
57 | <% end %>
58 |
59 | <% if @achievements.size > 0 %>
60 |
78 | <% end %>
79 |
80 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/views/layout2.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
39 |
40 | GITRON - <%= "#{@title}" %>
41 |
42 |
43 |
44 |
45 |
46 |
47 | <%= yield %>
48 |
49 |
50 |
--------------------------------------------------------------------------------
/views/not_found.erb:
--------------------------------------------------------------------------------
1 | <% @title = 'END OF LINE' %>
2 |
3 | Argh! busted again!
4 |
--------------------------------------------------------------------------------