acts_as_monitor 0.0.2 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -3
- data/README.md +22 -0
- data/app/controllers/acts_as_monitor/monitors_controller.rb +18 -0
- data/app/helpers/acts_as_monitor_helper.rb +25 -0
- data/app/views/acts_as_monitor/monitors/show.html.erb +26 -0
- data/config/routes.rb +3 -1
- data/lib/acts_as_monitor/engine.rb +21 -8
- data/lib/acts_as_monitor/monitor.rb +1 -1
- data/lib/acts_as_monitor/version.rb +1 -1
- data/lib/acts_as_monitor.rb +10 -10
- data/lib/generators/acts_as_monitor/install/install_generator.rb +33 -25
- data/lib/generators/acts_as_monitor/install/templates/acts_as_monitor.css +48 -0
- data/lib/generators/acts_as_monitor/install/templates/acts_as_monitor.it.yml +8 -1
- data/lib/generators/acts_as_monitor/install/templates/acts_as_monitor_javascript.js +78 -0
- data/lib/generators/acts_as_monitor/install/templates/acts_as_monitor_loading.gif +0 -0
- data/test/acts_as_monitor_helper_test.rb +16 -0
- data/test/{units/acts_as_monitor_test.rb → acts_as_monitor_test.rb} +3 -20
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/homes_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/homes_helper.rb +2 -0
- data/test/dummy/app/models/test_class.rb +33 -0
- data/test/dummy/app/models/test_class_no_monitor.rb +2 -0
- data/test/dummy/app/views/homes/index.html.erb +8 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +45 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +22 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +26 -0
- data/test/dummy/config/environments/production.rb +49 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/locales/acts_as_monitor.it.yml +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/{acts_as_monitor.sqlite3.db → dummy/db/development.sqlite3} +0 -0
- data/test/dummy/db/migrate/20120523110000_add_test_tables.rb +12 -0
- data/test/dummy/db/schema.rb +19 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +4537 -0
- data/test/dummy/log/production.log +0 -0
- data/test/dummy/log/server.log +0 -0
- data/test/dummy/log/test.log +188 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/images/acts_as_monitor_green.png +0 -0
- data/test/dummy/public/images/acts_as_monitor_red.png +0 -0
- data/test/dummy/public/images/acts_as_monitor_yellow.png +0 -0
- data/test/dummy/public/javascripts/acts_as_monitor_javascript.js +66 -0
- data/test/dummy/public/javascripts/application.js +2 -0
- data/test/dummy/public/javascripts/builder.js +136 -0
- data/test/dummy/public/javascripts/controls.js +965 -0
- data/test/dummy/public/javascripts/dragdrop.js +974 -0
- data/test/dummy/public/javascripts/effects.js +1123 -0
- data/test/dummy/public/javascripts/prototype.js +6001 -0
- data/test/dummy/public/javascripts/rails.js +191 -0
- data/test/dummy/public/javascripts/scriptaculous.js +68 -0
- data/test/dummy/public/javascripts/slider.js +275 -0
- data/test/dummy/public/javascripts/sound.js +59 -0
- data/test/dummy/public/javascripts/unittest.js +568 -0
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
- data/test/dummy/public/stylesheets/acts_as_monitor.css +30 -0
- data/test/dummy/script/rails +6 -0
- data/test/integration/navigation_test.rb +7 -0
- data/test/support/integration_case.rb +5 -0
- data/test/test_helper.rb +17 -42
- metadata +128 -11
- data/app/controllers/acts_as_monitor/monitor_controller.rb +0 -7
- data/app/helpers/monitor_helper.rb +0 -11
- data/app/views/acts_as_monitor/indext.html.erb +0 -1
File without changes
|
File without changes
|
@@ -0,0 +1,188 @@
|
|
1
|
+
[1m[36mSQL (0.9ms)[0m [1m SELECT name
|
2
|
+
FROM sqlite_master
|
3
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
4
|
+
[0m
|
5
|
+
[1m[35mSQL (0.1ms)[0m select sqlite_version(*)
|
6
|
+
[1m[36mSQL (19.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
7
|
+
[1m[35mSQL (0.1ms)[0m PRAGMA index_list("schema_migrations")
|
8
|
+
[1m[36mSQL (1.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9
|
+
[1m[35mSQL (0.1ms)[0m SELECT name
|
10
|
+
FROM sqlite_master
|
11
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
12
|
+
[1m[36mSQL (1.2ms)[0m [1m SELECT name
|
13
|
+
FROM sqlite_master
|
14
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
15
|
+
[0m
|
16
|
+
[1m[36mSQL (1.0ms)[0m [1m SELECT name
|
17
|
+
FROM sqlite_master
|
18
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
19
|
+
[0m
|
20
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
21
|
+
FROM sqlite_master
|
22
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
23
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
24
|
+
FROM sqlite_master
|
25
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
26
|
+
[0m
|
27
|
+
[1m[35mSQL (0.1ms)[0m SELECT name
|
28
|
+
FROM sqlite_master
|
29
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
30
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
31
|
+
Migrating to AddTestTables (20120523110000)
|
32
|
+
[1m[35mSQL (0.1ms)[0m select sqlite_version(*)
|
33
|
+
[1m[36mSQL (0.2ms)[0m [1m SELECT name
|
34
|
+
FROM sqlite_master
|
35
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
36
|
+
[0m
|
37
|
+
[1m[35mSQL (0.8ms)[0m CREATE TABLE "test_classes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
|
38
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20120523110000')[0m
|
39
|
+
[1m[35mSQL (0.3ms)[0m SELECT name
|
40
|
+
FROM sqlite_master
|
41
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
42
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
43
|
+
FROM sqlite_master
|
44
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
45
|
+
[0m
|
46
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
47
|
+
FROM sqlite_master
|
48
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
49
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
50
|
+
Migrating to AddTestTables (20120523110000)
|
51
|
+
[1m[35mSQL (0.3ms)[0m SELECT name
|
52
|
+
FROM sqlite_master
|
53
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
54
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
55
|
+
FROM sqlite_master
|
56
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
57
|
+
[0m
|
58
|
+
[1m[35mSQL (0.7ms)[0m SELECT name
|
59
|
+
FROM sqlite_master
|
60
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
61
|
+
[1m[36mSQL (0.3ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
62
|
+
Migrating to AddTestTables (20120523110000)
|
63
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
64
|
+
FROM sqlite_master
|
65
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
66
|
+
[0m
|
67
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
68
|
+
FROM sqlite_master
|
69
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
70
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
71
|
+
Migrating to AddTestTables (20120523110000)
|
72
|
+
[1m[36mSQL (1.0ms)[0m [1m SELECT name
|
73
|
+
FROM sqlite_master
|
74
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
75
|
+
[0m
|
76
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
77
|
+
FROM sqlite_master
|
78
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
79
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
80
|
+
Migrating to AddTestTables (20120523110000)
|
81
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
82
|
+
FROM sqlite_master
|
83
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
84
|
+
[0m
|
85
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
86
|
+
FROM sqlite_master
|
87
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
88
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
89
|
+
Migrating to AddTestTables (20120523110000)
|
90
|
+
[1m[36mSQL (1.3ms)[0m [1m SELECT name
|
91
|
+
FROM sqlite_master
|
92
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
93
|
+
[0m
|
94
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
95
|
+
FROM sqlite_master
|
96
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
97
|
+
[1m[36mSQL (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
98
|
+
Migrating to AddTestTables (20120523110000)
|
99
|
+
[1m[36mSQL (1.2ms)[0m [1m SELECT name
|
100
|
+
FROM sqlite_master
|
101
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
102
|
+
[0m
|
103
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
104
|
+
FROM sqlite_master
|
105
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
106
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
107
|
+
Migrating to AddTestTables (20120523110000)
|
108
|
+
[1m[36mSQL (1.2ms)[0m [1m SELECT name
|
109
|
+
FROM sqlite_master
|
110
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
111
|
+
[0m
|
112
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
113
|
+
FROM sqlite_master
|
114
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
115
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
116
|
+
Migrating to AddTestTables (20120523110000)
|
117
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
118
|
+
FROM sqlite_master
|
119
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
120
|
+
[0m
|
121
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
122
|
+
FROM sqlite_master
|
123
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
124
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
125
|
+
Migrating to AddTestTables (20120523110000)
|
126
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
127
|
+
FROM sqlite_master
|
128
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
129
|
+
[0m
|
130
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
131
|
+
FROM sqlite_master
|
132
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
133
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
134
|
+
Migrating to AddTestTables (20120523110000)
|
135
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
136
|
+
FROM sqlite_master
|
137
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
138
|
+
[0m
|
139
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
140
|
+
FROM sqlite_master
|
141
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
142
|
+
[1m[36mSQL (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
143
|
+
Migrating to AddTestTables (20120523110000)
|
144
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
145
|
+
FROM sqlite_master
|
146
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
147
|
+
[0m
|
148
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
149
|
+
FROM sqlite_master
|
150
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
151
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
152
|
+
Migrating to AddTestTables (20120523110000)
|
153
|
+
[1m[36mSQL (1.2ms)[0m [1m SELECT name
|
154
|
+
FROM sqlite_master
|
155
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
156
|
+
[0m
|
157
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
158
|
+
FROM sqlite_master
|
159
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
160
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
161
|
+
Migrating to AddTestTables (20120523110000)
|
162
|
+
[1m[36mSQL (1.2ms)[0m [1m SELECT name
|
163
|
+
FROM sqlite_master
|
164
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
165
|
+
[0m
|
166
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
167
|
+
FROM sqlite_master
|
168
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
169
|
+
[1m[36mSQL (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
170
|
+
Migrating to AddTestTables (20120523110000)
|
171
|
+
[1m[36mSQL (1.3ms)[0m [1m SELECT name
|
172
|
+
FROM sqlite_master
|
173
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
174
|
+
[0m
|
175
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
176
|
+
FROM sqlite_master
|
177
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
178
|
+
[1m[36mSQL (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
179
|
+
Migrating to AddTestTables (20120523110000)
|
180
|
+
[1m[36mSQL (1.2ms)[0m [1m SELECT name
|
181
|
+
FROM sqlite_master
|
182
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
183
|
+
[0m
|
184
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
185
|
+
FROM sqlite_master
|
186
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
187
|
+
[1m[36mSQL (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
188
|
+
Migrating to AddTestTables (20120523110000)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,66 @@
|
|
1
|
+
document.observe('dom:loaded', function()
|
2
|
+
{
|
3
|
+
create_status_window();
|
4
|
+
|
5
|
+
function create_status_window() {
|
6
|
+
new Insertion.Bottom(
|
7
|
+
document.body,
|
8
|
+
"<div id='acts_as_monitor_status_window'></div>"
|
9
|
+
);
|
10
|
+
var status_window = $('acts_as_monitor_status_window');
|
11
|
+
Position.absolutize(status_window);
|
12
|
+
status_window.observe('click', function(ev) {status_window.fade(); });
|
13
|
+
status_window.hide();
|
14
|
+
}
|
15
|
+
|
16
|
+
var handle_monitor = function(ev)
|
17
|
+
{
|
18
|
+
var id = ev.target.getAttribute('data-id');
|
19
|
+
new Ajax.Request('/acts_as_monitor/monitors/'+ id +'.js',
|
20
|
+
{
|
21
|
+
method: 'get',
|
22
|
+
evalJSON: 'force',
|
23
|
+
parameters: {
|
24
|
+
class_name: ev.target.getAttribute('data-class')
|
25
|
+
//id: ev.target.getAttribute('data-id')
|
26
|
+
},
|
27
|
+
onSuccess: function(response)
|
28
|
+
{
|
29
|
+
var rsp = response.responseJSON;
|
30
|
+
create_popup(rsp.text,ev.target);
|
31
|
+
},
|
32
|
+
onFailure: function(response)
|
33
|
+
{
|
34
|
+
alert('Failure ' + response.status);
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
|
39
|
+
//Create popup with information
|
40
|
+
function create_popup(text,target)
|
41
|
+
{
|
42
|
+
//alert(text);
|
43
|
+
var status_window = $('acts_as_monitor_status_window');
|
44
|
+
status_window.update(text);
|
45
|
+
Position.clone(target,status_window);
|
46
|
+
new Effect.Appear(status_window);
|
47
|
+
//alert("Fatto");
|
48
|
+
}
|
49
|
+
|
50
|
+
//$$('.acts_as_monitor_icon_red .acts_as_monitor_icon_yellow .acts_as_monitor_icon_green')
|
51
|
+
var pulsate_forever = function(elem) {
|
52
|
+
new Effect.Pulsate(elem, {
|
53
|
+
//afterFinish: function(o) { new Effect.Pulsate(o.element, o.options); }
|
54
|
+
});
|
55
|
+
}
|
56
|
+
$$('.acts_as_monitor_icon_red').each(function(elmt)
|
57
|
+
{
|
58
|
+
elmt.observe('click', handle_monitor);
|
59
|
+
pulsate_forever(elmt);
|
60
|
+
});
|
61
|
+
|
62
|
+
$$('.acts_as_monitor_icon_yellow').each(function(elmt)
|
63
|
+
{
|
64
|
+
elmt.observe('click', handle_monitor);
|
65
|
+
});
|
66
|
+
});
|
@@ -0,0 +1,136 @@
|
|
1
|
+
// script.aculo.us builder.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
2
|
+
|
3
|
+
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
4
|
+
//
|
5
|
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
6
|
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
7
|
+
|
8
|
+
var Builder = {
|
9
|
+
NODEMAP: {
|
10
|
+
AREA: 'map',
|
11
|
+
CAPTION: 'table',
|
12
|
+
COL: 'table',
|
13
|
+
COLGROUP: 'table',
|
14
|
+
LEGEND: 'fieldset',
|
15
|
+
OPTGROUP: 'select',
|
16
|
+
OPTION: 'select',
|
17
|
+
PARAM: 'object',
|
18
|
+
TBODY: 'table',
|
19
|
+
TD: 'table',
|
20
|
+
TFOOT: 'table',
|
21
|
+
TH: 'table',
|
22
|
+
THEAD: 'table',
|
23
|
+
TR: 'table'
|
24
|
+
},
|
25
|
+
// note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
|
26
|
+
// due to a Firefox bug
|
27
|
+
node: function(elementName) {
|
28
|
+
elementName = elementName.toUpperCase();
|
29
|
+
|
30
|
+
// try innerHTML approach
|
31
|
+
var parentTag = this.NODEMAP[elementName] || 'div';
|
32
|
+
var parentElement = document.createElement(parentTag);
|
33
|
+
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
34
|
+
parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
|
35
|
+
} catch(e) {}
|
36
|
+
var element = parentElement.firstChild || null;
|
37
|
+
|
38
|
+
// see if browser added wrapping tags
|
39
|
+
if(element && (element.tagName.toUpperCase() != elementName))
|
40
|
+
element = element.getElementsByTagName(elementName)[0];
|
41
|
+
|
42
|
+
// fallback to createElement approach
|
43
|
+
if(!element) element = document.createElement(elementName);
|
44
|
+
|
45
|
+
// abort if nothing could be created
|
46
|
+
if(!element) return;
|
47
|
+
|
48
|
+
// attributes (or text)
|
49
|
+
if(arguments[1])
|
50
|
+
if(this._isStringOrNumber(arguments[1]) ||
|
51
|
+
(arguments[1] instanceof Array) ||
|
52
|
+
arguments[1].tagName) {
|
53
|
+
this._children(element, arguments[1]);
|
54
|
+
} else {
|
55
|
+
var attrs = this._attributes(arguments[1]);
|
56
|
+
if(attrs.length) {
|
57
|
+
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
58
|
+
parentElement.innerHTML = "<" +elementName + " " +
|
59
|
+
attrs + "></" + elementName + ">";
|
60
|
+
} catch(e) {}
|
61
|
+
element = parentElement.firstChild || null;
|
62
|
+
// workaround firefox 1.0.X bug
|
63
|
+
if(!element) {
|
64
|
+
element = document.createElement(elementName);
|
65
|
+
for(attr in arguments[1])
|
66
|
+
element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
|
67
|
+
}
|
68
|
+
if(element.tagName.toUpperCase() != elementName)
|
69
|
+
element = parentElement.getElementsByTagName(elementName)[0];
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
// text, or array of children
|
74
|
+
if(arguments[2])
|
75
|
+
this._children(element, arguments[2]);
|
76
|
+
|
77
|
+
return $(element);
|
78
|
+
},
|
79
|
+
_text: function(text) {
|
80
|
+
return document.createTextNode(text);
|
81
|
+
},
|
82
|
+
|
83
|
+
ATTR_MAP: {
|
84
|
+
'className': 'class',
|
85
|
+
'htmlFor': 'for'
|
86
|
+
},
|
87
|
+
|
88
|
+
_attributes: function(attributes) {
|
89
|
+
var attrs = [];
|
90
|
+
for(attribute in attributes)
|
91
|
+
attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
|
92
|
+
'="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"');
|
93
|
+
return attrs.join(" ");
|
94
|
+
},
|
95
|
+
_children: function(element, children) {
|
96
|
+
if(children.tagName) {
|
97
|
+
element.appendChild(children);
|
98
|
+
return;
|
99
|
+
}
|
100
|
+
if(typeof children=='object') { // array can hold nodes and text
|
101
|
+
children.flatten().each( function(e) {
|
102
|
+
if(typeof e=='object')
|
103
|
+
element.appendChild(e);
|
104
|
+
else
|
105
|
+
if(Builder._isStringOrNumber(e))
|
106
|
+
element.appendChild(Builder._text(e));
|
107
|
+
});
|
108
|
+
} else
|
109
|
+
if(Builder._isStringOrNumber(children))
|
110
|
+
element.appendChild(Builder._text(children));
|
111
|
+
},
|
112
|
+
_isStringOrNumber: function(param) {
|
113
|
+
return(typeof param=='string' || typeof param=='number');
|
114
|
+
},
|
115
|
+
build: function(html) {
|
116
|
+
var element = this.node('div');
|
117
|
+
$(element).update(html.strip());
|
118
|
+
return element.down();
|
119
|
+
},
|
120
|
+
dump: function(scope) {
|
121
|
+
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
|
122
|
+
|
123
|
+
var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
|
124
|
+
"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
|
125
|
+
"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
|
126
|
+
"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
|
127
|
+
"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
|
128
|
+
"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
|
129
|
+
|
130
|
+
tags.each( function(tag){
|
131
|
+
scope[tag] = function() {
|
132
|
+
return Builder.node.apply(Builder, [tag].concat($A(arguments)));
|
133
|
+
};
|
134
|
+
});
|
135
|
+
}
|
136
|
+
};
|