ymdp 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/.gitignore +2 -0
  2. data/Gemfile +8 -1
  3. data/History.txt +13 -2
  4. data/Rakefile +7 -0
  5. data/VERSION +1 -1
  6. data/features/data/app/assets/yrb/en-US/keys_en-US.pres +1 -0
  7. data/features/data/app/javascripts/application.js +7 -0
  8. data/features/data/app/stylesheets/application.css +3 -0
  9. data/features/data/app/views/layouts/application.html.haml +25 -0
  10. data/features/data/app/views/page.html.haml +2 -0
  11. data/{spec → features}/data/config/config.yml +5 -6
  12. data/features/data/config/content.yml +2 -0
  13. data/features/data/config/jslint.js +1 -0
  14. data/features/data/config/servers.yml +10 -0
  15. data/features/step_definitions/ymdp_steps.rb +54 -0
  16. data/features/support/env.rb +40 -0
  17. data/features/ymdp.feature +61 -0
  18. data/lib/ymdp.rb +7 -12
  19. data/lib/ymdp/base.rb +16 -65
  20. data/lib/ymdp/commands/generate.rb +2 -4
  21. data/lib/ymdp/compiler/base.rb +10 -8
  22. data/lib/ymdp/compiler/domains.rb +2 -1
  23. data/lib/ymdp/compiler/template.rb +29 -18
  24. data/lib/ymdp/{processor → compressor}/compressor.rb +6 -1
  25. data/{spec/data/script → lib/ymdp/compressor}/yuicompressor-2.4.2.jar +0 -0
  26. data/lib/ymdp/configuration/config.rb +3 -4
  27. data/lib/ymdp/configuration/constants.rb +22 -19
  28. data/lib/ymdp/tasks/ymdp.rake +0 -2
  29. data/{spec/data/script → lib/ymdp/validator}/jslint.js +0 -0
  30. data/lib/ymdp/{processor → validator}/validator.rb +30 -38
  31. data/lib/ymdp/{application.rb → view/application.rb} +0 -0
  32. data/lib/ymdp/{application_view.rb → view/application_view.rb} +4 -4
  33. data/lib/ymdp/{asset_tag_helper.rb → view/asset_tag_helper.rb} +0 -0
  34. data/lib/ymdp/{tag_helper.rb → view/tag_helper.rb} +0 -0
  35. data/spec/application_spec.rb +2 -0
  36. data/spec/application_view_spec.rb +6 -6
  37. data/spec/compiler_template_spec.rb +4 -4
  38. data/spec/compressor_spec.rb +11 -7
  39. data/spec/configuration_spec.rb +3 -0
  40. data/spec/default_settings.rb +1 -1
  41. data/spec/domains_spec.rb +1 -1
  42. data/spec/spec_helper.rb +1 -0
  43. data/spec/stubs.rb +4 -1
  44. data/spec/validator_spec.rb +45 -40
  45. data/spec/ymdp_base_spec.rb +10 -7
  46. data/ymdp.gemspec +25 -76
  47. metadata +32 -76
  48. data/lib/ymdp/processor/form_post.rb +0 -62
  49. data/lib/ymdp/processor/w3c.rb +0 -24
  50. data/spec/data/Rakefile +0 -3
  51. data/spec/data/VERSION +0 -1
  52. data/spec/data/app/.gitignore +0 -1
  53. data/spec/data/app/assets/images/lightbox/lightbox_bg.png +0 -0
  54. data/spec/data/app/assets/javascripts/OpenMailIntl.js +0 -291
  55. data/spec/data/app/assets/javascripts/controls.js +0 -965
  56. data/spec/data/app/assets/javascripts/date.js +0 -104
  57. data/spec/data/app/assets/javascripts/dragdrop.js +0 -974
  58. data/spec/data/app/assets/javascripts/effects.js +0 -1123
  59. data/spec/data/app/assets/javascripts/lowpro.js +0 -320
  60. data/spec/data/app/assets/javascripts/prototype.js +0 -4874
  61. data/spec/data/app/assets/javascripts/scriptaculous.js +0 -68
  62. data/spec/data/app/assets/yrb/en-US/application_en-US.pres +0 -7
  63. data/spec/data/app/helpers/application_helper.rb +0 -3
  64. data/spec/data/app/javascripts/application.js +0 -580
  65. data/spec/data/app/javascripts/debug.js +0 -138
  66. data/spec/data/app/javascripts/flash.js +0 -96
  67. data/spec/data/app/javascripts/header.js +0 -13
  68. data/spec/data/app/javascripts/help.js +0 -76
  69. data/spec/data/app/javascripts/i18n.js +0 -235
  70. data/spec/data/app/javascripts/launcher.js +0 -159
  71. data/spec/data/app/javascripts/logger.js +0 -61
  72. data/spec/data/app/javascripts/tag_helper.js +0 -178
  73. data/spec/data/app/stylesheets/application.css +0 -0
  74. data/spec/data/app/stylesheets/ie.css +0 -0
  75. data/spec/data/app/stylesheets/ie6.css +0 -0
  76. data/spec/data/app/stylesheets/ie7.css +0 -0
  77. data/spec/data/app/stylesheets/ie8.css +0 -0
  78. data/spec/data/app/stylesheets/lightbox.css +0 -30
  79. data/spec/data/app/stylesheets/non_ie.css +0 -0
  80. data/spec/data/app/views/layouts/application.html.haml +0 -37
  81. data/spec/data/app/views/page.html.haml +0 -1
  82. data/spec/data/app/views/shared/_error.html.haml +0 -8
  83. data/spec/data/app/views/shared/_flash.html.haml +0 -2
  84. data/spec/data/app/views/shared/_javascripts.html.haml +0 -22
  85. data/spec/data/app/views/shared/_loading.html.haml +0 -13
  86. data/spec/data/app/views/shared/_stylesheets.html.haml +0 -23
  87. data/spec/data/config/categories.yml +0 -6
  88. data/spec/data/config/config.yml.example +0 -30
  89. data/spec/data/config/constants.rb +0 -52
  90. data/spec/data/config/content.yml +0 -2
  91. data/spec/data/config/servers.yml +0 -10
  92. data/spec/data/config/servers.yml.example +0 -10
  93. data/spec/data/lib/init.rb +0 -13
  94. data/spec/data/lib/tasks/environment.rake +0 -4
  95. data/spec/data/lib/tasks/keys.rake +0 -3
  96. data/spec/data/lib/tasks/setup.rake +0 -13
  97. data/spec/data/lib/tasks/ymdp.rake +0 -4
  98. data/spec/data/script/build +0 -9
  99. data/spec/data/script/config +0 -13
  100. data/spec/data/script/destroy +0 -18
  101. data/spec/data/script/generate +0 -4
  102. data/spec/data/script/gitrm +0 -17
  103. data/spec/data/script/growl +0 -6
  104. data/spec/data/script/images +0 -48
  105. data/spec/data/script/langs +0 -29
  106. data/spec/data/script/translate +0 -5
  107. data/spec/data/script/ymdt +0 -1895
  108. data/spec/data/script/ymdt.old +0 -1890
  109. data/test.rb +0 -46
@@ -1,138 +0,0 @@
1
- var Debug;
2
-
3
- Debug = {
4
- on: false,
5
- console: false,
6
- alerts: false,
7
- logs: false,
8
- ajaxErrors: false,
9
-
10
- consoleOn: function() {
11
- return (typeof window['console'] !== 'undefined' && this.console);
12
- },
13
-
14
- alertsOn: function() {
15
- return (Debug.on || Debug.logs);
16
- },
17
-
18
- logsOn: function() {
19
- return (Debug.on || Debug.logs);
20
- },
21
-
22
- ajaxErrorsOn: function() {
23
- return (Debug.on || Debug.ajaxErrors);
24
- },
25
-
26
- profile: function(name) {
27
- if (this.consoleOn()) {
28
- console.profile(name);
29
- }
30
- },
31
-
32
- profileEnd: function(name) {
33
- if (this.consoleOn()) {
34
- console.profileEnd(name);
35
- }
36
- },
37
-
38
- call: function(level, message, obj) {
39
- try {
40
- message = this.message(message, obj);
41
-
42
- if (Debug.consoleOn()) {
43
- console[level](message);
44
- }
45
- if (Debug.logsOn()) {
46
- alert(message);
47
- }
48
- } catch(e) {
49
- if (Debug.consoleOn()) {
50
- console[level](e);
51
- } else {
52
- alert(e);
53
- }
54
- }
55
- },
56
-
57
- log: function(message, obj) {
58
- this.call("log", message, obj);
59
- },
60
-
61
- error: function(message, obj) {
62
- this.call("error", message, obj);
63
- },
64
-
65
- info: function(message, obj) {
66
- this.call("info", message, obj);
67
- },
68
-
69
- warn: function(message, obj) {
70
- this.call("warn", message, obj);
71
- },
72
-
73
- alert: this.log,
74
-
75
- ajaxError: function(message, path, params, response) {
76
- var m;
77
- m = message + " path: " + path + "?" + Object.toQueryString(params);
78
- m = m + ", response: " + Object.toJSON(response);
79
-
80
- try {
81
- $('error_details').update(m);
82
- } catch(err) {
83
- YAHOO.logger.error(err);
84
- }
85
-
86
- this.error(m);
87
-
88
- if (Debug.ajaxErrorsOn()) {
89
- alert(m);
90
- }
91
- if (Debug.logsOn()) {
92
- YAHOO.logger.error(m);
93
- }
94
- },
95
-
96
- message: function(message, obj) {
97
- try {
98
- message = this.timestamp() + " " + this.generalInfo() + " " + message;
99
- if (obj) {
100
- message = message + ", " + Object.toJSON(obj);
101
- }
102
- } catch(e) {
103
- // alert(e);
104
- }
105
- return message;
106
- },
107
-
108
- timestamp: function() {
109
- var time, year, month, date, hour, minute, second, timestamp, checktime;
110
-
111
- checktime = function checkTime(i) {
112
- if (i<10) {
113
- i="0" + i;
114
- }
115
- return i;
116
- };
117
-
118
- time = new Date();
119
- // year = time.getFullYear();
120
- // month = time.getMonth() + 1;
121
- // date = time.getDate();
122
- hour = checktime(time.getHours());
123
- minute = checktime(time.getMinutes());
124
- second = checktime(time.getSeconds());
125
-
126
- // timestamp = month + "/" + date + "/" + year + " " +
127
-
128
- timestamp = hour + ":" + minute + ":" + second;
129
-
130
- return timestamp;
131
- },
132
-
133
- generalInfo: function() {
134
- return "[<%= @domain %>/<%= @server %>] [<%= @version %> <%= @sprint_name %>]";
135
- }
136
- };
137
-
138
- Debug.console = true;
@@ -1,96 +0,0 @@
1
- var FLASH, Flash;
2
-
3
- /* set asset version */
4
-
5
- FLASH = {
6
- VERSION: "<%= @hash %>",
7
- MESSAGE: "<%= @message %>",
8
- DEPLOYED: <%= Time.now.to_i %>,
9
- DEPLOYED_STRING: "<%= Time.now.to_s %>"
10
- };
11
-
12
-
13
- /* FLASH MESSAGE HANDLERS */
14
-
15
- YAHOO.namespace("flash");
16
-
17
- Flash = {};
18
-
19
- Flash.timeout = 8;
20
- Flash.duration = 0.25;
21
-
22
- Flash.write = function(type, message) {
23
- type = type || "notice";
24
- if (message) {
25
- $('flash_message').update(message);
26
- Flash.setFlashClass('flash', type);
27
-
28
- // blindDown if the flash is currently hidden
29
- if ($('flash').getStyle("display") === "none") {
30
- $('flash').blindDown({queue: "end", duration: Flash.duration});
31
- }
32
- YAHOO.oib.setTimeoutInSeconds(Flash.close, Flash.timeout);
33
- }
34
- };
35
-
36
- Flash.close = function() {
37
- Try.these(function() {
38
- $('flash').blindUp({queue: "end", duration: Flash.duration});
39
- });
40
- };
41
-
42
- Flash.setFlashClass = function(flash_id, type) {
43
- if (type === "error") {
44
- Try.these(function() {
45
- $(flash_id).removeClassName('notice');
46
- });
47
- }
48
- if (type === "notice") {
49
- Try.these(function() {
50
- $(flash_id).removeClassName('error');
51
- });
52
- }
53
- Try.these(function() {
54
- $(flash_id).addClassName(type);
55
- });
56
- };
57
-
58
-
59
- Flash.error = function(message) {
60
- YAHOO.logger.error(message);
61
- Flash.write("error", message, true);
62
- };
63
-
64
- Flash.notice = function(message) {
65
- Flash.write("notice", message, true);
66
- };
67
-
68
- Flash.success = Flash.notice;
69
-
70
- Flash.t = {};
71
- Flash.t.notice = function(key, args) {
72
- var m;
73
-
74
- m = I18n.t(key, args);
75
- Flash.notice(m);
76
- };
77
- Flash.t.success = Flash.t.notice;
78
-
79
- Flash.t.error = function(key, args) {
80
- var m;
81
-
82
- m = I18n.t(key, args);
83
- Flash.error(m);
84
- };
85
-
86
-
87
- Flash.settingsChanged = function() {
88
- Flash.t.success("SETTINGS_CHANGED");
89
- };
90
- Flash.problemSubmitting = function() {
91
- Flash.t.error("PROBLEM_SUBMITTING");
92
- };
93
-
94
- YAHOO.flash = Flash;
95
-
96
- /* ----------------------- */
@@ -1,13 +0,0 @@
1
-
2
- /*
3
- LOCAL NAMESPACES/CONSTANTS
4
- */
5
-
6
- YAHOO.constants.base_url = "http://<%= @server %>.otherinbox.com/";
7
- YAHOO.constants.controller_url = "http://<%= @server %>.otherinbox.com/ymdp";
8
-
9
- YAHOO.oib.page_loaded = false;
10
-
11
- YAHOO.namespace("<%= @view %>");
12
-
13
- document.observe("dom:loaded", YAHOO.oib.init);
@@ -1,76 +0,0 @@
1
- // popup help text
2
- //
3
- var Help = function(content) {
4
- try {
5
- this.content = content;
6
-
7
- // instance method
8
- this.show = function(event) {
9
- var x = event.clientX + 20;
10
- var y = event.clientY - 10;
11
- this.create(x,y);
12
- };
13
-
14
- this.create = function(x, y) {
15
- try {
16
- if (!$(this.css_id)) {
17
- var popup = new Element('div', {
18
- "id": this.css_id,
19
- "class": "popup"
20
- });
21
- popup.update(this.content);
22
- popup.setStyle({
23
- "display": "none",
24
- "left": x + "px",
25
- "top": y + "px"
26
- });
27
- $$('body').first().insert(popup);
28
- setTimeout("$(\"" + this.css_id + "\").show();", 500);
29
- }
30
- } catch(e) {
31
- // alert(e);
32
- }
33
- };
34
-
35
- this.destroy = function() {
36
- setTimeout("$('" + this.css_id + "').remove();", 4000);
37
- };
38
-
39
- this.link = function(text) {
40
- text = text || "?";
41
- return Tags.linkToFunction(text, "", {
42
- "onmouseover": "Help.show(event, " + this.id + ");",
43
- "onmouseout": "Help.destroy(" + this.id + ")"
44
- });
45
- };
46
-
47
- Help.popups = Help.popups || [];
48
- Help.popups.push(this);
49
-
50
- this.id = Help.popups.size() - 1;
51
- this.css_id = "popup_" + this.id;
52
- } catch(e) {
53
- // alert(e);
54
- }
55
- };
56
-
57
- Help.show = function(event, id) {
58
- var help = Help.popups[id];
59
- help.show(event);
60
- };
61
-
62
- Help.destroy = function(id) {
63
- var help = Help.popups[id];
64
- help.destroy();
65
- };
66
-
67
- Help.closeAll = function() {
68
- $$('.popup').each(function(p) {
69
- p.remove();
70
- });
71
- };
72
-
73
- Help.init = function() {
74
- // initialize any help popups. Overwrite this locally.
75
- };
76
-
@@ -1,235 +0,0 @@
1
- /*
2
- I18N
3
-
4
- global to every view.
5
-
6
- Methods and constants dealing with internationalization.
7
- */
8
-
9
- var I18N, I18n;
10
-
11
- /* set asset version */
12
-
13
- I18N = {
14
- VERSION: "<%= @hash %>",
15
- MESSAGE: "<%= @message %>",
16
- DEPLOYED: <%= Time.now.to_i %>,
17
- DEPLOYED_STRING: "<%= Time.now.to_s %>"
18
- };
19
-
20
-
21
- I18n = {};
22
-
23
- I18n.setResources = function() {
24
- var scope, asset_path;
25
-
26
- scope = "keys";
27
-
28
- Debug.log("begin I18n.setResources for language " + I18n.currentLanguage);
29
- try {
30
- asset_path = "<%= @assets_directory %>/yrb/";
31
- I18n[scope] = I18n[scope] || OpenMailIntl.getResources(asset_path, scope, I18n.currentLanguage);
32
- if (I18n.currentLanguage !== "en-US") {
33
- I18n.default_keys = OpenMailIntl.getResources(asset_path, scope, "en-US");
34
- } else {
35
- I18n.default_keys = I18n[scope];
36
- }
37
- } catch(err) {
38
- Debug.error("error in I18n.setResources: " + err);
39
- }
40
- I18n.scope = scope;
41
- Debug.log("end I18n.setResources");
42
- };
43
-
44
-
45
- // I18n.translate(key, [args])
46
- // I18n.t(key, [args])
47
- //
48
- // Using .translate with a single key argument will return the simple translated string for that key
49
- //
50
- // Using a key argument with values after it will insert the values into the placeholders in
51
- // the returned translated string
52
- //
53
- I18n.translate = function(key, args) {
54
- key = key.toUpperCase();
55
- key = key.replace(" ", "_");
56
- if (args) {
57
- var m;
58
- m = I18n.translate_sentence(key, args);
59
- } else
60
- {
61
- m = I18n.translate_phrase(key);
62
- if (!m) {
63
- m = I18n.default_keys[key];
64
- }
65
- }
66
- return m;
67
- };
68
- I18n.t = I18n.translate;
69
-
70
- I18n.translate_phrase = function(key) {
71
- return I18n["keys"][key];
72
- };
73
-
74
- I18n.translate_sentence = function(key, args) {
75
- return OpenMailIntl.formatMessage(I18n["keys"][key], args, I18n.currentLanguage);
76
- };
77
-
78
- // I18n.update(id, scope, key, args)
79
- //
80
- // updates an element with the given _id_ with the
81
- // translation from scope, key and optional args
82
- //
83
- // only updates the element if the translation is not blank
84
- //
85
- I18n.update = function(id, key, args) {
86
- Try.these(function() {
87
- var message;
88
- message = I18n.t(key, args);
89
- if (message) {
90
- $(id).update(message);
91
- }
92
- }, function() {
93
- Debug.error("Error in i18n.update: " + Object.toJSON({
94
- id: id,
95
- key: key,
96
- args: args
97
- }));
98
- });
99
- };
100
-
101
- // I18n.u(id, args)
102
- //
103
- // updates an element with a local YRB key of the same name
104
- //
105
- // given an id of "messages" it will look for a YRB key named "MESSAGES"
106
- // within the local scope of the current view, and update the element with
107
- // that translation
108
- //
109
- I18n.u = function(id, args) {
110
- Try.these(
111
- function() {
112
- id.each(I18n.u);
113
- },
114
- function() {
115
- var key;
116
- key = id.toUpperCase();
117
- I18n.update(id, key, args);
118
- },
119
- function() {
120
- Debug.error("Error in i18n.u: " + Object.toJSON({
121
- id: id,
122
- args: args
123
- }));
124
- });
125
- };
126
-
127
-
128
- // I18n.updateValue(id, key, args)
129
- //
130
- // updates an element with the given _id_ with the
131
- // translation from scope, key and optional args
132
- //
133
- // only updates the element if the translation is not blank
134
- //
135
- I18n.updateValue = function(id, key, args) {
136
- Try.these(function() {
137
- var message;
138
- message = I18n.t(key, args);
139
- if (message) {
140
- $(id).value = message;
141
- }
142
- }, function() {
143
- Debug.error("Error in i18n.updateValue: " + Object.toJSON({
144
- id: id,
145
- key: key,
146
- args: args
147
- }));
148
- });
149
- };
150
-
151
-
152
- // I18n.v(id, args)
153
- //
154
- // updates the value of an element with a local YRB key of the same name
155
- //
156
- // given an id of "messages" it will look for a YRB key named "MESSAGES"
157
- // within the local scope of the current view, and update the element's value with
158
- // that translation
159
- //
160
- I18n.v = function(id, args) {
161
- Try.these(
162
- function() {
163
- id.each(I18n.v);
164
- },
165
- function() {
166
- var key;
167
- key = id.toUpperCase();
168
- I18n.updateValue(id, key, args);
169
- },
170
- function() {
171
- Debug.error("Error in i18n.v: " + Object.toJSON({
172
- id: id,
173
- args: args
174
- }));
175
- });
176
- };
177
-
178
- I18n.translateError = function() {
179
- I18n.update('error_1', 'ERROR_1');
180
- I18n.update('error_2', 'ERROR_2');
181
- I18n.update('retry', 'RETRY');
182
- };
183
-
184
- I18n.translateLoading = function() {
185
- I18n.update('loading_heading', 'LOADING_HEADING');
186
- I18n.update('loading_subhead', 'LOADING_SUBHEAD');
187
- I18n.update('loading_paragraph_1', 'LOADING_PARAGRAPH_1');
188
- };
189
-
190
- I18n.addLanguageToBody = function() {
191
- Try.these(function() {
192
- $$('body').first().addClassName(I18n.currentLanguage);
193
- });
194
- };
195
-
196
- I18n.findAndTranslateAll = function() {
197
- Element.addMethods({
198
- translate: function(element) {
199
- element = $(element);
200
-
201
- var e;
202
- e = element.inspect();
203
- if (e.match(/<input/)) {
204
- I18n.v(element.identify());
205
- } else {
206
- if (e.match(/<img/)) {
207
- I18n.src(element.identify());
208
- } else {
209
- I18n.u(element.identify());
210
- }
211
- }
212
- }
213
- });
214
-
215
- $$('.t').each(function(element) {
216
- try {
217
- element.translate();
218
- } catch(e) {
219
- Debug.error("Translation error for element: " + e);
220
- }
221
- });
222
- };
223
-
224
- I18n.translateSidebar = function() {
225
- I18n.u('faq_q1');
226
- var link;
227
- link = Tags.a(I18n.t('faq_link1'), {"href": 'http://go.otherinbox.com/q-stop-sender', "target": "_blank"});
228
- I18n.u('faq_a1', [link]);
229
-
230
- I18n.u('faq_q2');
231
- link = Tags.a(I18n.t('faq_link2'), {"href": 'http://go.otherinbox.com/q-custom-sender', "target": "_blank"});
232
- I18n.u('faq_a2', [link]);
233
- };
234
-
235
-