interpret 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/README.md +488 -0
  2. data/app/controllers/interpret/search_controller.rb +3 -1
  3. data/app/controllers/interpret/tools_controller.rb +2 -1
  4. data/app/controllers/interpret/translations_controller.rb +16 -7
  5. data/app/models/interpret/expiration_observer.rb +29 -0
  6. data/app/models/interpret/translation.rb +9 -20
  7. data/app/views/interpret/tools/index.html.erb +16 -23
  8. data/app/views/interpret/translations/_listing.html.erb +1 -1
  9. data/app/views/interpret/translations/live_edit.html.erb +11 -0
  10. data/app/views/layouts/interpret.html.erb +6 -1
  11. data/app/views/layouts/interpret_base.html.erb +1 -1
  12. data/config/routes.rb +4 -0
  13. data/interpret.gemspec +0 -1
  14. data/lib/generators/interpret/setup_generator.rb +2 -1
  15. data/lib/interpret/controller_filter.rb +22 -0
  16. data/lib/interpret/engine.rb +17 -6
  17. data/lib/interpret/helpers.rb +39 -0
  18. data/lib/interpret/version.rb +1 -1
  19. data/lib/interpret.rb +4 -1
  20. data/lib/tasks/interpret.rake +4 -2
  21. data/public/javascripts/facebox-1.3/closelabel.png +0 -0
  22. data/public/javascripts/facebox-1.3/facebox.css +80 -0
  23. data/public/javascripts/facebox-1.3/facebox.js +309 -0
  24. data/public/javascripts/facebox-1.3/loading.gif +0 -0
  25. data/public/stylesheets/interpret_live_edit_style.css +38 -0
  26. data/public/stylesheets/interpret_style.css +18 -0
  27. data/spec/models/translation_spec.rb +33 -22
  28. data/spec/observers/expiration_observer_spec.rb +17 -0
  29. data/spec/spec_helper.rb +0 -1
  30. data/test_app/Gemfile +4 -2
  31. data/test_app/app/controllers/application_controller.rb +17 -1
  32. data/test_app/app/controllers/pages_controller.rb +0 -1
  33. data/test_app/app/models/my_sweeper.rb +5 -0
  34. data/test_app/app/views/layouts/application.html.erb +115 -5
  35. data/test_app/app/views/layouts/backoffice.html.erb +27 -0
  36. data/test_app/app/views/pages/archives.html.erb +3 -0
  37. data/test_app/app/views/pages/contact.html.erb +3 -0
  38. data/test_app/app/views/pages/index.html.erb +56 -0
  39. data/test_app/app/views/pages/links.html.erb +10 -0
  40. data/test_app/app/views/pages/resources.html.erb +5 -0
  41. data/test_app/config/application.rb +2 -2
  42. data/test_app/config/environments/production.rb +0 -5
  43. data/test_app/config/initializers/interpret.rb +3 -3
  44. data/test_app/config/locales/en.yml +55 -0
  45. data/test_app/config/locales/es.yml +3 -47
  46. data/test_app/config/routes.rb +8 -1
  47. data/test_app/public/images/a1.gif +0 -0
  48. data/test_app/public/images/a10.jpg +0 -0
  49. data/test_app/public/images/a16.gif +0 -0
  50. data/test_app/public/images/a18.gif +0 -0
  51. data/test_app/public/images/a22.gif +0 -0
  52. data/test_app/public/images/a26.gif +0 -0
  53. data/test_app/public/images/a33.gif +0 -0
  54. data/test_app/public/images/a36.gif +0 -0
  55. data/test_app/public/images/a38.gif +0 -0
  56. data/test_app/public/images/a41.gif +0 -0
  57. data/test_app/public/images/a47.gif +0 -0
  58. data/test_app/public/images/a50.gif +0 -0
  59. data/test_app/public/images/a8.gif +0 -0
  60. data/test_app/public/images/abg.gif +0 -0
  61. data/test_app/public/images/pic1.jpg +0 -0
  62. data/test_app/public/images/pic2.jpg +0 -0
  63. data/test_app/public/images/spacer.gif +0 -0
  64. data/test_app/public/images/upbg.gif +0 -0
  65. data/test_app/public/javascripts/facebox-1.3/closelabel.png +0 -0
  66. data/test_app/public/javascripts/facebox-1.3/facebox.css +80 -0
  67. data/test_app/public/javascripts/facebox-1.3/facebox.js +309 -0
  68. data/test_app/public/javascripts/facebox-1.3/loading.gif +0 -0
  69. data/test_app/public/stylesheets/default.css +361 -0
  70. data/test_app/public/stylesheets/interpret_live_edit_style.css +38 -0
  71. data/test_app/public/stylesheets/interpret_style.css +18 -0
  72. data/test_app/public/stylesheets/private.css +0 -0
  73. metadata +96 -29
  74. data/app/sweepers/interpret/base_sweeper.rb +0 -18
  75. data/app/sweepers/interpret/translation_sweeper.rb +0 -11
  76. data/public/javascripts/jquery.purr.js +0 -180
  77. data/test_app/app/sweepers/page_sweeper.rb +0 -12
  78. data/test_app/app/views/pages/contact.html.haml +0 -8
  79. data/test_app/app/views/pages/index.html.haml +0 -10
  80. data/test_app/config/locales/ca.yml +0 -6
  81. data/test_app/public/javascripts/jquery.purr.js +0 -180
