edgarj 0.01.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +23 -0
  4. data/Rakefile +40 -0
  5. data/app/assets/javascripts/edgarj/base.js +49 -0
  6. data/app/assets/javascripts/edgarj/menu.js +39 -0
  7. data/app/assets/javascripts/edgarj/operator_selection.js +133 -0
  8. data/app/assets/stylesheets/edgarj/base.css +304 -0
  9. data/app/assets/stylesheets/edgarj/menu.css +65 -0
  10. data/app/controllers/edgarj/authentication_mixin.rb.sample +30 -0
  11. data/app/controllers/edgarj/controller_mixin_common.rb +80 -0
  12. data/app/controllers/edgarj/controller_mixin_for_app.rb +71 -0
  13. data/app/controllers/edgarj/edgarj_controller.rb +535 -0
  14. data/app/controllers/edgarj/model_permissions_controller.rb +8 -0
  15. data/app/controllers/edgarj/permission_mixin.rb +84 -0
  16. data/app/controllers/edgarj/popup_controller.rb +128 -0
  17. data/app/controllers/edgarj/rescue_mixin.rb +37 -0
  18. data/app/controllers/edgarj/user_group_users_controller.rb +8 -0
  19. data/app/controllers/edgarj/user_groups_controller.rb +9 -0
  20. data/app/controllers/edgarj/user_groups_popup_controller.rb +8 -0
  21. data/app/helpers/edgarj/assoc_helper.rb +369 -0
  22. data/app/helpers/edgarj/common_helper.rb +37 -0
  23. data/app/helpers/edgarj/edgarj_helper.rb +20 -0
  24. data/app/helpers/edgarj/field_helper.rb +397 -0
  25. data/app/helpers/edgarj/form_drawer.rb +322 -0
  26. data/app/helpers/edgarj/list_drawer.rb +169 -0
  27. data/app/helpers/edgarj/menu_helper.rb +92 -0
  28. data/app/helpers/edgarj/model_permissions_helper.rb +9 -0
  29. data/app/helpers/edgarj/popup_helper.rb +40 -0
  30. data/app/helpers/edgarj/search_helper.rb +14 -0
  31. data/app/helpers/edgarj/sessions_helper.rb +9 -0
  32. data/app/helpers/edgarj/user_group_users_helper.rb +9 -0
  33. data/app/helpers/edgarj/user_groups_helper.rb +9 -0
  34. data/app/helpers/edgarj/user_groups_popup_helper.rb +9 -0
  35. data/app/models/edgarj/drawer/base.rb +234 -0
  36. data/app/models/edgarj/drawer/normal.rb +6 -0
  37. data/app/models/edgarj/drawer/popup.rb +47 -0
  38. data/app/models/edgarj/drawer.rb +13 -0
  39. data/app/models/edgarj/model_permission.rb +41 -0
  40. data/app/models/edgarj/page_info.rb +47 -0
  41. data/app/models/edgarj/search.rb +81 -0
  42. data/app/models/edgarj/search_form.rb +255 -0
  43. data/app/models/edgarj/search_popup.rb +44 -0
  44. data/app/models/edgarj/sssn.rb +120 -0
  45. data/app/models/edgarj/user_group.rb +67 -0
  46. data/app/models/edgarj/user_group_user.rb +18 -0
  47. data/app/models/edgarj.rb +5 -0
  48. data/app/views/edgarj/edgarj/_form.html.erb +25 -0
  49. data/app/views/edgarj/edgarj/_list.html.erb +52 -0
  50. data/app/views/edgarj/edgarj/_message_popup.html.erb +15 -0
  51. data/app/views/edgarj/edgarj/_search_form.html.erb +64 -0
  52. data/app/views/edgarj/edgarj/_search_operator.html.erb +17 -0
  53. data/app/views/edgarj/edgarj/_search_operator_selection.html.erb +12 -0
  54. data/app/views/edgarj/edgarj/clear.js.erb +1 -0
  55. data/app/views/edgarj/edgarj/create.js.erb +4 -0
  56. data/app/views/edgarj/edgarj/destroy.js.erb +2 -0
  57. data/app/views/edgarj/edgarj/index.html.erb +37 -0
  58. data/app/views/edgarj/edgarj/index.js.erb +1 -0
  59. data/app/views/edgarj/edgarj/message_popup.js.erb +3 -0
  60. data/app/views/edgarj/edgarj/page_info_save.js.erb +1 -0
  61. data/app/views/edgarj/edgarj/search.js.erb +4 -0
  62. data/app/views/edgarj/edgarj/search_clear.js.erb +1 -0
  63. data/app/views/edgarj/edgarj/show.js.erb +1 -0
  64. data/app/views/edgarj/edgarj/top.html.erb +4 -0
  65. data/app/views/edgarj/edgarj/update.js.erb +4 -0
  66. data/app/views/edgarj/popup/_index.html.erb +16 -0
  67. data/app/views/edgarj/popup/_list.html.erb +42 -0
  68. data/app/views/edgarj/popup/_message_popup.html.erb +15 -0
  69. data/app/views/edgarj/popup/_search.html.erb +42 -0
  70. data/app/views/edgarj/popup/_search_save_popup.html.erb +16 -0
  71. data/app/views/edgarj/popup/index.js.erb +5 -0
  72. data/app/views/edgarj/popup/message_popup.js.erb +3 -0
  73. data/app/views/edgarj/popup/page_info_save.js.erb +1 -0
  74. data/app/views/edgarj/popup/search.js.erb +15 -0
  75. data/app/views/edgarj/popup/view_status_save.js.erb +1 -0
  76. data/config/routes.rb +15 -0
  77. data/config/settings.yml +5 -0
  78. data/db/migrate/20131118084600_create_edgar_sssns.rb +14 -0
  79. data/db/migrate/20131123124730_create_edgar_page_infos.rb +15 -0
  80. data/db/migrate/20140116062252_create_edgar_user_groups.rb +18 -0
  81. data/db/migrate/20140116062327_create_edgar_user_group_users.rb +10 -0
  82. data/db/migrate/20140206222308_create_edgar_model_permissions.rb +14 -0
  83. data/db/migrate/20141209053055_rename_edgar_to_edgarj.rb +17 -0
  84. data/lib/core_ext/active_record.rb +123 -0
  85. data/lib/core_ext/resources.rb +71 -0
  86. data/lib/edgarj/engine.rb +64 -0
  87. data/lib/edgarj/enum_cache.rb +46 -0
  88. data/lib/edgarj/templates/rails/helper/helper.rb +10 -0
  89. data/lib/edgarj/templates/test_unit/scaffold/functional_test.rb +575 -0
  90. data/lib/edgarj/version.rb +3 -0
  91. data/lib/edgarj.rb +14 -0
  92. data/lib/generators/edgarj/popup_scaffold/USAGE +6 -0
  93. data/lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb +35 -0
  94. data/lib/generators/edgarj/popup_scaffold/templates/controller.rb +13 -0
  95. data/lib/generators/edgarj/popup_scaffold/templates/functional_test.rb +197 -0
  96. data/lib/generators/edgarj/popup_scaffold/templates/helper.rb +9 -0
  97. data/lib/generators/edgarj/scaffold/USAGE +17 -0
  98. data/lib/generators/edgarj/scaffold/scaffold_generator.rb +40 -0
  99. data/lib/generators/edgarj/scaffold/templates/controller.rb +13 -0
  100. data/lib/tasks/edgarj_tasks.rake +32 -0
  101. data/lib/tasks/pakcage.rake +18 -0
  102. data/locale/en.yml +94 -0
  103. data/locale/ja.yml +100 -0
  104. data/test/dummy/README.rdoc +28 -0
  105. data/test/dummy/Rakefile +6 -0
  106. data/test/dummy/app/assets/javascripts/application.js +21 -0
  107. data/test/dummy/app/assets/javascripts/authors.js +2 -0
  108. data/test/dummy/app/assets/stylesheets/application.css +16 -0
  109. data/test/dummy/app/assets/stylesheets/authors.css +4 -0
  110. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  111. data/test/dummy/app/controllers/application_controller.rb +15 -0
  112. data/test/dummy/app/controllers/authors_controller.rb +6 -0
  113. data/test/dummy/app/controllers/authors_popup_controller.rb +6 -0
  114. data/test/dummy/app/controllers/books_controller.rb +6 -0
  115. data/test/dummy/app/controllers/dummy_auth_mixin.rb +36 -0
  116. data/test/dummy/app/decorators/models/edgarj/user_group_decorator.rb +1 -0
  117. data/test/dummy/app/helpers/application_helper.rb +3 -0
  118. data/test/dummy/app/helpers/authors_helper.rb +7 -0
  119. data/test/dummy/app/helpers/authors_popup_helper.rb +7 -0
  120. data/test/dummy/app/helpers/books_helper.rb +7 -0
  121. data/test/dummy/app/models/author.rb +32 -0
  122. data/test/dummy/app/models/book.rb +5 -0
  123. data/test/dummy/app/models/user.rb +13 -0
  124. data/test/dummy/app/views/layouts/application.html.erb +32 -0
  125. data/test/dummy/app/views/layouts/login.html.erb +20 -0
  126. data/test/dummy/bin/bundle +3 -0
  127. data/test/dummy/bin/rails +4 -0
  128. data/test/dummy/bin/rake +4 -0
  129. data/test/dummy/config/application.rb +59 -0
  130. data/test/dummy/config/boot.rb +10 -0
  131. data/test/dummy/config/database.yml +15 -0
  132. data/test/dummy/config/edgarj/menu_config.rb +28 -0
  133. data/test/dummy/config/environment.rb +5 -0
  134. data/test/dummy/config/environments/development.rb +42 -0
  135. data/test/dummy/config/environments/production.rb +79 -0
  136. data/test/dummy/config/environments/test.rb +34 -0
  137. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  138. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  139. data/test/dummy/config/initializers/inflections.rb +16 -0
  140. data/test/dummy/config/initializers/mime_types.rb +5 -0
  141. data/test/dummy/config/initializers/secret_token.rb +12 -0
  142. data/test/dummy/config/initializers/session_store.rb +3 -0
  143. data/test/dummy/config/initializers/strong_parameter.rb +3 -0
  144. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  145. data/test/dummy/config/locales/en.yml +26 -0
  146. data/test/dummy/config/routes.rb +60 -0
  147. data/test/dummy/config.ru +4 -0
  148. data/test/dummy/db/migrate/20131107120635_create_authors.rb +9 -0
  149. data/test/dummy/db/migrate/20131218011851_create_books.rb +10 -0
  150. data/test/dummy/db/migrate/20140201000000_add_user_group_id_to_authors.rb +5 -0
  151. data/test/dummy/db/migrate/20140807065420_create_users.rb +10 -0
  152. data/test/dummy/db/schema.rb +93 -0
  153. data/test/dummy/public/404.html +58 -0
  154. data/test/dummy/public/422.html +58 -0
  155. data/test/dummy/public/500.html +57 -0
  156. data/test/dummy/public/favicon.ico +0 -0
  157. data/test/dummy/script/rails +6 -0
  158. data/test/dummy/test/functional/authors_controller_test.rb +631 -0
  159. data/test/dummy/test/functional/books_controller_test.rb +516 -0
  160. data/test/dummy/test/helpers/authors_helper_test.rb +4 -0
  161. data/test/dummy/test/unit/author_test.rb +7 -0
  162. data/test/dummy/test/unit/book_test.rb +7 -0
  163. data/test/edgar_test.rb +7 -0
  164. data/test/fixtures/authors.yml +32 -0
  165. data/test/fixtures/books.yml +56 -0
  166. data/test/fixtures/edgarj/model_permissions.yml +97 -0
  167. data/test/fixtures/edgarj/page_infos.yml +84 -0
  168. data/test/fixtures/edgarj/sssns.yml +38 -0
  169. data/test/fixtures/edgarj/user_group_users.yml +114 -0
  170. data/test/fixtures/edgarj/user_groups.yml +95 -0
  171. data/test/fixtures/users.yml +49 -0
  172. data/test/functional/edgarj/edgarj_controller_test.rb +24 -0
  173. data/test/functional/edgarj/model_permissions_controller_test.rb +554 -0
  174. data/test/functional/edgarj/user_group_users_controller_test.rb +567 -0
  175. data/test/integration/navigation_test.rb +10 -0
  176. data/test/support/edgarj/controller_supporter.rb +23 -0
  177. data/test/test_helper.rb +23 -0
  178. data/test/unit/edgarj/model_permission_test.rb +27 -0
  179. data/test/unit/edgarj/page_info_test.rb +7 -0
  180. data/test/unit/edgarj/sssn_test.rb +10 -0
  181. data/test/unit/edgarj/user_group_test.rb +32 -0
  182. data/test/unit/edgarj/user_group_user_test.rb +9 -0
  183. data/test/unit/helpers/edgarj/model_permissions_helper_test.rb +6 -0
  184. data/test/unit/helpers/edgarj/user_group_users_helper_test.rb +6 -0
  185. metadata +456 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 00eea19bd167d8b2f717d892ffa5ff4aea5a99c2
