merb-ui 0.1.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ AUTHOR = 'uipoet'
8
8
  EMAIL = 'dont.tase@me.com'
9
9
  HOMEPAGE = 'http://uipoet.com/projects'
10
10
  SUMMARY = 'User Interface Components for Merb'
11
- GEM_VERSION = '0.1.1'
11
+ GEM_VERSION = '0.2'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.rubyforge_project = AUTHOR
@@ -15,12 +15,30 @@ b, em, h1, label, strong {
15
15
  font-family: "Lucida Grande", "Lucida Sans", "Lucida Sans Unicode", sans-serif;
16
16
  font-weight: bold;
17
17
  }
18
+ code {
19
+ background-color: <%= color(0.1, 0.1, 0.1) %>;
20
+ color: <%= color(1, 1, 1) %>;
21
+ display: block;
22
+ font-family: "Bitstream Vera Sans Mono", "Monaco", "Andale Mono", "Courier New", "Courier", fixed;
23
+ font-size: 0.85em;
24
+ overflow: auto;
25
+ padding: 1em;
26
+ white-space: nowrap;
27
+ }
28
+ kbd {
29
+ background-color: <%= color(0.9, 0.9, 0.9) %>;
30
+ border-color: <%= color(0.8, 0.8, 0.8) %>;
31
+ border-style: solid;
32
+ border-width: 1px;
33
+ padding: 0 0.5em 0.2em 0.5em;
34
+ <%= border_radius %>
35
+ }
18
36
 
19
37
  /* bar */
20
38
 
