vines-web 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +3 -0
- data/LICENSE +19 -0
- data/README.md +37 -0
- data/Rakefile +28 -0
- data/app/assets/javascripts/application.coffee +19 -0
- data/app/assets/javascripts/chat.coffee +362 -0
- data/app/assets/javascripts/lib/button.coffee +25 -0
- data/app/assets/javascripts/lib/contact.coffee +32 -0
- data/app/assets/javascripts/lib/filter.coffee +49 -0
- data/app/assets/javascripts/lib/index.coffee +1 -0
- data/app/assets/javascripts/lib/layout.coffee +30 -0
- data/app/assets/javascripts/lib/login.coffee +68 -0
- data/app/assets/javascripts/lib/logout.coffee +5 -0
- data/app/assets/javascripts/lib/navbar.coffee +84 -0
- data/app/assets/javascripts/lib/notification.coffee +14 -0
- data/app/assets/javascripts/lib/router.coffee +40 -0
- data/app/assets/javascripts/lib/session.coffee +229 -0
- data/app/assets/javascripts/lib/transfer.coffee +106 -0
- data/app/assets/javascripts/vendor/icons.js +110 -0
- data/app/assets/javascripts/vendor/index.js +1 -0
- data/app/assets/javascripts/vendor/jquery.js +4 -0
- data/app/assets/javascripts/vendor/raphael.js +6 -0
- data/app/assets/javascripts/vendor/strophe.js +1 -0
- data/app/assets/stylesheets/application.css +5 -0
- data/app/assets/stylesheets/base.scss +385 -0
- data/app/assets/stylesheets/chat.scss +144 -0
- data/app/assets/stylesheets/login.scss +68 -0
- data/bin/vines-web +63 -0
- data/config.ru +10 -0
- data/lib/vines/web/command/init.rb +34 -0
- data/lib/vines/web/command/install.rb +19 -0
- data/lib/vines/web/version.rb +5 -0
- data/lib/vines/web.rb +4 -0
- data/public/assets/application.css +598 -0
- data/public/assets/application.js +9 -0
- data/public/assets/lib.js +1 -0
- data/public/assets/vendor.js +8 -0
- data/public/images/dark-gray.png +0 -0
- data/public/images/default-user.png +0 -0
- data/public/images/light-gray.png +0 -0
- data/public/images/logo-large.png +0 -0
- data/public/images/logo-small.png +0 -0
- data/public/images/white.png +0 -0
- data/public/index.html +13 -0
- data/vines-web.gemspec +27 -0
- metadata +207 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
#login-page {
|
2
|
+
background: -moz-radial-gradient(rgba(26, 55, 98, 0.8), rgba(12, 26, 45, 0.8)), url(../images/dark-gray.png);
|
3
|
+
background: -ms-radial-gradient(center, 500px 500px, rgba(26, 55, 98, 0.8), rgba(12, 26, 45, 0.8)), url(../images/dark-gray.png);
|
4
|
+
background: -o-radial-gradient(rgba(26, 55, 98, 0.8), rgba(12, 26, 45, 0.8)), url(../images/dark-gray.png);
|
5
|
+
background: -webkit-radial-gradient(center, 500px 500px, rgba(26, 55, 98, 0.8), rgba(12, 26, 45, 0.8)), url(../images/dark-gray.png);
|
6
|
+
}
|
7
|
+
#login-page #container {
|
8
|
+
height: 100%;
|
9
|
+
width: 100%;
|
10
|
+
text-align: center;
|
11
|
+
}
|
12
|
+
#login-page #login-form {
|
13
|
+
margin: 0 auto;
|
14
|
+
position: relative;
|
15
|
+
width: 640px;
|
16
|
+
}
|
17
|
+
#login-page #login-form h1 {
|
18
|
+
background: url(../images/logo-large.png) no-repeat;
|
19
|
+
color: transparent;
|
20
|
+
height: 82px;
|
21
|
+
line-height: 1;
|
22
|
+
margin: 0 auto 40px auto;
|
23
|
+
text-shadow: none;
|
24
|
+
width: 245px;
|
25
|
+
}
|
26
|
+
#login-page #jid,
|
27
|
+
#login-page #password {
|
28
|
+
margin: 0 auto;
|
29
|
+
margin-bottom: 10px;
|
30
|
+
width: 240px;
|
31
|
+
display: block;
|
32
|
+
}
|
33
|
+
#login-page #icon {
|
34
|
+
position: absolute;
|
35
|
+
left: 90px;
|
36
|
+
top: 0px;
|
37
|
+
width: 100px;
|
38
|
+
height: 80px;
|
39
|
+
}
|
40
|
+
#login-page #login-form-controls {
|
41
|
+
background: rgba(0, 0, 0, 0.2);
|
42
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
43
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
44
|
+
border-radius: 5px;
|
45
|
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1) inset;
|
46
|
+
margin: 0 auto;
|
47
|
+
padding: 20px;
|
48
|
+
}
|
49
|
+
#login-page #start {
|
50
|
+
width: 100px;
|
51
|
+
margin-left: 0;
|
52
|
+
margin-bottom: 0;
|
53
|
+
}
|
54
|
+
#login-page #start:active {
|
55
|
+
box-shadow: inset 0 1px 7px #0c1a2d;
|
56
|
+
}
|
57
|
+
#login-page input[type="submit"] {
|
58
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.5);
|
59
|
+
}
|
60
|
+
#login-page #error {
|
61
|
+
background: rgba(255, 255, 255, 0.05);
|
62
|
+
border-radius: 3px;
|
63
|
+
color: #4693FF;
|
64
|
+
font-size: 10pt;
|
65
|
+
margin: 20px auto;
|
66
|
+
text-shadow: 0 1px 1px #000;
|
67
|
+
width: 250px;
|
68
|
+
}
|
data/bin/vines-web
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'vines/web'
|
5
|
+
|
6
|
+
COMMANDS = %w[init install]
|
7
|
+
|
8
|
+
def parse(args)
|
9
|
+
options = {}
|
10
|
+
parser = OptionParser.new do |opts|
|
11
|
+
opts.banner = "Usage: vines-web [options] #{COMMANDS.join('|')}"
|
12
|
+
|
13
|
+
opts.separator ""
|
14
|
+
opts.separator "Common options:"
|
15
|
+
|
16
|
+
opts.on('-h', '--help', 'Show this message') do |help|
|
17
|
+
options[:help] = help
|
18
|
+
end
|
19
|
+
|
20
|
+
opts.on('-v', '--version', 'Show version') do |version|
|
21
|
+
options[:version] = version
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
begin
|
26
|
+
parser.parse!(args)
|
27
|
+
rescue
|
28
|
+
puts parser
|
29
|
+
exit(1)
|
30
|
+
end
|
31
|
+
|
32
|
+
if options[:version]
|
33
|
+
puts Vines::Web::VERSION
|
34
|
+
exit
|
35
|
+
end
|
36
|
+
|
37
|
+
if options[:help]
|
38
|
+
puts parser
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
|
42
|
+
command = args.shift
|
43
|
+
unless COMMANDS.include?(command)
|
44
|
+
puts parser
|
45
|
+
exit(1)
|
46
|
+
end
|
47
|
+
|
48
|
+
options.tap do |opts|
|
49
|
+
opts[:args] = args
|
50
|
+
opts[:command] = command
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
opts = parse(ARGV)
|
55
|
+
command = Vines::Web::Command.const_get(opts[:command].capitalize).new
|
56
|
+
begin
|
57
|
+
command.run(opts)
|
58
|
+
rescue SystemExit
|
59
|
+
# do nothing
|
60
|
+
rescue Exception => e
|
61
|
+
puts e.message
|
62
|
+
exit(1)
|
63
|
+
end
|
data/config.ru
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'sprockets'
|
2
|
+
|
3
|
+
use Rack::Static, urls: ['/images'], root: 'public', index: 'index.html'
|
4
|
+
|
5
|
+
map '/assets' do
|
6
|
+
environment = Sprockets::Environment.new
|
7
|
+
environment.append_path 'app/assets/javascripts'
|
8
|
+
environment.append_path 'app/assets/stylesheets'
|
9
|
+
run environment
|
10
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Vines
|
2
|
+
module Web
|
3
|
+
module Command
|
4
|
+
class Init
|
5
|
+
def run(opts)
|
6
|
+
raise 'vines-web init <domain>' unless opts[:args].size == 1
|
7
|
+
raise 'vines gem required: gem install vines' unless vines_installed?
|
8
|
+
|
9
|
+
domain = opts[:args].first.downcase
|
10
|
+
base = File.expand_path(domain)
|
11
|
+
|
12
|
+
`vines init #{domain}` unless File.exists?(base)
|
13
|
+
|
14
|
+
web = File.expand_path('../../../../../public', __FILE__)
|
15
|
+
FileUtils.cp_r(Dir.glob("#{web}/*"), "#{domain}/web")
|
16
|
+
|
17
|
+
puts "Web assets installed: #{domain}"
|
18
|
+
puts "Run 'cd #{domain} && vines start' to begin"
|
19
|
+
|
20
|
+
`type open && open http://localhost:5280/`
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def vines_installed?
|
26
|
+
require 'vines/version'
|
27
|
+
true
|
28
|
+
rescue LoadError
|
29
|
+
false
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Vines
|
2
|
+
module Web
|
3
|
+
module Command
|
4
|
+
class Install
|
5
|
+
def run(opts)
|
6
|
+
raise 'vines-web install <dir>' unless opts[:args].size == 1
|
7
|
+
|
8
|
+
dir = opts[:args].first.downcase
|
9
|
+
dir = File.expand_path(dir)
|
10
|
+
Dir.mkdir(dir) unless File.exists?(dir)
|
11
|
+
|
12
|
+
web = File.expand_path("../../../../../public", __FILE__)
|
13
|
+
FileUtils.cp_r(Dir.glob("#{web}/*"), dir)
|
14
|
+
puts "Web assets installed: #{dir}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/vines/web.rb
ADDED