4
+ data.tar.gz: 430cd11bd6fdf1e0040af77758db8c9524b0d5f0
5
+ SHA512:
6
+ metadata.gz: 12f3effb419be2931d31fc187eeec8d72fb5221312fab44cb6475c4e810f9880532db1b1ad5861a9f9d8ae6d67688f7b54301f3a264cc7be3cb4b9f2a6d5a28b
7
+ data.tar.gz: 4c1f5639e68ef78609787039d953d96dd2316c15b4f259fcc989787b3b412a1aedec7e2fdc8e89096214660714426c831d5ba840ff0330b832a16a92507e7742
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2014 Fuminori IDO
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,23 @@
1
+ = Edgarj
2
+
3
+ Edgarj is an Ajax-based scaffold with:
4
+
5
+ * QBE(Query By Example) search form.
6
+ * column sort on record list.
7
+ * popup view & controller for 'belongs_to' relation table to pick up a
8
+ parent record.
9
+ * csv download.
10
+ * user-role based access control.
11
+ * Following levels of customization:
12
+ 1. select columns and its order on view for list, form, and search-form
13
+ 1. overwrite partial-template for each list, form, and search-form
14
+
15
+ == Prerequisites
16
+
17
+ * Rails 3.2 (because of our projects' rails version consistency).
18
+ * external 'User' model.
19
+
20
+ == KNOWN BUGS
21
+
22
+ * "rake scaffold" (not "rake edgarj:scaffold") generates
23
+ WRONG functional test, which uses Edgarj's functional test template.
data/Rakefile ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'Edgarj'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ Rake::TestTask.new(:test) do |t|
33
+ t.libs << 'lib'
34
+ t.libs << 'test'
35
+ t.pattern = 'test/**/*_test.rb'
36
+ t.verbose = false
37
+ end
38
+
39
+
40
+ task :default => :test
@@ -0,0 +1,49 @@
1
+ var Edgarj = {
2
+ };
3
+
4
+ Edgarj.Popup = {
5
+ /*
6
+ JavaScript version of Edgarj::PopupHelper::PopupField.
7
+
8
+ This constructor returns exactly the same value as helper does.
9
+
10
+ = SEE ALSO
11
+ Edgarj::PopupHelper::PopupField:: same logic at ruby server side
12
+ */
13
+ Field: function(id_target){
14
+ this.id_target = $('#' + id_target);
15
+ this.label_target = $('#' + '__edgarj_label_target_for_' + id_target);
16
+ this.label_hidden_field = $('#' + '__edgarj_label_hidden_field_for_' + id_target);
17
+ this.clear_link = $('#' + this.label_target.attr('id') + '_clear_link');
18
+ },
19
+
20
+ /*
21
+ clear popup button and hidden field
22
+
23
+ = INPUTS
24
+ id_target:: id target DOM
25
+ */
26
+ clear: function(id_target){
27
+ //var pf = new Edgarj.Popup.Field(id_target);
28
+ var pf = new this.Field(id_target);
29
+ pf.id_target.val('');
30
+ pf.label_target.text('');
31
+ pf.label_hidden_field.val('');
32
+ pf.clear_link.hide();
33
+ }
34
+ };
35
+
36
+ Edgarj.OperatorSelection = {
37
+ /*
38
+ set selected operator 'op' into both target label and hidden field
39
+ on search-form.
40
+ */
41
+ on_select: function(target, op){
42
+ // guess hidden field from target label
43
+ var hidden_dom = target.id.replace(/_label$/, ""),
44
+ hidden = $('#' + hidden_dom);
45
+
46
+ hidden.val(op);
47
+ $(target).text(op);
48
+ }
49
+ };
@@ -0,0 +1,39 @@
1
+ /*
2
+ inspired from http://javascript-array.com/scripts/jquery_simple_drop_down_menu/
3
+ */
4
+
5
+ Edgarj.Menu = {
6
+ timeout: 500,
7
+ closetimer: 0,
8
+ ddmenuitem: 0,
9
+
10
+ cancel_timer: function(){
11
+ if(Edgarj.Menu.closetimer){
12
+ window.clearTimeout(Edgarj.Menu.closetimer);
13
+ Edgarj.Menu.closetimer = null;
14
+ }
15
+ },
16
+
17
+ open: function(){
18
+ Edgarj.Menu.cancel_timer();
19
+ Edgarj.Menu.close();
20
+ Edgarj.Menu.ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');
21
+ },
22
+
23
+ close: function(){
24
+ if(Edgarj.Menu.ddmenuitem){
25
+ Edgarj.Menu.ddmenuitem.css('visibility', 'hidden');
26
+ }
27
+ },
28
+
29
+ timer: function(){
30
+ Edgarj.Menu.closetimer = window.setTimeout(Edgarj.Menu.close, Edgarj.Menu.timeout);
31
+ },
32
+ }
33
+
34
+ $(document).ready(function(){
35
+ $('#edgarj_menu > li').bind('mouseover', Edgarj.Menu.open);
36
+ $('#edgarj_menu > li').bind('mouseout', Edgarj.Menu.timer);
37
+ });
38
+
39
+ document.onclick = Edgarj.Menu.close;
@@ -0,0 +1,133 @@
1
+ /*
2
+ Operator selection menu
3
+
4
+ Inspired by Chris Domigan's ContextMenu
5
+ (http://www.trendskitchens.co.nz/jquery/contextmenu/)
6
+
7
+ This is MIT LICENSE.
8
+ */
9
+
10
+ (function($) {
11
+ var menu, shadow, trigger, content, hash, currentTarget;
12
+ var defaults = {
13
+ menuStyle: {
14
+ listStyle: 'none',
15
+ padding: '1px',
16
+ margin: '0px',
17
+ backgroundColor: '#fff',
18
+ border: '1px solid #999',
19
+ width: '100px'
20
+ },
21
+ itemStyle: {
22
+ margin: '0px',
23
+ color: '#000',
24
+ display: 'block',
25
+ cursor: 'default',
26
+ padding: '3px',
27
+ border: '1px solid #fff',
28
+ backgroundColor: 'transparent'
29
+ },
30
+ itemHoverStyle: {
31
+ border: '1px solid #0a246a',
32
+ backgroundColor: '#b6bdd2'
33
+ },
34
+ eventPosX: 'pageX',
35
+ eventPosY: 'pageY',
36
+ shadow : true,
37
+ onContextMenu: null,
38
+ onShowMenu: null
39
+ };
40
+
41
+ $.fn.contextMenu = function(id, options) {
42
+ if (!menu) { // Create singleton menu
43
+ menu = $('<div id="jqContextMenu"></div>')
44
+ .hide()
45
+ .css({position:'absolute', zIndex:'500'})
46
+ .appendTo('body')
47
+ .bind('click', function(e) {
48
+ e.stopPropagation();
49
+ });
50
+ }
51
+ if (!shadow) {
52
+ shadow = $('<div></div>')
53
+ .css({backgroundColor:'#000',position:'absolute',opacity:0.2,zIndex:499})
54
+ .appendTo('body')
55
+ .hide();
56
+ }
57
+ hash = hash || [];
58
+ hash.push({
59
+ id : id,
60
+ menuStyle: $.extend({}, defaults.menuStyle, options.menuStyle || {}),
61
+ itemStyle: $.extend({}, defaults.itemStyle, options.itemStyle || {}),
62
+ itemHoverStyle: $.extend({}, defaults.itemHoverStyle, options.itemHoverStyle || {}),
63
+ bindings: options.bindings || {},
64
+ shadow: options.shadow || options.shadow === false ? options.shadow : defaults.shadow,
65
+ onContextMenu: options.onContextMenu || defaults.onContextMenu,
66
+ onShowMenu: options.onShowMenu || defaults.onShowMenu,
67
+ eventPosX: options.eventPosX || defaults.eventPosX,
68
+ eventPosY: options.eventPosY || defaults.eventPosY
69
+ });
70
+
71
+ var index = hash.length - 1;
72
+ $(this).bind('click', function(e) {
73
+ // Check if onContextMenu() defined
74
+ var bShowContext = (!!hash[index].onContextMenu) ? hash[index].onContextMenu(e) : true;
75
+ if (bShowContext) display(index, this, e, options);
76
+ return false;
77
+ });
78
+ return this;
79
+ };
80
+
81
+ function display(index, trigger, e, options) {
82
+ var cur = hash[index];
83
+ content = $('#'+cur.id).find('ul:first').clone(true);
84
+ content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover(
85
+ function() {
86
+ $(this).css(cur.itemHoverStyle);
87
+ },
88
+ function(){
89
+ $(this).css(cur.itemStyle);
90
+ }
91
+ ).find('img').css({verticalAlign:'middle',paddingRight:'2px'});
92
+
93
+ // Send the content to the menu
94
+ menu.html(content);
95
+
96
+ // if there's an onShowMenu, run it now -- must run after content has been added
97
+ // if you try to alter the content variable before the menu.html(), IE6 has issues
98
+ // updating the content
99
+ if (!!cur.onShowMenu) menu = cur.onShowMenu(e, menu);
100
+
101
+ $.each(cur.bindings, function(id, func) {
102
+ $('#'+id, menu).bind('click', function(e) {
103
+ hide();
104
+ func(trigger, currentTarget);
105
+ });
106
+ });
107
+
108
+ menu.css({'left':e[cur.eventPosX],'top':e[cur.eventPosY]}).show();
109
+ if (cur.shadow) shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2,top:e.pageY+2}).show();
110
+ $(document).one('click', hide);
111
+ }
112
+
113
+ function hide() {
114
+ menu.hide();
115
+ shadow.hide();
116
+ }
117
+
118
+ // Apply defaults
119
+ $.contextMenu = {
120
+ defaults : function(userDefaults) {
121
+ $.each(userDefaults, function(i, val) {
122
+ if (typeof val == 'object' && defaults[i]) {
123
+ $.extend(defaults[i], val);
124
+ }
125
+ else defaults[i] = val;
126
+ });
127
+ }
128
+ };
129
+ })(jQuery);
130
+
131
+ $(function(){
132
+ $('div.contextMenu').hide();
133
+ });
@@ -0,0 +1,304 @@
1
+ h3 {
2
+ color: #000;
3
+ padding-left: 5px;
4
+ border-left: 10px solid #248;
5
+ border-bottom: 1px solid #248;
6
+ }
7
+
8
+ pre {
9
+ background-color: #eee;
10
+ padding: 10px;
11
+ }
12
+
13
+ /* Edgarj list */
14
+ div#edgarj_list table, div#edgarj_popup_list table {
15
+ border-collapse: separate;
16
+ border-spacing: 0px;
17
+ empty-cells: show;
18
+ }
19
+
20
+ div#edgarj_list th, div#edgarj_list td,
21
+ div#edgarj_popup_list th, div#edgarj_popup_list td {
22
+ margin: 1px;
23
+ border: 0px;
24
+ padding: 1px 5px 1px 5px;
25
+ font-size: 80%;
26
+ }
27
+
28
+ div#edgarj_list th {
29
+ border-top: 1px solid #fca;
30
+ border-left: 1px solid #fca;
31
+ border-right: 1px solid #842;
32
+ border-bottom: 1px solid #842;
33
+ background-color: #c94;
34
+ }
35
+
36
+ div#edgarj_popup_list th {
37
+ border-top: 1px solid #abd;
38
+ border-left: 1px solid #abd;
39
+ border-right: 1px solid #347;
40
+ border-bottom: 1px solid #347;
41
+ background-color: #6ad;
42
+ }
43
+
44
+ div#edgarj_list table.list tr:hover, div#edgarj_popup_list table.list tr:hover {
45
+ background-color: #8fc;
46
+ }
47
+
48
+ /* form by <table> */
49
+ form {
50
+ margin: 0em;
51
+ }
52
+
53
+ div#edgarj_form {
54
+ margin-top: 5px;
55
+ background-color: #f0e8b8;
56
+ padding: 5px;
57
+ border: 1px solid;
58
+ border-color: #eef #668 #668 #eef;
59
+ }
60
+
61
+ div#edgarj_search_form {
62
+ margin-top: 5px;
63
+ background-color: #cfc;
64
+ padding: 5px;
65
+ border: 1px solid;
66
+ border-color: #efe #686 #686 #efe;
67
+ }
68
+
69
+ /* hyper-link in Edgarj list, form, and search_form */
70
+ div#edgarj_list a { color: #000; }
71
+ div#edgarj_list a:visited { color: #000; }
72
+ div#edgarj_list a:hover { color: #eee; background-color:#08c; }
73
+ div#edgarj_form a { color: #000; }
74
+ div#edgarj_form a:visited { color: #000; }
75
+ div#edgarj_form a:hover { color: #eee; background-color:#08c; }
76
+ div#edgarj_search_form a { color: #000; }
77
+ div#edgarj_search_form a:visited { color: #000; }
78
+ div#edgarj_search_form a:hover { color: #eee; background-color:#08c; }
79
+
80
+
81
+ /* List's two-ton color */
82
+ tr.list_line0 {
83
+ background-color: #ffffd0;
84
+ }
85
+ tr.list_line1 {
86
+ background-color: #f0f0f0;
87
+ }
88
+
89
+ /* login */
90
+ /* List's two-ton color */
91
+ .login tr th {
92
+ background-color: #fff;
93
+ }
94
+
95
+ /* error related */
96
+ .fieldWithErrors {
97
+ padding: 2px;
98
+ background-color: red;
99
+ display: table;
100
+ }
101
+
102
+ #errorExplanation {
103
+ width: 400px;
104
+ border: 2px solid red;
105
+ padding: 7px;
106
+ padding-bottom: 12px;
107
+ margin-bottom: 20px;
108
+ background-color: #f0f0f0;
109
+ }
110
+
111
+ #errorExplanation h2 {
112
+ text-align: left;
113
+ font-weight: bold;
114
+ padding: 5px 5px 5px 15px;
115
+ font-size: 12px;
116
+ margin: -7px;
117
+ background-color: #c00;
118
+ color: #fff;
119
+ }
120
+
121
+ #errorExplanation p {
122
+ color: #333;
123
+ margin-bottom: 0;
124
+ padding: 5px;
125
+ }
126
+
127
+ #errorExplanation ul li {
128
+ font-size: 12px;
129
+ list-style: square;
130
+ }
131
+
132
+ td#login {
133
+ color: #333;
134
+ }
135
+
136
+ .edgarj_title {
137
+ text-decoration: none;
138
+ }
139
+
140
+ /*---------------------------------------------------------------
141
+ ContextMenu
142
+ ---------------------------------------------------------------*/
143
+ #control_edgarj_operator_select {
144
+ border: 1px solid #666;
145
+ background-color: #eee;
146
+ /*
147
+ min-width:150px;
148
+ */
149
+ }
150
+
151
+ #control_edgarj_operator_select ul {
152
+ list-style: none;
153
+ padding: 0;
154
+ margin: 0;
155
+ cursor: pointer;
156
+ }
157
+
158
+ #control_edgarj_operator_select ul li {
159
+ text-align: left;
160
+ padding: 3px 10px 3px 5px;
161
+ margin: 0;
162
+ cursor: pointer;
163
+ text-decoration: none;
164
+ color: #333;
165
+ border-top: 1px solid #fff;
166
+ border-left: 1px solid #fff;
167
+ border-bottom: 1px solid #999;
168
+ border-right: 1px solid #999;
169
+ /*
170
+ font-size:12px;
171
+ font-weight:bold;
172
+ font-family:"Lucida Grande",Verdana;
173
+ */
174
+ }
175
+
176
+ #control_edgarj_operator_select ul li.selected,
177
+ #control_edgarj_operator_select ul li:hover {
178
+ color: #fff;
179
+ background-color: #3875d7;
180
+ cursor: pointer;
181
+ }
182
+
183
+ #control_edgarj_operator_select ul li.selected:hover {
184
+ color: #333;
185
+ background-color: #eee;
186
+ cursor: pointer;
187
+ }
188
+
189
+ #control_edgarj_operator_select ul li.disabled,
190
+ #control_edgarj_operator_select ul li:hover.disabled {
191
+ background-color: #eee;
192
+ color: #999;
193
+ cursor: pointer;
194
+ }
195
+
196
+ div.search_operator {
197
+ padding: 3px;
198
+ margin: 3px;
199
+ border-top: 1px solid #cfc; /* background-color should be same as
200
+ div#edgarj_search_form's */
201
+ border-left: 1px solid #cfc;
202
+ border-right: 1px solid #cfc;
203
+ border-bottom: 1px solid #cfc;
204
+ cursor: pointer;
205
+ }
206
+ div.search_operator:hover {
207
+ padding: 3px;
208
+ margin: 3px;
209
+ border-top: 1px solid #ddd;
210
+ border-left: 1px solid #ddd;
211
+ border-right: 1px solid #888;
212
+ border-bottom: 1px solid #888;
213
+ cursor: pointer;
214
+ }
215
+
216
+
217
+ /*---------------------------------------------------------------
218
+ For Top page
219
+ ---------------------------------------------------------------*/
220
+ table.top_list {
221
+ border-collapse: separate;
222
+ border-spacing: 0px;
223
+ empty-cells: show;
224
+ }
225
+
226
+ table.top_list th, table.top_list td {
227
+ margin: 1px;
228
+ border: 0px;
229
+ padding: 1px 5px 1px 5px;
230
+ }
231
+
232
+ table.top_list th {
233
+ border-top: 1px solid #fca;
234
+ border-left: 1px solid #fca;
235
+ border-right: 1px solid #842;
236
+ border-bottom: 1px solid #842;
237
+ background-color: #c94;
238
+ }
239
+
240
+
241
+ /*---------------------------------------------------------------
242
+ Topic path
243
+ ---------------------------------------------------------------*/
244
+ #page_title {
245
+ width: 8em;
246
+ }
247
+ #topic_path {
248
+ padding-left: 30px;
249
+ }
250
+
251
+ /*---------------------------------------------------------------
252
+ flash message
253
+ ---------------------------------------------------------------*/
254
+ div#edgarj_message_error {
255
+ color: #a00;
256
+ }
257
+ div#edgarj_message_notice {
258
+ color: #0e0;
259
+ }
260
+
261
+ /*---------------------------------------------------------------
262
+ error message
263
+ ---------------------------------------------------------------*/
264
+ .field_with_errors {
265
+ padding: 2px;
266
+ background-color: red;
267
+ display: table;
268
+ }
269
+
270
+ div.error_explanation {
271
+ border: 2px solid red;
272
+ padding: 7px;
273
+ padding-bottom: 0;
274
+ background-color: #f0f0f0;}
275
+
276
+ div.error_explanation h2 {
277
+ text-align: left;
278
+ font-weight: bold;
279
+ padding: 5px 5px 5px 15px;
280
+ font-size: 12px;
281
+ margin: -7px;
282
+ margin-bottom: 0px;
283
+ background-color: #c00;
284
+ color: #fff;}
285
+
286
+ div.error_explanation ul {
287
+ padding-left: 10px;}
288
+
289
+ div.error_explanation ul li {
290
+ font-size: 12px;
291
+ list-style: square;}
292
+
293
+
294
+ /*---------------------------------------------------------------
295
+ fix jquery issue
296
+
297
+ http://forum.jquery.com/topic/jquery-ui-ui-resizable-handle-missing-for-dialog-widget
298
+ ---------------------------------------------------------------*/
299
+ .ui-resizable-handle {
300
+ position: absolute;
301
+ font-size: 0.1px;
302
+ z-index: 99999;
303
+ display: block;
304
+ }
@@ -0,0 +1,65 @@
1
+ #edgarj_menu
2
+ { margin: 0;
3
+ background: #842;
4
+ padding: 0}
5
+
6
+ #edgarj_menu li
7
+ { float: left;
8
+ list-style: none;
9
+ font: 12px Tahoma, Arial}
10
+
11
+ #edgarj_menu li a
12
+ { display: block;
13
+ background: #842;
14
+ padding: 3px 10px;
15
+ text-decoration: none;
16
+ text-align: center;
17
+ border-top: 1px solid #842;
18
+ border-left: 1px solid #842;
19
+ border-right: 1px solid #842;
20
+ border-bottom: 1px solid #842;
21
+ width: 70px;
22
+ color: #EAFFED;
23
+ white-space: nowrap}
24
+
25
+ #edgarj_menu li a:hover
26
+ { background: #942;
27
+ border-top: 1px solid #fdb;
28
+ border-left: 1px solid #fdb;
29
+ border-right: 1px solid #321;
30
+ border-bottom: 1px solid #321;
31
+ }
32
+
33
+ #edgarj_menu li ul
34
+ { margin: 0;
35
+ padding: 0;
36
+ background: #ccc;
37
+ position: absolute;
38
+ visibility: hidden;
39
+ border-top: 1px solid #ccc;
40
+ border-left: 1px solid #eee;
41
+ border-right: 1px solid #888;
42
+ border-bottom: 1px solid #888;}
43
+
44
+ #edgarj_menu li ul li
45
+ { float: none;
46
+ background: #ccc;
47
+ display: inline}
48
+
49
+ #edgarj_menu li ul li a
50
+ { width: auto;
51
+ background: #ccc;
52
+ text-align: left;
53
+ border-top: 1px solid #ccc;
54
+ border-left: 1px solid #ccc;
55
+ border-right: 1px solid #ccc;
56
+ border-bottom: 1px solid #ccc;
57
+ color: #000}
58
+
59
+ #edgarj_menu li ul li a:hover
60
+ { background: #eee;
61
+ border-top: 1px solid #fff;
62
+ border-left: 1px solid #fff;
63
+ border-right: 1px solid #aaa;
64
+ border-bottom: 1px solid #aaa;
65
+ }