21
39
  div.mui_bar {
22
40
  background-color: <%= color(0.1, 0.1, 0.1) %>;
23
- background-image: url('/slices/merb-ui/images/reflection.png');
41
+ background-image: url('<%= image_path('reflection.png') %>');
24
42
  background-position: center center;
25
43
  background-repeat: repeat-x;
26
44
  border-collapse: collapse;
@@ -38,7 +56,7 @@ span.mui_block {
38
56
  vertical-align: top;
39
57
  }
40
58
  div.mui_block_status {
41
- background-image: url('/slices/merb-ui/images/transparency.png');
59
+ background-image: url('<%= image_path('transparency.png') %>');
42
60
  border-color: <%= color(0, 0, 0) %>;
43
61
  border-style: solid;
44
62
  border-width: 1px;
@@ -71,7 +89,7 @@ div.mui_block_tray *.mui_block {
71
89
  /* button */
72
90
 
73
91
  *.mui_button {
74
- background-image: url('/slices/merb-ui/images/reflection.png');
92
+ background-image: url('<%= image_path('reflection.png') %>');
75
93
  background-position: center center;
76
94
  background-repeat: repeat-x;
77
95
  border-style: solid;
@@ -291,11 +309,6 @@ img.mui_image_border {
291
309
  border-width: 1px;
292
310
  }
293
311
 
294
- /* key */
295
-
296
- kbd.mui_key {
297
- }
298
-
299
312
  /* link */
300
313
 
301
314
  a.mui_link {
@@ -338,7 +351,7 @@ select.mui_menu {
338
351
  /* message */
339
352
 
340
353
  div.mui_message {
341
- background-image: url('/slices/merb-ui/images/transparency.png');
354
+ background-image: url('<%= image_path('transparency.png') %>');
342
355
  border-style: solid;
343
356
  border-bottom-width: 1px;
344
357
  border-left-width: 1px;
@@ -389,7 +402,7 @@ blockquote.mui_quote {
389
402
 
390
403
  a.mui_tab {
391
404
  background-color: <%= color(0.1, 0.1, 0.1) %>;
392
- background-image: url('/slices/merb-ui/images/reflection.png');
405
+ background-image: url('<%= image_path('reflection.png') %>');
393
406
  background-position: center center;
394
407
  background-repeat: repeat-x;
395
408
  border-bottom: none;
@@ -438,23 +451,21 @@ table.mui_window {
438
451
  }
439
452
  table.mui_window_bar {
440
453
  background-color: <%= color(0.1, 0.1, 0.1) %>;
441
- background-image: url('/slices/merb-ui/images/reflection.png');
454
+ background-image: url('<%= image_path('reflection.png') %>');
442
455
  background-position: center center;
443
456
  background-repeat: repeat-x;
444
457
  color: <%= color(1, 1, 1) %>;
445
458
  height: 2em;
459
+ padding-left: 0.75em;
460
+ padding-right: 0.75em;
446
461
  width: 100%;
447
462
  <%= border_radius(:edge => 'top') %>
448
463
  }
449
464
  td.mui_window_bar_end {
450
- padding-right: 0.75em;
451
465
  text-align: right;
452
466
  }
453
- td.mui_window_title {
454
- padding-left: 0.75em;
455
- }
456
467
  td.mui_window_content {
457
- background-image: url('/slices/merb-ui/images/transparency.png');
468
+ background-image: url('<%= image_path('transparency.png') %>');
458
469
  color: <%= color(1, 1, 1) %>;
459
470
  padding: 0.5em;
460
471
  <%= border_radius(:edge => 'bottom') %>
@@ -1,3 +1,6 @@
1
+ // Set the status of the window. 0 == closed, 1 == opened
2
+ var windowStatus = 0;
3
+
1
4
  // Position message at top center.
2
5
  function messagePosition(){
3
6
  var browserWidth = $(window).width();
@@ -7,41 +10,42 @@ function messagePosition(){
7
10
 
8
11
  // Close window.
9
12
  function windowClose(url){
10
- var target = $('.mui_window_target');
11
- target.fadeOut(function(){
12
- target.empty;
13
- $('.mui_focus:first').focus();
13
+ $('.mui_window_target').fadeOut(function(){
14
+ windowStatus = 0;
14
15
  });
15
16
  }
16
17
 
17
18
  // Open window and give the first input with class of mui_focus focus, if one exists.
18
19
  function windowOpen(url){
19
- var target = $('.mui_window_target');
20
- target.fadeOut(function(){
21
- target.load(url, function(){
22
- target.fadeIn();
23
- $('.mui_focus:first').focus();
24
- });
20
+ var target = $('.mui_window_target')
21
+ target.load(url, function(){
22
+ if(windowStatus == 0){
23
+ target.fadeIn();
24
+ }
25
+ $('.mui_focus:first').focus();
26
+ windowStatus = 1;
25
27
  });
26
28
  }
27
29
 
28
30
  // Position window at middle center.
29
31
  function windowPosition(){
30
- var browserWidth = $(window).width();
31
- var browserHeight = $(window).height();
32
- var windowWidth = $('.mui_window_target').width();
33
- var windowHeight = $('.mui_window_target').height();
34
- if (windowWidth > browserWidth){
35
- $('.mui_window_target').css({position:'absolute', left:'1em'});
36
- }
37
- else{
38
- $('.mui_window_target').css({position:'fixed', left:(browserWidth/2)+(windowWidth/2)*(-1)});
39
- }
40
- if (windowHeight > browserHeight){
41
- $('.mui_window_target').css({position:'absolute', top:'1em'});
42
- }
43
- else{
44
- $('.mui_window_target').css({position:'fixed', top:(browserHeight/2)+(windowHeight/2)*(-1)});
32
+ if(windowStatus == 0){
33
+ var browserWidth = $(window).width();
34
+ var browserHeight = $(window).height();
35
+ var windowWidth = $('.mui_window_target').width();
36
+ var windowHeight = $('.mui_window_target').height();
37
+ if (windowWidth > browserWidth){
38
+ $('.mui_window_target').css({position:'absolute', left:'1em'});
39
+ }
40
+ else{
41
+ $('.mui_window_target').css({position:'fixed', left:(browserWidth/2)+(windowWidth/2)*(-1)});
42
+ }
43
+ if (windowHeight > browserHeight){
44
+ $('.mui_window_target').css({position:'absolute', top:'1em'});
45
+ }
46
+ else{
47
+ $('.mui_window_target').css({position:'fixed', top:(browserHeight/2)+(windowHeight/2)*(-1)});
48
+ }
45
49
  }
46
50
  }
47
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: "0.2"
5
5
  platform: ruby
6
6
  authors:
7
7
  - uipoet
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-26 00:00:00 -08:00
12
+ date: 2008-11-29 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency