juice 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/{History.txt → History.txt } +0 -0
- data/Manifest.txt +37 -0
- data/{PostInstall.txt → PostInstall.txt } +0 -0
- data/{README.rdoc → README.rdoc } +0 -0
- data/StarterApplication/Framework/Juice.Alert.js +59 -0
- data/StarterApplication/Framework/Juice.Application.js +33 -0
- data/StarterApplication/Framework/Juice.Button.js +25 -0
- data/StarterApplication/Framework/Juice.Confirm.js +42 -0
- data/StarterApplication/Framework/Juice.Cookie.js +50 -0
- data/StarterApplication/Framework/Juice.DOM.js +223 -0
- data/StarterApplication/Framework/Juice.Event.js +57 -0
- data/StarterApplication/Framework/Juice.Image.js +38 -0
- data/StarterApplication/Framework/Juice.JSONPConnection.js +42 -0
- data/StarterApplication/Framework/Juice.Layout.js +29 -0
- data/StarterApplication/Framework/Juice.Window.js +73 -0
- data/StarterApplication/Framework/Juice.i18n.js +46 -0
- data/StarterApplication/Framework/Juice.js +324 -0
- data/StarterApplication/Framework/Resources/Themes/Default.css +85 -0
- data/StarterApplication/Framework/Resources/Themes/Default/images/Thumbs.db +0 -0
- data/StarterApplication/Framework/Resources/Themes/Default/images/button-sprite.png +0 -0
- data/StarterApplication/Framework/Resources/Themes/Default/images/spinner.gif +0 -0
- data/StarterApplication/Framework/Resources/images/Thumbs.db +0 -0
- data/StarterApplication/Framework/Resources/images/spinner.gif +0 -0
- data/StarterApplication/LICENSE +20 -0
- data/StarterApplication/README +6 -0
- data/StarterApplication/appController.js +18 -0
- data/StarterApplication/index.html +26 -0
- data/StarterApplication/juice.app +5 -0
- data/bin/juice +78 -0
- data/lib/{JSquish.rb → JSquish.rb } +0 -0
- data/lib/{juice.rb → juice.rb } +1 -1
- data/script/{console → console } +0 -0
- data/script/{console.cmd → console.cmd } +0 -0
- data/script/{destroy → destroy } +0 -0
- data/script/{destroy.cmd → destroy.cmd } +0 -0
- data/script/{generate → generate } +0 -0
- data/script/{generate.cmd → generate.cmd } +0 -0
- metadata +41 -20
- data/Manifest.txt +0 -14
- data/Rakefile +0 -20
@@ -0,0 +1,85 @@
|
|
1
|
+
html, body, div, span, applet, object, iframe,
|
2
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
3
|
+
a, abbr, acronym, address, big, cite, code,
|
4
|
+
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
5
|
+
small, strike, strong, sub, sup, tt, var,
|
6
|
+
b, u, i, center,
|
7
|
+
dl, dt, dd, ol, ul, li,
|
8
|
+
fieldset, form, label, legend,
|
9
|
+
table, caption, tbody, tfoot, thead, tr, th, td {
|
10
|
+
margin: 0;
|
11
|
+
padding: 0;
|
12
|
+
border: 0;
|
13
|
+
outline: 0;
|
14
|
+
font-size: 100%;
|
15
|
+
vertical-align: baseline;
|
16
|
+
background: transparent;
|
17
|
+
}
|
18
|
+
body {
|
19
|
+
line-height: 1;
|
20
|
+
}
|
21
|
+
|
22
|
+
blockquote, q {
|
23
|
+
quotes: none;
|
24
|
+
}
|
25
|
+
blockquote:before, blockquote:after,
|
26
|
+
q:before, q:after {
|
27
|
+
content: '';
|
28
|
+
content: none;
|
29
|
+
}
|
30
|
+
|
31
|
+
/* remember to define focus styles! */
|
32
|
+
:focus {
|
33
|
+
outline: 0;
|
34
|
+
}
|
35
|
+
|
36
|
+
/* remember to highlight inserts somehow! */
|
37
|
+
ins {
|
38
|
+
text-decoration: none;
|
39
|
+
}
|
40
|
+
del {
|
41
|
+
text-decoration: line-through;
|
42
|
+
}
|
43
|
+
|
44
|
+
/* tables still need 'cellspacing="0"' in the markup */
|
45
|
+
table {
|
46
|
+
border-collapse: collapse;
|
47
|
+
border-spacing: 0;
|
48
|
+
}
|
49
|
+
|
50
|
+
body{
|
51
|
+
background:#3A4355;
|
52
|
+
font-size:11pt;
|
53
|
+
font-family:Arial,sans-serif;
|
54
|
+
position:relative;
|
55
|
+
}
|
56
|
+
|
57
|
+
/* Alerts */
|
58
|
+
.JuiceAlert{
|
59
|
+
background:#FFF;
|
60
|
+
padding:10px;
|
61
|
+
display:block;
|
62
|
+
-moz-border-radius:5px;
|
63
|
+
-webkit-border-radius:5px;
|
64
|
+
-khtml-border-radius:5px;
|
65
|
+
border:1px solid #333;
|
66
|
+
min-width:500px;
|
67
|
+
position:absolute;
|
68
|
+
text-align:left;
|
69
|
+
z-index:9999;
|
70
|
+
}
|
71
|
+
.JuiceAlert[id] {
|
72
|
+
position:fixed;
|
73
|
+
}
|
74
|
+
.JuiceAlert div{
|
75
|
+
padding:10px 0;
|
76
|
+
}
|
77
|
+
.JuiceAlert button{
|
78
|
+
margin-right:10px;
|
79
|
+
}
|
80
|
+
/* Button */
|
81
|
+
|
82
|
+
button::-moz-focus-inner /* fixing evil default firefox padding */ {
|
83
|
+
padding:0;
|
84
|
+
border:none;
|
85
|
+
}
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Justin Baker
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
var app = new Juice.Application();
|
2
|
+
var theWindow = new Juice.Window("theWindow");
|
3
|
+
app.addSubview(theWindow.contentView());
|
4
|
+
theWindow.setStringValue("this is test").setSizing(Juice.Layout.fullWidth,Juice.Layout.fullHeight).setForeground("white");
|
5
|
+
|
6
|
+
var alert_button = new Juice.Button('Test Alert',function(){
|
7
|
+
var alert = new Juice.Alert({title: 'Alert Test', text:'This demonstrates how to use an alert'});
|
8
|
+
alert.addButton('Cancel',function(){alert.remove();});
|
9
|
+
});
|
10
|
+
|
11
|
+
var confirm_button = new Juice.Button('Test Confirm',function(){
|
12
|
+
var confirm = new Juice.Confirm({text:'This demonstrates how to use a confirm',callback:function(bool){
|
13
|
+
alert(bool);
|
14
|
+
}});
|
15
|
+
});
|
16
|
+
|
17
|
+
theWindow.addSubview(alert_button.contentView());
|
18
|
+
theWindow.addSubview(confirm_button.contentView());
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
3
|
+
<head>
|
4
|
+
<script src="Framework/Juice.js" type="text/javascript"></script>
|
5
|
+
<script type="text/javascript">
|
6
|
+
Juice.appDidLoad(function(){
|
7
|
+
Juice.useTheme("Default");
|
8
|
+
});
|
9
|
+
</script>
|
10
|
+
<!--[if lt IE 7]>
|
11
|
+
<STYLE type="text/css">
|
12
|
+
#container { position: relative; top: 50%; }
|
13
|
+
#content { position: relative;}
|
14
|
+
</STYLE>
|
15
|
+
<![endif]-->
|
16
|
+
</head>
|
17
|
+
<body id='juice-body'>
|
18
|
+
<div id="juiceloadingcontainer" style=" background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
19
|
+
<script type = "text/javascript">
|
20
|
+
document.write("<div id='container'><p id='content'>" +
|
21
|
+
"<img id='loadgraphic' width='16' height='16' src='Framework/Resources/images/spinner.gif' /> " +
|
22
|
+
"Loading Application..</p></div>");
|
23
|
+
</script>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
data/bin/juice
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
require 'webrick'
|
3
|
+
require 'JSquish.rb'
|
4
|
+
include WEBrick
|
5
|
+
class File
|
6
|
+
def self.readt_s(filename)
|
7
|
+
data = ''
|
8
|
+
f = File.open(filename, "r")
|
9
|
+
f.each_line do |line|
|
10
|
+
data += line
|
11
|
+
end
|
12
|
+
data
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
module Juice
|
17
|
+
class Base
|
18
|
+
def initialize
|
19
|
+
params = ARGV
|
20
|
+
if params[0] == 'server'
|
21
|
+
Juice::Base.server()
|
22
|
+
elsif params[0] == 'build'
|
23
|
+
Juice::Base.build()
|
24
|
+
else
|
25
|
+
puts 'No method given'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.build
|
30
|
+
save_file = ARGV[1].nil? ? 'production.js' : ARGV[1]
|
31
|
+
if !File.exists?("juice.app")
|
32
|
+
puts "This doesn't seem to be a Juice Application"
|
33
|
+
elsif File.exists?(save_file)
|
34
|
+
puts "#{save_file} already exists!"
|
35
|
+
else
|
36
|
+
app = ''
|
37
|
+
files = Dir.glob("Framework/Juice.js")
|
38
|
+
Dir.glob("Framework/Juice.*.js").each do |me|
|
39
|
+
files.push(me)
|
40
|
+
end
|
41
|
+
Dir.glob("*.js").each do |me|
|
42
|
+
files.push(me)
|
43
|
+
end
|
44
|
+
files.each do |file|
|
45
|
+
puts "Adding #{file}"
|
46
|
+
if file == "Framework/Juice.js"
|
47
|
+
js = File.readt_s(file)
|
48
|
+
else
|
49
|
+
js = "Juice.appDidLoad(function(){#{File.readt_s(file)}});"
|
50
|
+
end
|
51
|
+
app = app +js
|
52
|
+
end
|
53
|
+
app = JSquish.parse(app)
|
54
|
+
puts "Saving to #{save_file}"
|
55
|
+
File.open(save_file, 'w') {|f| f.write(app) }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.server
|
60
|
+
port = ARGV[1].nil? ? 80 : ARGV[1]
|
61
|
+
puts "Starting webrick on #{Dir.getwd} \n "
|
62
|
+
Juice::Base.start_webrick(port,:DocumentRoot => Dir.getwd)
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.start_webrick(port = 8080 ,config = {})
|
66
|
+
# always listen on port 8080
|
67
|
+
config.update(:Port => port)
|
68
|
+
server = HTTPServer.new(config)
|
69
|
+
yield server if block_given?
|
70
|
+
['INT', 'TERM'].each do |signal|
|
71
|
+
trap(signal) {server.shutdown}
|
72
|
+
end
|
73
|
+
server.start
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
Juice::Base.new
|
File without changes
|
data/lib/{juice.rb → juice.rb }
RENAMED
data/script/{console → console }
RENAMED
File without changes
|
File without changes
|
data/script/{destroy → destroy }
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: juice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Baker
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-12 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -29,25 +29,46 @@ executables:
|
|
29
29
|
- juice
|
30
30
|
extensions: []
|
31
31
|
|
32
|
-
extra_rdoc_files:
|
33
|
-
|
34
|
-
- Manifest.txt
|
35
|
-
- PostInstall.txt
|
32
|
+
extra_rdoc_files: []
|
33
|
+
|
36
34
|
files:
|
37
|
-
- History.txt
|
38
|
-
- Manifest.txt
|
39
|
-
- PostInstall.txt
|
40
|
-
- README.rdoc
|
41
|
-
-
|
42
|
-
-
|
43
|
-
- lib/
|
44
|
-
-
|
45
|
-
- script/
|
46
|
-
- script/
|
47
|
-
- script/destroy
|
48
|
-
- script/
|
49
|
-
- script/
|
50
|
-
-
|
35
|
+
- "History.txt "
|
36
|
+
- "Manifest.txt "
|
37
|
+
- "PostInstall.txt "
|
38
|
+
- "README.rdoc "
|
39
|
+
- "bin/juice "
|
40
|
+
- "lib/juice.rb "
|
41
|
+
- "lib/JSquish.rb "
|
42
|
+
- "script/generate.cmd "
|
43
|
+
- "script/generate "
|
44
|
+
- "script/destroy.cmd "
|
45
|
+
- "script/destroy "
|
46
|
+
- "script/console.cmd "
|
47
|
+
- "script/console "
|
48
|
+
- "StarterApplication/README "
|
49
|
+
- "StarterApplication/LICENSE "
|
50
|
+
- "StarterApplication/juice.app "
|
51
|
+
- "StarterApplication/index.html "
|
52
|
+
- "StarterApplication/Framework/Resources/Themes/Default.css "
|
53
|
+
- "StarterApplication/Framework/Resources/Themes/Default/images/Thumbs.db "
|
54
|
+
- "StarterApplication/Framework/Resources/Themes/Default/images/spinner.gif "
|
55
|
+
- "StarterApplication/Framework/Resources/Themes/Default/images/button-sprite.png "
|
56
|
+
- "StarterApplication/Framework/Resources/images/Thumbs.db "
|
57
|
+
- "StarterApplication/Framework/Resources/images/spinner.gif "
|
58
|
+
- "StarterApplication/Framework/Juice.Window.js "
|
59
|
+
- "StarterApplication/Framework/Juice.Layout.js "
|
60
|
+
- "StarterApplication/Framework/Juice.JSONPConnection.js "
|
61
|
+
- "StarterApplication/Framework/Juice.js "
|
62
|
+
- "StarterApplication/Framework/Juice.Image.js "
|
63
|
+
- "StarterApplication/Framework/Juice.i18n.js "
|
64
|
+
- "StarterApplication/Framework/Juice.Event.js "
|
65
|
+
- "StarterApplication/Framework/Juice.DOM.js "
|
66
|
+
- "StarterApplication/Framework/Juice.Cookie.js "
|
67
|
+
- "StarterApplication/Framework/Juice.Confirm.js "
|
68
|
+
- "StarterApplication/Framework/Juice.Button.js "
|
69
|
+
- "StarterApplication/Framework/Juice.Application.js "
|
70
|
+
- "StarterApplication/Framework/Juice.Alert.js "
|
71
|
+
- "StarterApplication/appController.js "
|
51
72
|
has_rdoc: true
|
52
73
|
homepage: http://juicejs.com
|
53
74
|
licenses: []
|
data/Manifest.txt
DELETED
data/Rakefile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
gem 'hoe', '>= 2.1.0'
|
3
|
-
require 'hoe'
|
4
|
-
require 'fileutils'
|
5
|
-
require './lib/juice'
|
6
|
-
|
7
|
-
Hoe.plugin :newgem
|
8
|
-
# Hoe.plugin :website
|
9
|
-
# Hoe.plugin :cucumberfeatures
|
10
|
-
|
11
|
-
# Generate all the Rake tasks
|
12
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
-
$hoe = Hoe.spec 'juice' do
|
14
|
-
self.developer 'Justin Baker', 'justin@fluttrhq.com'
|
15
|
-
self.rubyforge_name = self.name # TODO this is default value
|
16
|
-
end
|
17
|
-
|
18
|
-
require 'newgem/tasks'
|
19
|
-
Dir['tasks/**/*.rake'].each { |t| load t }
|
20
|
-
|