ymdp 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. data/VERSION +1 -1
  2. data/bin/ymdp +51 -0
  3. data/lib/new_application/.base +11 -0
  4. data/lib/new_application/Gemfile +12 -0
  5. data/lib/new_application/Rakefile +3 -0
  6. data/lib/new_application/app/.gitignore +1 -0
  7. data/lib/new_application/app/assets/images/lightbox/lightbox_bg.png +0 -0
  8. data/lib/new_application/app/assets/javascripts/OpenMailIntl.js +291 -0
  9. data/lib/new_application/app/assets/javascripts/controls.js +965 -0
  10. data/lib/new_application/app/assets/javascripts/date.js +104 -0
  11. data/lib/new_application/app/assets/javascripts/dragdrop.js +974 -0
  12. data/lib/new_application/app/assets/javascripts/effects.js +1123 -0
  13. data/lib/new_application/app/assets/javascripts/lowpro.js +320 -0
  14. data/lib/new_application/app/assets/javascripts/prototype.js +4874 -0
  15. data/lib/new_application/app/assets/javascripts/scriptaculous.js +68 -0
  16. data/lib/new_application/app/assets/yrb/en-US/application_en-US.pres +7 -0
  17. data/lib/new_application/app/helpers/application_helper.rb +3 -0
  18. data/lib/new_application/app/javascripts/application.js +580 -0
  19. data/lib/new_application/app/javascripts/debug.js +138 -0
  20. data/lib/new_application/app/javascripts/flash.js +96 -0
  21. data/lib/new_application/app/javascripts/header.js +13 -0
  22. data/lib/new_application/app/javascripts/help.js +76 -0
  23. data/lib/new_application/app/javascripts/i18n.js +235 -0
  24. data/lib/new_application/app/javascripts/launcher.js +159 -0
  25. data/lib/new_application/app/javascripts/logger.js +61 -0
  26. data/lib/new_application/app/javascripts/tag_helper.js +178 -0
  27. data/lib/new_application/app/stylesheets/application.css +0 -0
  28. data/lib/new_application/app/stylesheets/ie.css +0 -0
  29. data/lib/new_application/app/stylesheets/ie6.css +0 -0
  30. data/lib/new_application/app/stylesheets/ie7.css +0 -0
  31. data/lib/new_application/app/stylesheets/ie8.css +0 -0
  32. data/lib/new_application/app/stylesheets/lightbox.css +30 -0
  33. data/lib/new_application/app/stylesheets/non_ie.css +0 -0
  34. data/lib/new_application/app/views/layouts/application.html.haml +35 -0
  35. data/lib/new_application/app/views/shared/_error.html.haml +8 -0
  36. data/lib/new_application/app/views/shared/_flash.html.haml +2 -0
  37. data/lib/new_application/app/views/shared/_javascripts.html.haml +22 -0
  38. data/lib/new_application/app/views/shared/_loading.html.haml +13 -0
  39. data/lib/new_application/app/views/shared/_stylesheets.html.haml +23 -0
  40. data/lib/new_application/config/categories.yml +6 -0
  41. data/lib/new_application/config/config.yml.example +30 -0
  42. data/lib/new_application/config/constants.rb +54 -0
  43. data/lib/new_application/config/servers.yml.example +9 -0
  44. data/lib/new_application/lib/init.rb +13 -0
  45. data/lib/new_application/lib/tasks/environment.rake +4 -0
  46. data/lib/new_application/lib/tasks/keys.rake +235 -0
  47. data/lib/new_application/lib/tasks/setup.rake +13 -0
  48. data/lib/new_application/lib/tasks/ymdp.rake +718 -0
  49. data/lib/new_application/script/build +9 -0
  50. data/lib/new_application/script/config +13 -0
  51. data/lib/new_application/script/destroy +18 -0
  52. data/lib/new_application/script/generate +4 -0
  53. data/lib/new_application/script/gitrm +17 -0
  54. data/lib/new_application/script/growl +6 -0
  55. data/lib/new_application/script/images +48 -0
  56. data/lib/new_application/script/jslint.js +5072 -0
  57. data/lib/new_application/script/langs +31 -0
  58. data/lib/new_application/script/translate +5 -0
  59. data/lib/new_application/script/ymdt +1895 -0
  60. data/lib/new_application/script/ymdt.old +1890 -0
  61. data/lib/new_application/script/yuicompressor-2.4.2.jar +0 -0
  62. data/lib/new_application/ymdp +8 -0
  63. data/ymdp.gemspec +64 -1
  64. metadata +65 -4
@@ -0,0 +1,61 @@
1
+ /*
2
+ YMDP LOGGER
3
+
4
+ Send logging messages to OIB.
5
+
6
+ Messages are saved in log/ymdp.log
7
+
8
+ */
9
+
10
+
11
+ /* set asset version */
12
+
13
+ var LOGGER, Logger;
14
+
15
+ LOGGER = {
16
+ VERSION: "<%= @hash %>",
17
+ MESSAGE: "<%= @message %>",
18
+ DEPLOYED: <%= Time.now.to_i %>,
19
+ DEPLOYED_STRING: "<%= Time.now.to_s %>"
20
+ };
21
+
22
+ YAHOO.namespace("logger");
23
+
24
+ YAHOO.logger.write = function(level, message) {
25
+ if (YAHOO.oib.login !== undefined) {
26
+ message = "[login: " + YAHOO.oib.login + "] " + message;
27
+ }
28
+ if (YAHOO.oib.guid !== undefined) {
29
+ message = "[guid: " + YAHOO.oib.guid + "] " + message;
30
+ }
31
+ YAHOO.oib.callOIB("ymdp/log",
32
+ {
33
+ level: level,
34
+ message: message,
35
+ method: "POST"
36
+ },
37
+ function() {
38
+ // log message written successfully
39
+ });
40
+ };
41
+
42
+ YAHOO.logger.debug = function(message) {
43
+ YAHOO.logger.write("debug", message);
44
+ };
45
+ YAHOO.logger.info = function(message) {
46
+ YAHOO.logger.write("info", message);
47
+ };
48
+ YAHOO.logger.warn = function(message) {
49
+ YAHOO.logger.write("warn", message);
50
+ };
51
+ YAHOO.logger.error = function(message) {
52
+ YAHOO.logger.write("warn", message);
53
+ };
54
+ YAHOO.logger.fatal = function(message) {
55
+ YAHOO.logger.write("fatal", message);
56
+ };
57
+
58
+
59
+ Logger = YAHOO.logger;
60
+
61
+ // END YMDP LOGGER
@@ -0,0 +1,178 @@
1
+ /* TAG HELPERS */
2
+
3
+ var Tags;
4
+
5
+ function tagHelper(tag_name, text, options) {
6
+ var m, opts;
7
+
8
+ m = "";
9
+ opts = "";
10
+
11
+ Object.keys(options).each(function(key) {
12
+ opts = opts + " " + key + "='" + options[key] + "'";
13
+ });
14
+
15
+ m = m + "<" + tag_name + " " + opts + ">";
16
+ m = m + text;
17
+ m = m + "<\/" + tag_name + ">";
18
+ return m;
19
+ }
20
+
21
+ function optionTag(text, options) {
22
+ return tagHelper("option", text, options);
23
+ }
24
+
25
+ function selectTag(text, options) {
26
+ return tagHelper("select", text, options);
27
+ }
28
+
29
+ function spanTag(text, options) {
30
+ return tagHelper("span", text, options);
31
+ }
32
+
33
+ function liTag(text, options) {
34
+ return tagHelper("li", text, options);
35
+ }
36
+
37
+ function divTag(text, options) {
38
+ return tagHelper("div", text, options);
39
+ }
40
+
41
+ function tdTag(text, options) {
42
+ return tagHelper("td", text, options);
43
+ }
44
+
45
+ function inputTag(value, options) {
46
+ options['value'] = value;
47
+ return tagHelper("input", "", options);
48
+ }
49
+
50
+ function textField(value, options) {
51
+ return inputTag(value, options);
52
+ }
53
+
54
+ function submitTag(value, options) {
55
+ options['type'] = 'submit';
56
+ return inputTag(value, options);
57
+ }
58
+
59
+ function optionsForSelect(options, selected) {
60
+ var m;
61
+ m = "";
62
+ options.each(function(option) {
63
+ var key, value, opts;
64
+
65
+ if (Object.isArray(option)) {
66
+ key = option[0];
67
+ value = option[1];
68
+ } else {
69
+ key = option;
70
+ value = option;
71
+ }
72
+
73
+ opts = {
74
+ value: value
75
+ };
76
+
77
+ if (key === selected) {
78
+ opts.selected = 'selected';
79
+ }
80
+
81
+ m = m + optionTag(key, opts);
82
+ });
83
+ return m;
84
+ }
85
+
86
+ Tags = {
87
+ create: function(tag_name, text, options) {
88
+ options = options || {};
89
+ var m, opts;
90
+
91
+ m = "";
92
+ opts = "";
93
+
94
+ Object.keys(options).each(function(key) {
95
+ if (options[key]) {
96
+ opts = opts + " " + key + "='" + options[key] + "'";
97
+ }
98
+ });
99
+
100
+ m = m + "<" + tag_name + " " + opts + ">";
101
+ m = m + text;
102
+ m = m + "<\/" + tag_name + ">";
103
+ return m;
104
+ },
105
+
106
+ input: function(value, options) {
107
+ options = options || {};
108
+ options["value"] = value;
109
+ options["name"] = options["name"] || "";
110
+ options["id"] = options["id"] || options["name"];
111
+
112
+ return Tags.create("input", "", options);
113
+ },
114
+
115
+ hiddenInput: function(value, options) {
116
+ options = options || {};
117
+ options["type"] = "hidden";
118
+ return Tags.input(value, options);
119
+ },
120
+
121
+ checkBox: function(name, options) {
122
+ options = options || {};
123
+ var check_box, hidden_options, hidden_check_box;
124
+
125
+ options["type"] = "checkbox";
126
+ options["name"] = name;
127
+
128
+ if (options["checked"]) {
129
+ options["checked"] = "checked";
130
+ } else {
131
+ options["checked"] = undefined;
132
+ }
133
+
134
+ check_box = Tags.input("1", options);
135
+
136
+ hidden_options = {
137
+ "name": name
138
+ };
139
+ hidden_check_box = Tags.hiddenInput("0", hidden_options);
140
+
141
+ return check_box + " " + hidden_check_box;
142
+ },
143
+
144
+ submit: function(value, options) {
145
+ options = options || {};
146
+ options["value"] = value;
147
+ options["id"] = options["id"] || options["name"];
148
+ options["type"] = "submit";
149
+ return Tags.input(value, options);
150
+ },
151
+
152
+ linkToFunction: function(value, onclick, options) {
153
+ options = options || {};
154
+ var jv;
155
+
156
+ jv = "#";
157
+ options["href"] = options["href"] || jv;
158
+ options["onclick"] = onclick;
159
+ return Tags.a(value, options);
160
+ },
161
+
162
+ div: function(text, options) {
163
+ return new Element('div', options).update(text);
164
+ },
165
+
166
+ init: function() {
167
+ $w("li ul span div p a option select strong").each(function(tag_name) {
168
+ Tags[tag_name] = function(text, options) {
169
+ options = options || {};
170
+ return Tags.create(tag_name, text, options);
171
+ };
172
+ });
173
+ }
174
+ };
175
+
176
+ Tags.init();
177
+
178
+ /* END TAG HELPERS */
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,30 @@
1
+ .lightbox-wrapper {
2
+ background: transparent url('<%= @assets_directory %>/images/lightbox/lightbox_bg.png') 0 100% repeat;
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100%;
7
+ height: 100%;
8
+ z-index: 10000;
9
+ }
10
+
11
+ .lightbox-container {
12
+ background-color: #fff;
13
+ margin: auto;
14
+ margin-top: 25px;
15
+ padding: 10px;
16
+ }
17
+
18
+ .lightbox-contents {
19
+ height: 100%;
20
+ width: 100%;
21
+ margin: auto;
22
+ text-align: center;
23
+ }
24
+
25
+ .close_link {
26
+ font-size: 14px;
27
+ text-align: right;
28
+ margin-top: -10px;
29
+ margin-right: 4px;
30
+ }
File without changes
@@ -0,0 +1,35 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ /
5
+ = "Sprint #{@version} #{@sprint_name}"
6
+ = "'#{@view}' view for #{@domain}: #{@server}"
7
+ = "built at #{Time.now}"
8
+ = "commit #{@hash}, '#{@message}'"
9
+
10
+ %title= "#{@view} view for #{@domain}: #{@server}"
11
+
12
+ = render :partial => 'stylesheets'
13
+
14
+ / Prototype
15
+
16
+ = javascript_include "prototype.js"
17
+ = javascript_include "scriptaculous.js"
18
+
19
+
20
+ %body{:class => @view}
21
+ = render :partial => 'loading'
22
+ = render :partial => 'flash'
23
+
24
+ #main{:style => "display: none;"}
25
+
26
+ #content
27
+ = @content
28
+
29
+ = render :partial => 'javascripts'
30
+
31
+ /
32
+ = "Sprint #{@version} #{@sprint_name}"
33
+ = "'#{@view}' view for #{@domain}: #{@server}"
34
+ = "built at #{Time.now}"
35
+ = "commit #{@hash}, '#{@message}'"
@@ -0,0 +1,8 @@
1
+ #error{:style => "display: none;"}
2
+ %h2#error_1 We're sorry, but something went wrong when we tried to contact the server.
3
+ %p#error_2 We've been notified about this issue and we'll take a look at it shortly.
4
+
5
+ %p
6
+ = button("Retry", :id => "retry", :onclick => "YAHOO.launcher.relaunchAuthorize(); return false;", :class => "t")
7
+
8
+ %p#error_details{:style => "display: none;"}
@@ -0,0 +1,2 @@
1
+ #flash{:style => "display: none;"}
2
+ #flash_message.message
@@ -0,0 +1,22 @@
1
+
2
+ / Required scripts for using the Yahoo! Mail Developer Platform API
3
+ = javascript_include "http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"
4
+ = javascript_include "http://yui.yahooapis.com/2.7.0/build/json/json-min.js"
5
+ = javascript_include "http://mail.yimg.com/a/lib/om/crossframe/1.0.19/crossframe-min.js"
6
+ = javascript_include "http://mail.yimg.com/a/lib/om/om_api_public/1.0.4/om_api_public.js"
7
+
8
+
9
+ / OIB JavaScript libraries
10
+
11
+ = javascript_include "OpenMailIntl.js"
12
+ = render :javascript => ['application', 'debug', 'tag_helper', 'launcher', 'logger', 'i18n', 'flash'], :filename => 'javascripts'
13
+
14
+ / Date
15
+
16
+ = javascript_include "date.js"
17
+
18
+ / Header
19
+ = render :javascript => 'header'
20
+ = render :javascript => @view
21
+
22
+ / = include_firebug_lite
@@ -0,0 +1,13 @@
1
+ #utility
2
+ .toolbar
3
+ = blank_image_tag(:class => "logo")
4
+ %h1#loading_heading Automatic Organizer
5
+
6
+ #loading
7
+ %h2#loading_subhead Organize. Prioritize. Summarize.
8
+
9
+ %p
10
+ = image_tag('spinner.gif', :alt => "Loading indicator", :class => 'spinner')
11
+ %span#loading_paragraph_1 Loading your Automatic Organizer settings...
12
+
13
+ = render :partial => 'error'
@@ -0,0 +1,23 @@
1
+ / Styles
2
+
3
+ = render :stylesheet => 'application'
4
+ = render :stylesheet => 'lightbox'
5
+ = render :stylesheet => @view
6
+
7
+
8
+ <!--[if IE]>
9
+ = render :stylesheet => 'ie'
10
+ <![endif]-->
11
+
12
+ <!--[if IE 6]>
13
+ = render :stylesheet => 'ie6'
14
+ <![endif]-->
15
+
16
+ <!--[if IE 7]>
17
+ = render :stylesheet => 'ie7'
18
+ <![endif]-->
19
+
20
+ <!--[if IE 8]>
21
+ = render :stylesheet => 'ie8'
22
+ <![endif]-->
23
+
@@ -0,0 +1,6 @@
1
+ categories:
2
+ views: views
3
+ assets: assets
4
+ javascripts: assets/javascripts
5
+ images: assets/images
6
+ # yrb: assets/yrb
@@ -0,0 +1,30 @@
1
+ config:
2
+ username:
3
+ password:
4
+ host: myserver.com
5
+ default_server: development
6
+ doctype: HTML 4.0 Transitional
7
+ growl: true
8
+ version:
9
+ sprint_name:
10
+
11
+ verbose: false
12
+ compress:
13
+ obfuscate: true
14
+ css: true
15
+ embedded_js: true
16
+ js_assets: true
17
+ validate:
18
+ html:
19
+ build: true
20
+ deploy: true
21
+ embedded_js:
22
+ build: true
23
+ deploy: true
24
+ js_assets:
25
+ build: true
26
+ deploy: true
27
+ json_assets:
28
+ build: true
29
+ deploy: true
30
+
@@ -0,0 +1,54 @@
1
+ LOCALE_CODES = ["en-US","de-DE","en-AA","en-AU","en-MY","en-NZ","en-PH","en-SG","es-ES","es-MX","fr-FR","id-ID","it-IT","ko-KR","pt-BR","vi-VN","zh-Hans-CN","zh-Hant-HK","zh-Hant-TW"] unless defined?(LOCALE_CODES)
2
+
3
+ LOCALES = {
4
+ "en-US" => "English (United States)",
5
+ "en-AA" => "English (Asia)",
6
+ "en-AU" => "English (Australia)",
7
+ "en-MY" => "English (Malaysia)",
8
+ "en-NZ" => "English (New Zealand)",
9
+ "en-PH" => "English (Phillippines)",
10
+ "en-SG" => "English (Singapore)",
11
+ "de-DE" => "German",
12
+ "es-ES" => "Spanish (Spain)",
13
+ "es-MX" => "Spanish (Mexico)",
14
+ "fr-FR" => "French",
15
+ "id-ID" => "Indonesian",
16
+ "it-IT" => "Italian",
17
+ "ko-KR" => "Korean",
18
+ "pt-BR" => "Portuguese",
19
+ "vi-VN" => "Vietnamese",
20
+ "zh-Hans-CN" => "Chinese (China)",
21
+ "zh-Hant-HK" => "Chinese (Hong Kong)",
22
+ "zh-Hant-TW" => "Chinese (Taiwan)"
23
+ } unless defined?(LOCALES)
24
+
25
+ SORTED_LOCALES = LOCALES.sort do |a,b|
26
+ a[1] <=> b[1]
27
+ end unless defined?(SORTED_LOCALES)
28
+
29
+ YMDP_ROOT = "." unless defined?(YMDP_ROOT)
30
+
31
+ def file_not_found(filename)
32
+ puts
33
+ puts "Create #{filename} with the following command:\n\n ./script/config"
34
+ puts
35
+
36
+ raise "File not found: #{filename}"
37
+ end
38
+
39
+ servers = "#{YMDP_ROOT}/config/servers.yml"
40
+ config = "#{YMDP_ROOT}/config/config.yml"
41
+
42
+ if File.exists?(servers)
43
+ SERVERS = YAML.load_file("#{YMDP_ROOT}/config/servers.yml") unless defined?(SERVERS)
44
+ else
45
+ file_not_found(servers)
46
+ end
47
+
48
+ if File.exists?(config)
49
+ CONFIG = YAML.load_file("#{YMDP_ROOT}/config/config.yml")["config"] unless defined?(CONFIG)
50
+ else
51
+ file_not_found(config)
52
+ end
53
+
54
+ TMP_DIR = "./tmp" unless defined?(TMP_DIR)
@@ -0,0 +1,9 @@
1
+ production:
2
+ server: www
3
+ application_id:
4
+ assets_id:
5
+
6
+ development:
7
+ server: staging
8
+ application_id: 3icpjckq3ic9k
9
+ assets_id: 6ap3470p30oj4_1
@@ -0,0 +1,13 @@
1
+ require 'fileutils'
2
+ require 'erb'
3
+ require 'net/http'
4
+ require 'optparse'
5
+
6
+ Dir["./app/helpers/*.rb"].each do |path|
7
+ require path
8
+ end
9
+
10
+ require 'vendor/gems/environment'
11
+ Bundler.require_env
12
+
13
+ require 'constants'
@@ -0,0 +1,4 @@
1
+ task :environment do
2
+ require 'lib/init'
3
+ end
4
+