@@ -1,180 +0,0 @@
1
- /**
2
- * jquery.purr.js
3
- * Copyright (c) 2008 Net Perspective (net-perspective.com)
4
- * Licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)
5
- *
6
- * @author R.A. Ray
7
- * @projectDescription jQuery plugin for dynamically displaying unobtrusive messages in the browser. Mimics the behavior of the MacOS program "Growl."
8
- * @version 0.1.0
9
- *
10
- * @requires jquery.js (tested with 1.2.6)
11
- *
12
- * @param fadeInSpeed int - Duration of fade in animation in miliseconds
13
- * default: 500
14
- * @param fadeOutSpeed int - Duration of fade out animationin miliseconds
15
- default: 500
16
- * @param removeTimer int - Timeout, in miliseconds, before notice is removed once it is the top non-sticky notice in the list
17
- default: 4000
18
- * @param isSticky bool - Whether the notice should fade out on its own or wait to be manually closed
19
- default: false
20
- * @param usingTransparentPNG bool - Whether or not the notice is using transparent .png images in its styling
21
- default: false
22
- */
23
-
24
- ( function( $ ) {
25
-
26
- $.purr = function ( notice, options )
27
- {
28
- // Convert notice to a jQuery object
29
- notice = $( notice );
30
-
31
- // Add a class to denote the notice as not sticky
32
- if ( !options.isSticky )
33
- {
34
- notice.addClass( 'not-sticky' );
35
- };
36
-
37
- // Get the container element from the page
38
- var cont = document.getElementById( 'purr-container' );
39
-
40
- // If the container doesn't yet exist, we need to create it
41
- if ( !cont )
42
- {
43
- cont = '<div id="purr-container"></div>';
44
- }
45
-
46
- // Convert cont to a jQuery object
47
- cont = $( cont );
48
-
49
- // Add the container to the page
50
- $( 'body' ).append( cont );
51
-
52
- notify();
53
-
54
- function notify ()
55
- {
56
- // Set up the close button
57
- var close = document.createElement( 'a' );
58
- $( close ).attr(
59
- {
60
- className: 'close',
61
- href: '#close',
62
- innerHTML: 'Close'
63
- }
64
- )
65
- .appendTo( notice )
66
- .click( function ()
67
- {
68
- removeNotice();
69
-
70
- return false;
71
- }
72
- );
73
-
74
- // Add the notice to the page and keep it hidden initially
75
- notice.appendTo( cont )
76
- .hide();
77
-
78
- if ( jQuery.browser.msie && options.usingTransparentPNG )
79
- {
80
- // IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
81
- // notice style, we'll just skip the fading in.
82
- notice.show();
83
- }
84
- else
85
- {
86
- //Fade in the notice we just added
87
- notice.fadeIn( options.fadeInSpeed );
88
- }
89
-
90
- // Set up the removal interval for the added notice if that notice is not a sticky
91
- if ( !options.isSticky )
92
- {
93
- var topSpotInt = setInterval( function ()
94
- {
95
- // Check to see if our notice is the first non-sticky notice in the list
96
- if ( notice.prevAll( '.not-sticky' ).length == 0 )
97
- {
98
- // Stop checking once the condition is met
99
- clearInterval( topSpotInt );
100
-
101
- // Call the close action after the timeout set in options
102
- setTimeout( function ()
103
- {
104
- removeNotice();
105
- }, options.removeTimer
106
- );
107
- }
108
- }, 200 );
109
- }
110
- }
111
-
112
- function removeNotice ()
113
- {
114
- // IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
115
- // notice style, we'll just skip the fading out.
116
- if ( jQuery.browser.msie && options.usingTransparentPNG )
117
- {
118
- notice.css( { opacity: 0 } )
119
- .animate(
120
- {
121
- height: '0px'
122
- },
123
- {
124
- duration: options.fadeOutSpeed,
125
- complete: function ()
126
- {
127
- notice.remove();
128
- }
129
- }
130
- );
131
- }
132
- else
133
- {
134
- // Fade the object out before reducing its height to produce the sliding effect
135
- notice.animate(
136
- {
137
- opacity: '0'
138
- },
139
- {
140
- duration: options.fadeOutSpeed,
141
- complete: function ()
142
- {
143
- notice.animate(
144
- {
145
- height: '0px'
146
- },
147
- {
148
- duration: options.fadeOutSpeed,
149
- complete: function ()
150
- {
151
- notice.remove();
152
- }
153
- }
154
- );
155
- }
156
- }
157
- );
158
- }
159
- };
160
- };
161
-
162
- $.fn.purr = function ( options )
163
- {
164
- options = options || {};
165
- options.fadeInSpeed = options.fadeInSpeed || 500;
166
- options.fadeOutSpeed = options.fadeOutSpeed || 500;
167
- options.removeTimer = options.removeTimer || 4000;
168
- options.isSticky = options.isSticky || false;
169
- options.usingTransparentPNG = options.usingTransparentPNG || false;
170
-
171
- this.each( function()
172
- {
173
- new $.purr( this, options );
174
- }
175
- );
176
-
177
- return this;
178
- };
179
- })( jQuery );
180
-