beautiful_scaffold 0.3.6 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +2 -0
  3. data/.gitignore +2 -0
  4. data/CHANGELOG +68 -1
  5. data/Gemfile +24 -17
  6. data/README.rdoc +56 -44
  7. data/Rakefile +29 -0
  8. data/beautiful_scaffold.gemspec +8 -7
  9. data/lib/beautiful_scaffold/version.rb +3 -0
  10. data/lib/generators/beautiful_devisecancan_generator.rb +1 -1
  11. data/lib/generators/beautiful_jointable_generator.rb +40 -7
  12. data/lib/generators/beautiful_locale_generator.rb +102 -80
  13. data/lib/generators/beautiful_migration_generator.rb +14 -20
  14. data/lib/generators/beautiful_scaffold_common_methods.rb +88 -29
  15. data/lib/generators/beautiful_scaffold_generator.rb +166 -111
  16. data/lib/generators/templates/app/assets/javascripts/application-bs.js +11 -19
  17. data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +68 -78
  18. data/lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js +23 -42
  19. data/lib/generators/templates/app/assets/javascripts/fixed_menu.js +3 -1
  20. data/lib/generators/templates/app/assets/javascripts/jstree.min.js +6 -0
  21. data/lib/generators/templates/app/assets/stylesheets/application-bs.css +14 -12
  22. data/lib/generators/templates/app/assets/stylesheets/beautiful-scaffold.css.scss +38 -3
  23. data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/32px.png +0 -0
  24. data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/40px.png +0 -0
  25. data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/style.scss +1146 -0
  26. data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/throbber.gif +0 -0
  27. data/lib/generators/templates/app/assets/stylesheets/themes/default/32px.png +0 -0
  28. data/lib/generators/templates/app/assets/stylesheets/themes/default/40px.png +0 -0
  29. data/lib/generators/templates/app/assets/stylesheets/themes/default/style.scss +1102 -0
  30. data/lib/generators/templates/app/assets/stylesheets/themes/default/throbber.gif +0 -0
  31. data/lib/generators/templates/app/controllers/base.rb +31 -14
  32. data/lib/generators/templates/app/controllers/master_base.rb +55 -47
  33. data/lib/generators/templates/app/helpers/beautiful_helper.rb +123 -72
  34. data/lib/generators/templates/app/helpers/model_helper.rb +14 -3
  35. data/lib/generators/templates/app/initializers/link_renderer.rb +24 -17
  36. data/lib/generators/templates/app/initializers/ransack.rb +16 -0
  37. data/lib/generators/templates/app/locales/beautiful_scaffold.ja.yml +50 -0
  38. data/lib/generators/templates/app/models/concerns/fulltext_concern.rb +10 -10
  39. data/lib/generators/templates/app/views/_form.html.erb +4 -1
  40. data/lib/generators/templates/app/views/_form_habtm_tag.html.erb +6 -2
  41. data/lib/generators/templates/app/views/_mass_inserting.html.erb +40 -31
  42. data/lib/generators/templates/app/views/_modal_columns.html.erb +4 -4
  43. data/lib/generators/templates/app/views/edit.html.erb +1 -3
  44. data/lib/generators/templates/app/views/index.html.erb +84 -58
  45. data/lib/generators/templates/app/views/layout.html.erb +29 -47
  46. data/lib/generators/templates/app/views/new.html.erb +0 -2
  47. data/lib/generators/templates/app/views/partials/_forget_password.html.erb +2 -2
  48. data/lib/generators/templates/app/views/partials/_form_field.html.erb +7 -33
  49. data/lib/generators/templates/app/views/partials/_index_batch.html.erb +1 -1
  50. data/lib/generators/templates/app/views/partials/_index_column.html.erb +4 -6
  51. data/lib/generators/templates/app/views/partials/_index_header.html.erb +1 -1
  52. data/lib/generators/templates/app/views/partials/_index_search.html.erb +2 -4
  53. data/lib/generators/templates/app/views/partials/_index_search_default_fields.html.erb +1 -1
  54. data/lib/generators/templates/app/views/partials/_register_form.html.erb +2 -2
  55. data/lib/generators/templates/app/views/partials/_show_field.html.erb +3 -3
  56. data/lib/generators/templates/app/views/partials/_sign_in_form.html.erb +1 -1
  57. data/lib/generators/templates/app/views/partials/_sign_in_sign_out.html.erb +2 -2
  58. data/lib/generators/templates/app/views/show.html.erb +2 -2
  59. data/lib/generators/templates/app/views/treeview.html.erb +8 -5
  60. metadata +41 -187
  61. data/lib/generators/templates/app/assets/javascripts/bootstrap-datepicker.js +0 -834
  62. data/lib/generators/templates/app/assets/javascripts/bootstrap-timepicker.js +0 -797
  63. data/lib/generators/templates/app/assets/javascripts/jquery.jstree.js +0 -4551
  64. data/lib/generators/templates/app/assets/javascripts/jquery.livequery.js +0 -226
  65. data/lib/generators/templates/app/assets/stylesheets/bootstrap_and_overrides.css.less +0 -40
  66. data/lib/generators/templates/app/assets/stylesheets/datepicker.css +0 -224
  67. data/lib/generators/templates/app/assets/stylesheets/reset.css +0 -48
  68. data/lib/generators/templates/app/assets/stylesheets/themes/default/d.gif +0 -0
  69. data/lib/generators/templates/app/assets/stylesheets/themes/default/d.png +0 -0
  70. data/lib/generators/templates/app/assets/stylesheets/themes/default/style.css +0 -74
  71. data/lib/generators/templates/app/assets/stylesheets/timepicker.css +0 -89
  72. data/lib/generators/templates/markitup/jquery.markitup.js +0 -593
  73. data/lib/generators/templates/markitup/sets/bbcode/images/bold.png +0 -0
  74. data/lib/generators/templates/markitup/sets/bbcode/images/clean.png +0 -0
  75. data/lib/generators/templates/markitup/sets/bbcode/images/code.png +0 -0
  76. data/lib/generators/templates/markitup/sets/bbcode/images/fonts.png +0 -0
  77. data/lib/generators/templates/markitup/sets/bbcode/images/italic.png +0 -0
  78. data/lib/generators/templates/markitup/sets/bbcode/images/link.png +0 -0
  79. data/lib/generators/templates/markitup/sets/bbcode/images/list-bullet.png +0 -0
  80. data/lib/generators/templates/markitup/sets/bbcode/images/list-item.png +0 -0
  81. data/lib/generators/templates/markitup/sets/bbcode/images/list-numeric.png +0 -0
  82. data/lib/generators/templates/markitup/sets/bbcode/images/picture.png +0 -0
  83. data/lib/generators/templates/markitup/sets/bbcode/images/preview.png +0 -0
  84. data/lib/generators/templates/markitup/sets/bbcode/images/quotes.png +0 -0
  85. data/lib/generators/templates/markitup/sets/bbcode/images/stroke.png +0 -0
  86. data/lib/generators/templates/markitup/sets/bbcode/images/underline.png +0 -0
  87. data/lib/generators/templates/markitup/sets/bbcode/readme.txt +0 -11
  88. data/lib/generators/templates/markitup/sets/bbcode/set.js +0 -39
  89. data/lib/generators/templates/markitup/sets/bbcode/style.css +0 -47
  90. data/lib/generators/templates/markitup/sets/default/images/bold.png +0 -0
  91. data/lib/generators/templates/markitup/sets/default/images/clean.png +0 -0
  92. data/lib/generators/templates/markitup/sets/default/images/image.png +0 -0
  93. data/lib/generators/templates/markitup/sets/default/images/italic.png +0 -0
  94. data/lib/generators/templates/markitup/sets/default/images/link.png +0 -0
  95. data/lib/generators/templates/markitup/sets/default/images/list-bullet.png +0 -0
  96. data/lib/generators/templates/markitup/sets/default/images/list-numeric.png +0 -0
  97. data/lib/generators/templates/markitup/sets/default/images/picture.png +0 -0
  98. data/lib/generators/templates/markitup/sets/default/images/preview.png +0 -0
  99. data/lib/generators/templates/markitup/sets/default/images/stroke.png +0 -0
  100. data/lib/generators/templates/markitup/sets/default/set.js +0 -30
  101. data/lib/generators/templates/markitup/sets/default/style.css +0 -34
  102. data/lib/generators/templates/markitup/sets/html/images/bold.png +0 -0
  103. data/lib/generators/templates/markitup/sets/html/images/clean.png +0 -0
  104. data/lib/generators/templates/markitup/sets/html/images/h1.png +0 -0
  105. data/lib/generators/templates/markitup/sets/html/images/h2.png +0 -0
  106. data/lib/generators/templates/markitup/sets/html/images/h3.png +0 -0
  107. data/lib/generators/templates/markitup/sets/html/images/h4.png +0 -0
  108. data/lib/generators/templates/markitup/sets/html/images/h5.png +0 -0
  109. data/lib/generators/templates/markitup/sets/html/images/h6.png +0 -0
  110. data/lib/generators/templates/markitup/sets/html/images/image.png +0 -0
  111. data/lib/generators/templates/markitup/sets/html/images/italic.png +0 -0
  112. data/lib/generators/templates/markitup/sets/html/images/link.png +0 -0
  113. data/lib/generators/templates/markitup/sets/html/images/list-bullet.png +0 -0
  114. data/lib/generators/templates/markitup/sets/html/images/list-item.png +0 -0
  115. data/lib/generators/templates/markitup/sets/html/images/list-numeric.png +0 -0
  116. data/lib/generators/templates/markitup/sets/html/images/paragraph.png +0 -0
  117. data/lib/generators/templates/markitup/sets/html/images/picture.png +0 -0
  118. data/lib/generators/templates/markitup/sets/html/images/preview.png +0 -0
  119. data/lib/generators/templates/markitup/sets/html/images/stroke.png +0 -0
  120. data/lib/generators/templates/markitup/sets/html/readme.txt +0 -11
  121. data/lib/generators/templates/markitup/sets/html/set.js +0 -39
  122. data/lib/generators/templates/markitup/sets/html/style.css +0 -59
  123. data/lib/generators/templates/markitup/sets/markdown/images/bold.png +0 -0
  124. data/lib/generators/templates/markitup/sets/markdown/images/code.png +0 -0
  125. data/lib/generators/templates/markitup/sets/markdown/images/h1.png +0 -0
  126. data/lib/generators/templates/markitup/sets/markdown/images/h2.png +0 -0
  127. data/lib/generators/templates/markitup/sets/markdown/images/h3.png +0 -0
  128. data/lib/generators/templates/markitup/sets/markdown/images/h4.png +0 -0
  129. data/lib/generators/templates/markitup/sets/markdown/images/h5.png +0 -0
  130. data/lib/generators/templates/markitup/sets/markdown/images/h6.png +0 -0
  131. data/lib/generators/templates/markitup/sets/markdown/images/italic.png +0 -0
  132. data/lib/generators/templates/markitup/sets/markdown/images/link.png +0 -0
  133. data/lib/generators/templates/markitup/sets/markdown/images/list-bullet.png +0 -0
  134. data/lib/generators/templates/markitup/sets/markdown/images/list-numeric.png +0 -0
  135. data/lib/generators/templates/markitup/sets/markdown/images/picture.png +0 -0
  136. data/lib/generators/templates/markitup/sets/markdown/images/preview.png +0 -0
  137. data/lib/generators/templates/markitup/sets/markdown/images/quotes.png +0 -0
  138. data/lib/generators/templates/markitup/sets/markdown/readme.txt +0 -11
  139. data/lib/generators/templates/markitup/sets/markdown/set.js +0 -52
  140. data/lib/generators/templates/markitup/sets/markdown/style.css +0 -54
  141. data/lib/generators/templates/markitup/sets/textile/images/bold.png +0 -0
  142. data/lib/generators/templates/markitup/sets/textile/images/code.png +0 -0
  143. data/lib/generators/templates/markitup/sets/textile/images/h1.png +0 -0
  144. data/lib/generators/templates/markitup/sets/textile/images/h2.png +0 -0
  145. data/lib/generators/templates/markitup/sets/textile/images/h3.png +0 -0
  146. data/lib/generators/templates/markitup/sets/textile/images/h4.png +0 -0
  147. data/lib/generators/templates/markitup/sets/textile/images/h5.png +0 -0
  148. data/lib/generators/templates/markitup/sets/textile/images/h6.png +0 -0
  149. data/lib/generators/templates/markitup/sets/textile/images/italic.png +0 -0
  150. data/lib/generators/templates/markitup/sets/textile/images/link.png +0 -0
  151. data/lib/generators/templates/markitup/sets/textile/images/list-bullet.png +0 -0
  152. data/lib/generators/templates/markitup/sets/textile/images/list-numeric.png +0 -0
  153. data/lib/generators/templates/markitup/sets/textile/images/paragraph.png +0 -0
  154. data/lib/generators/templates/markitup/sets/textile/images/picture.png +0 -0
  155. data/lib/generators/templates/markitup/sets/textile/images/preview.png +0 -0
  156. data/lib/generators/templates/markitup/sets/textile/images/quotes.png +0 -0
  157. data/lib/generators/templates/markitup/sets/textile/images/stroke.png +0 -0
  158. data/lib/generators/templates/markitup/sets/textile/readme.txt +0 -11
  159. data/lib/generators/templates/markitup/sets/textile/set.js +0 -40
  160. data/lib/generators/templates/markitup/sets/textile/style.css +0 -60
  161. data/lib/generators/templates/markitup/sets/wiki/images/bold.png +0 -0
  162. data/lib/generators/templates/markitup/sets/wiki/images/code.png +0 -0
  163. data/lib/generators/templates/markitup/sets/wiki/images/h1.png +0 -0
  164. data/lib/generators/templates/markitup/sets/wiki/images/h2.png +0 -0
  165. data/lib/generators/templates/markitup/sets/wiki/images/h3.png +0 -0
  166. data/lib/generators/templates/markitup/sets/wiki/images/h4.png +0 -0
  167. data/lib/generators/templates/markitup/sets/wiki/images/h5.png +0 -0
  168. data/lib/generators/templates/markitup/sets/wiki/images/h6.png +0 -0
  169. data/lib/generators/templates/markitup/sets/wiki/images/italic.png +0 -0
  170. data/lib/generators/templates/markitup/sets/wiki/images/link.png +0 -0
  171. data/lib/generators/templates/markitup/sets/wiki/images/list-bullet.png +0 -0
  172. data/lib/generators/templates/markitup/sets/wiki/images/list-numeric.png +0 -0
  173. data/lib/generators/templates/markitup/sets/wiki/images/picture.png +0 -0
  174. data/lib/generators/templates/markitup/sets/wiki/images/preview.png +0 -0
  175. data/lib/generators/templates/markitup/sets/wiki/images/quotes.png +0 -0
  176. data/lib/generators/templates/markitup/sets/wiki/images/stroke.png +0 -0
  177. data/lib/generators/templates/markitup/sets/wiki/images/url.png +0 -0
  178. data/lib/generators/templates/markitup/sets/wiki/readme.txt +0 -11
  179. data/lib/generators/templates/markitup/sets/wiki/set.js +0 -37
  180. data/lib/generators/templates/markitup/sets/wiki/style.css +0 -57
  181. data/lib/generators/templates/markitup/skins/markitup/images/bg-container.png +0 -0
  182. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
  183. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
  184. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-html.png +0 -0
  185. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-json.png +0 -0
  186. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
  187. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
  188. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
  189. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
  190. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor.png +0 -0
  191. data/lib/generators/templates/markitup/skins/markitup/images/handle.png +0 -0
  192. data/lib/generators/templates/markitup/skins/markitup/images/menu.png +0 -0
  193. data/lib/generators/templates/markitup/skins/markitup/images/submenu.png +0 -0
  194. data/lib/generators/templates/markitup/skins/markitup/style.css +0 -147
  195. data/lib/generators/templates/markitup/skins/simple/images/handle.png +0 -0
  196. data/lib/generators/templates/markitup/skins/simple/images/menu.png +0 -0
  197. data/lib/generators/templates/markitup/skins/simple/images/submenu.png +0 -0
  198. data/lib/generators/templates/markitup/skins/simple/style.css +0 -118
  199. data/lib/generators/templates/markitup/templates/preview.css +0 -5
  200. data/lib/generators/templates/markitup/templates/preview.html +0 -11
@@ -1,48 +0,0 @@
1
- /* http://meyerweb.com/eric/tools/css/reset/
2
- v2.0 | 20110126
3
- License: none (public domain)
4
- */
5
-
6
- html, body, div, span, applet, object, iframe,
7
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
- a, abbr, acronym, address, big, cite, code,
9
- del, dfn, em, img, ins, kbd, q, s, samp,
10
- small, strike, strong, sub, sup, tt, var,
11
- b, u, i, center,
12
- dl, dt, dd, ol, ul, li,
13
- fieldset, form, label, legend,
14
- table, caption, tbody, tfoot, thead, tr, th, td,
15
- article, aside, canvas, details, embed,
16
- figure, figcaption, footer, header, hgroup,
17
- menu, nav, output, ruby, section, summary,
18
- time, mark, audio, video {
19
- margin: 0;
20
- padding: 0;
21
- border: 0;
22
- font-size: 100%;
23
- font: inherit;
24
- vertical-align: baseline;
25
- }
26
- /* HTML5 display-role reset for older browsers */
27
- article, aside, details, figcaption, figure,
28
- footer, header, hgroup, menu, nav, section {
29
- display: block;
30
- }
31
- body {
32
- line-height: 1;
33
- }
34
- ol, ul {
35
- list-style: none;
36
- }
37
- blockquote, q {
38
- quotes: none;
39
- }
40
- blockquote:before, blockquote:after,
41
- q:before, q:after {
42
- content: '';
43
- content: none;
44
- }
45
- table {
46
- border-collapse: collapse;
47
- border-spacing: 0;
48
- }
@@ -1,74 +0,0 @@
1
- /*
2
- * jsTree default theme 1.0
3
- * Supported features: dots/no-dots, icons/no-icons, focused, loading
4
- * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
5
- */
6
-
7
- .jstree-default li,
8
- .jstree-default ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
9
- .jstree-default li { background-position:-90px 0; background-repeat:repeat-y; }
10
- .jstree-default li.jstree-last { background:transparent; }
11
- .jstree-default .jstree-open > ins { background-position:-72px 0; }
12
- .jstree-default .jstree-closed > ins { background-position:-54px 0; }
13
- .jstree-default .jstree-leaf > ins { background-position:-36px 0; }
14
-
15
- .jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
16
- .jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
17
- .jstree-default a .jstree-icon { background-position:-56px -19px; }
18
- .jstree-default a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
19
-
20
- /*.jstree-default.jstree-focused { background:#ffffee; }*/
21
-
22
- .jstree-default .jstree-no-dots li,
23
- .jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
24
- .jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
25
- .jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
26
-
27
- .jstree-default .jstree-no-icons a .jstree-icon { display:none; }
28
-
29
- .jstree-default .jstree-search { font-style:italic; }
30
-
31
- .jstree-default .jstree-no-icons .jstree-checkbox { display:inline-block; }
32
- .jstree-default .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
33
- .jstree-default .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
34
- .jstree-default .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
35
- .jstree-default .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
36
- .jstree-default .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
37
- .jstree-default .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
38
- .jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
39
-
40
- #vakata-dragged.jstree-default ins { background:transparent !important; }
41
- #vakata-dragged.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
42
- #vakata-dragged.jstree-default .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
43
- #jstree-marker.jstree-default { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
44
-
45
- .jstree-default a.jstree-search { color:aqua; }
46
- .jstree-default .jstree-locked a { color:silver; cursor:default; }
47
-
48
- #vakata-contextmenu.jstree-default-context,
49
- #vakata-contextmenu.jstree-default-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
50
- #vakata-contextmenu.jstree-default-context li { }
51
- #vakata-contextmenu.jstree-default-context a { color:black; }
52
- #vakata-contextmenu.jstree-default-context a:hover,
53
- #vakata-contextmenu.jstree-default-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
54
- #vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a,
55
- #vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
56
- #vakata-contextmenu.jstree-default-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
57
- #vakata-contextmenu.jstree-default-context li ul { margin-left:-4px; }
58
-
59
- /* IE6 BEGIN */
60
- .jstree-default li,
61
- .jstree-default ins,
62
- #vakata-dragged.jstree-default .jstree-invalid,
63
- #vakata-dragged.jstree-default .jstree-ok,
64
- #jstree-marker.jstree-default { _background-image:url("d.gif"); }
65
- .jstree-default .jstree-open ins { _background-position:-72px 0; }
66
- .jstree-default .jstree-closed ins { _background-position:-54px 0; }
67
- .jstree-default .jstree-leaf ins { _background-position:-36px 0; }
68
- .jstree-default a ins.jstree-icon { _background-position:-56px -19px; }
69
- #vakata-contextmenu.jstree-default-context ins { _display:none; }
70
- #vakata-contextmenu.jstree-default-context li { _zoom:1; }
71
- .jstree-default .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
72
- .jstree-default .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
73
- .jstree-default .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
74
- /* IE6 END */
@@ -1,89 +0,0 @@
1
-
2
- .bootstrap-timepicker.dropdown-menu {
3
- border-radius: 4px 4px 4px 4px;
4
- display: none;
5
- left: 0;
6
- margin-top: 1px;
7
- padding: 4px;
8
- top: 0;
9
- }
10
- .bootstrap-timepicker.dropdown-menu.open {
11
- display: inline-block;
12
- }
13
- .bootstrap-timepicker.dropdown-menu:before {
14
- border-bottom: 7px solid rgba(0, 0, 0, 0.2);
15
- border-left: 7px solid transparent;
16
- border-right: 7px solid transparent;
17
- content: "";
18
- left: 6px;
19
- position: absolute;
20
- top: -7px;
21
- }
22
- .bootstrap-timepicker.dropdown-menu:after {
23
- border-bottom: 6px solid #FFFFFF;
24
- border-left: 6px solid transparent;
25
- border-right: 6px solid transparent;
26
- content: "";
27
- left: 7px;
28
- position: absolute;
29
- top: -6px;
30
- }
31
- .bootstrap-timepicker.modal .modal-dialog {
32
- width: 200px;
33
- }
34
- .bootstrap-timepicker.modal .modal-content {
35
- padding: 0;
36
- }
37
- .bootstrap-timepicker table {
38
- margin: 0;
39
- width: 100%;
40
- }
41
- .bootstrap-timepicker table td {
42
- height: 30px;
43
- margin: 0;
44
- padding: 2px;
45
- text-align: center;
46
- width: 49%;
47
- }
48
- .bootstrap-timepicker table.show-meridian td, .bootstrap-timepicker table.show-seconds td {
49
- width: 32%;
50
- }
51
- .bootstrap-timepicker table.show-seconds.show-meridian td {
52
- width: 23.5%;
53
- }
54
- .bootstrap-timepicker table td.separator {
55
- width: 2% !important;
56
- }
57
- .bootstrap-timepicker table td span {
58
- width: 100%;
59
- }
60
- .bootstrap-timepicker table td a {
61
- border: 1px solid transparent;
62
- display: inline-block;
63
- margin: 0;
64
- outline: 0 none;
65
- padding: 8px 0;
66
- width: 90%;
67
- }
68
- .bootstrap-timepicker table td a:hover {
69
- background-color: #EEEEEE;
70
- border-color: #DDDDDD;
71
- border-radius: 4px 4px 4px 4px;
72
- }
73
- .bootstrap-timepicker table td a i {
74
- margin-top: 2px;
75
- }
76
- .bootstrap-timepicker table td input {
77
- margin: 0;
78
- text-align: center;
79
- width: 25px;
80
- }
81
- .bootstrap-timepicker-component .input-group-addon {
82
- cursor: pointer;
83
- }
84
- .bootstrap-timepicker-component .input-group-addon i {
85
- display: block;
86
- height: 16px;
87
- width: 16px;
88
- }
89
-
@@ -1,593 +0,0 @@
1
- // ----------------------------------------------------------------------------
2
- // markItUp! Universal MarkUp Engine, JQuery plugin
3
- // v 1.1.x
4
- // Dual licensed under the MIT and GPL licenses.
5
- // ----------------------------------------------------------------------------
6
- // Copyright (C) 2007-2011 Jay Salvat
7
- // http://markitup.jaysalvat.com/
8
- // ----------------------------------------------------------------------------
9
- // Permission is hereby granted, free of charge, to any person obtaining a copy
10
- // of this software and associated documentation files (the "Software"), to deal
11
- // in the Software without restriction, including without limitation the rights
12
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- // copies of the Software, and to permit persons to whom the Software is
14
- // furnished to do so, subject to the following conditions:
15
- //
16
- // The above copyright notice and this permission notice shall be included in
17
- // all copies or substantial portions of the Software.
18
- //
19
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
- // THE SOFTWARE.
26
- // ----------------------------------------------------------------------------
27
- (function($) {
28
- $.fn.markItUp = function(settings, extraSettings) {
29
- var options, ctrlKey, shiftKey, altKey;
30
- ctrlKey = shiftKey = altKey = false;
31
-
32
- options = { id: '',
33
- nameSpace: '',
34
- root: '',
35
- previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes'
36
- previewAutoRefresh: true,
37
- previewPosition: 'after',
38
- previewTemplatePath: '~/templates/preview.html',
39
- previewParser: false,
40
- previewParserPath: '',
41
- previewParserVar: 'data',
42
- resizeHandle: true,
43
- beforeInsert: '',
44
- afterInsert: '',
45
- onEnter: {},
46
- onShiftEnter: {},
47
- onCtrlEnter: {},
48
- onTab: {},
49
- markupSet: [ { /* set */ } ]
50
- };
51
- $.extend(options, settings, extraSettings);
52
-
53
- // compute markItUp! path
54
- if (!options.root) {
55
- $('script').each(function(a, tag) {
56
- miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
57
- if (miuScript !== null) {
58
- options.root = miuScript[1];
59
- }
60
- });
61
- }
62
-
63
- return this.each(function() {
64
- var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
65
- clicked, hash, header, footer, previewWindow, template, iFrame, abort;
66
- $$ = $(this);
67
- textarea = this;
68
- levels = [];
69
- abort = false;
70
- scrollPosition = caretPosition = 0;
71
- caretOffset = -1;
72
-
73
- options.previewParserPath = localize(options.previewParserPath);
74
- options.previewTemplatePath = localize(options.previewTemplatePath);
75
-
76
- // apply the computed path to ~/
77
- function localize(data, inText) {
78
- if (inText) {
79
- return data.replace(/("|')~\//g, "$1"+options.root);
80
- }
81
- return data.replace(/^~\//, options.root);
82
- }
83
-
84
- // init and build editor
85
- function init() {
86
- id = ''; nameSpace = '';
87
- if (options.id) {
88
- id = 'id="'+options.id+'"';
89
- } else if ($$.attr("id")) {
90
- id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';
91
-
92
- }
93
- if (options.nameSpace) {
94
- nameSpace = 'class="'+options.nameSpace+'"';
95
- }
96
- $$.wrap('<div '+nameSpace+'></div>');
97
- $$.wrap('<div '+id+' class="markItUp"></div>');
98
- $$.wrap('<div class="markItUpContainer"></div>');
99
- $$.addClass("markItUpEditor");
100
-
101
- // add the header before the textarea
102
- header = $('<div class="markItUpHeader"></div>').insertBefore($$);
103
- $(dropMenus(options.markupSet)).appendTo(header);
104
-
105
- // add the footer after the textarea
106
- footer = $('<div class="markItUpFooter"></div>').insertAfter($$);
107
-
108
- // add the resize handle after textarea
109
- if (options.resizeHandle === true && $.browser.safari !== true) {
110
- resizeHandle = $('<div class="markItUpResizeHandle"></div>')
111
- .insertAfter($$)
112
- .bind("mousedown", function(e) {
113
- var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
114
- mouseMove = function(e) {
115
- $$.css("height", Math.max(20, e.clientY+h-y)+"px");
116
- return false;
117
- };
118
- mouseUp = function(e) {
119
- $("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp);
120
- return false;
121
- };
122
- $("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp);
123
- });
124
- footer.append(resizeHandle);
125
- }
126
-
127
- // listen key events
128
- $$.keydown(keyPressed).keyup(keyPressed);
129
-
130
- // bind an event to catch external calls
131
- $$.bind("insertion", function(e, settings) {
132
- if (settings.target !== false) {
133
- get();
134
- }
135
- if (textarea === $.markItUp.focused) {
136
- markup(settings);
137
- }
138
- });
139
-
140
- // remember the last focus
141
- $$.focus(function() {
142
- $.markItUp.focused = this;
143
- });
144
- }
145
-
146
- // recursively build header with dropMenus from markupset
147
- function dropMenus(markupSet) {
148
- var ul = $('<ul></ul>'), i = 0;
149
- $('li:hover > ul', ul).css('display', 'block');
150
- $.each(markupSet, function() {
151
- var button = this, t = '', title, li, j;
152
- title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
153
- key = (button.key) ? 'accesskey="'+button.key+'"' : '';
154
- if (button.separator) {
155
- li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
156
- } else {
157
- i++;
158
- for (j = levels.length -1; j >= 0; j--) {
159
- t += levels[j]+"-";
160
- }
161
- li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
162
- .bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click
163
- return false;
164
- }).click(function() {
165
- return false;
166
- }).bind("focusin", function(){
167
- $$.focus();
168
- }).mouseup(function() {
169
- if (button.call) {
170
- eval(button.call)();
171
- }
172
- setTimeout(function() { markup(button) },1);
173
- return false;
174
- }).hover(function() {
175
- $('> ul', this).show();
176
- $(document).one('click', function() { // close dropmenu if click outside
177
- $('ul ul', header).hide();
178
- }
179
- );
180
- }, function() {
181
- $('> ul', this).hide();
182
- }
183
- ).appendTo(ul);
184
- if (button.dropMenu) {
185
- levels.push(i);
186
- $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
187
- }
188
- }
189
- });
190
- levels.pop();
191
- return ul;
192
- }
193
-
194
- // markItUp! markups
195
- function magicMarkups(string) {
196
- if (string) {
197
- string = string.toString();
198
- string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
199
- function(x, a) {
200
- var b = a.split('|!|');
201
- if (altKey === true) {
202
- return (b[1] !== undefined) ? b[1] : b[0];
203
- } else {
204
- return (b[1] === undefined) ? "" : b[0];
205
- }
206
- }
207
- );
208
- // [![prompt]!], [![prompt:!:value]!]
209
- string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
210
- function(x, a) {
211
- var b = a.split(':!:');
212
- if (abort === true) {
213
- return false;
214
- }
215
- value = prompt(b[0], (b[1]) ? b[1] : '');
216
- if (value === null) {
217
- abort = true;
218
- }
219
- return value;
220
- }
221
- );
222
- return string;
223
- }
224
- return "";
225
- }
226
-
227
- // prepare action
228
- function prepare(action) {
229
- if ($.isFunction(action)) {
230
- action = action(hash);
231
- }
232
- return magicMarkups(action);
233
- }
234
-
235
- // build block to insert
236
- function build(string) {
237
- var openWith = prepare(clicked.openWith);
238
- var placeHolder = prepare(clicked.placeHolder);
239
- var replaceWith = prepare(clicked.replaceWith);
240
- var closeWith = prepare(clicked.closeWith);
241
- var openBlockWith = prepare(clicked.openBlockWith);
242
- var closeBlockWith = prepare(clicked.closeBlockWith);
243
- var multiline = clicked.multiline;
244
-
245
- if (replaceWith !== "") {
246
- block = openWith + replaceWith + closeWith;
247
- } else if (selection === '' && placeHolder !== '') {
248
- block = openWith + placeHolder + closeWith;
249
- } else {
250
- string = string || selection;
251
-
252
- var lines = selection.split(/\r?\n/), blocks = [];
253
-
254
- for (var l=0; l < lines.length; l++) {
255
- line = lines[l];
256
- var trailingSpaces;
257
- if (trailingSpaces = line.match(/ *$/)) {
258
- blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces);
259
- } else {
260
- blocks.push(openWith + line + closeWith);
261
- }
262
- }
263
-
264
- block = blocks.join("\n");
265
- }
266
-
267
- block = openBlockWith + block + closeBlockWith;
268
-
269
- return { block:block,
270
- openWith:openWith,
271
- replaceWith:replaceWith,
272
- placeHolder:placeHolder,
273
- closeWith:closeWith
274
- };
275
- }
276
-
277
- // define markup to insert
278
- function markup(button) {
279
- var len, j, n, i;
280
- hash = clicked = button;
281
- get();
282
- $.extend(hash, { line:"",
283
- root:options.root,
284
- textarea:textarea,
285
- selection:(selection||''),
286
- caretPosition:caretPosition,
287
- ctrlKey:ctrlKey,
288
- shiftKey:shiftKey,
289
- altKey:altKey
290
- }
291
- );
292
- // callbacks before insertion
293
- prepare(options.beforeInsert);
294
- prepare(clicked.beforeInsert);
295
- if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
296
- prepare(clicked.beforeMultiInsert);
297
- }
298
- $.extend(hash, { line:1 });
299
-
300
- if ((ctrlKey === true && shiftKey === true)) {
301
- lines = selection.split(/\r?\n/);
302
- for (j = 0, n = lines.length, i = 0; i < n; i++) {
303
- if ($.trim(lines[i]) !== '') {
304
- $.extend(hash, { line:++j, selection:lines[i] } );
305
- lines[i] = build(lines[i]).block;
306
- } else {
307
- lines[i] = "";
308
- }
309
- }
310
- string = { block:lines.join('\n')};
311
- start = caretPosition;
312
- len = string.block.length + (($.browser.opera) ? n-1 : 0);
313
- } else if (ctrlKey === true) {
314
- string = build(selection);
315
- start = caretPosition + string.openWith.length;
316
- len = string.block.length - string.openWith.length - string.closeWith.length;
317
- len = len - (string.block.match(/ $/) ? 1 : 0);
318
- len -= fixIeBug(string.block);
319
- } else if (shiftKey === true) {
320
- string = build(selection);
321
- start = caretPosition;
322
- len = string.block.length;
323
- len -= fixIeBug(string.block);
324
- } else {
325
- string = build(selection);
326
- start = caretPosition + string.block.length ;
327
- len = 0;
328
- start -= fixIeBug(string.block);
329
- }
330
- if ((selection === '' && string.replaceWith === '')) {
331
- caretOffset += fixOperaBug(string.block);
332
-
333
- start = caretPosition + string.openWith.length;
334
- len = string.block.length - string.openWith.length - string.closeWith.length;
335
-
336
- caretOffset = $$.val().substring(caretPosition, $$.val().length).length;
337
- caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
338
- }
339
- $.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );
340
-
341
- if (string.block !== selection && abort === false) {
342
- insert(string.block);
343
- set(start, len);
344
- } else {
345
- caretOffset = -1;
346
- }
347
- get();
348
-
349
- $.extend(hash, { line:'', selection:selection });
350
-
351
- // callbacks after insertion
352
- if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
353
- prepare(clicked.afterMultiInsert);
354
- }
355
- prepare(clicked.afterInsert);
356
- prepare(options.afterInsert);
357
-
358
- // refresh preview if opened
359
- if (previewWindow && options.previewAutoRefresh) {
360
- refreshPreview();
361
- }
362
-
363
- // reinit keyevent
364
- shiftKey = altKey = ctrlKey = abort = false;
365
- }
366
-
367
- // Substract linefeed in Opera
368
- function fixOperaBug(string) {
369
- if ($.browser.opera) {
370
- return string.length - string.replace(/\n*/g, '').length;
371
- }
372
- return 0;
373
- }
374
- // Substract linefeed in IE
375
- function fixIeBug(string) {
376
- if ($.browser.msie) {
377
- return string.length - string.replace(/\r*/g, '').length;
378
- }
379
- return 0;
380
- }
381
-
382
- // add markup
383
- function insert(block) {
384
- if (document.selection) {
385
- var newSelection = document.selection.createRange();
386
- newSelection.text = block;
387
- } else {
388
- textarea.value = textarea.value.substring(0, caretPosition) + block + textarea.value.substring(caretPosition + selection.length, textarea.value.length);
389
- }
390
- }
391
-
392
- // set a selection
393
- function set(start, len) {
394
- if (textarea.createTextRange){
395
- // quick fix to make it work on Opera 9.5
396
- if ($.browser.opera && $.browser.version >= 9.5 && len == 0) {
397
- return false;
398
- }
399
- range = textarea.createTextRange();
400
- range.collapse(true);
401
- range.moveStart('character', start);
402
- range.moveEnd('character', len);
403
- range.select();
404
- } else if (textarea.setSelectionRange ){
405
- textarea.setSelectionRange(start, start + len);
406
- }
407
- textarea.scrollTop = scrollPosition;
408
- textarea.focus();
409
- }
410
-
411
- // get the selection
412
- function get() {
413
- textarea.focus();
414
-
415
- scrollPosition = textarea.scrollTop;
416
- if (document.selection) {
417
- selection = document.selection.createRange().text;
418
- if ($.browser.msie) { // ie
419
- var range = document.selection.createRange(), rangeCopy = range.duplicate();
420
- rangeCopy.moveToElementText(textarea);
421
- caretPosition = -1;
422
- while(rangeCopy.inRange(range)) {
423
- rangeCopy.moveStart('character');
424
- caretPosition ++;
425
- }
426
- } else { // opera
427
- caretPosition = textarea.selectionStart;
428
- }
429
- } else { // gecko & webkit
430
- caretPosition = textarea.selectionStart;
431
-
432
- selection = textarea.value.substring(caretPosition, textarea.selectionEnd);
433
- }
434
- return selection;
435
- }
436
-
437
- // open preview window
438
- function preview() {
439
- if (!previewWindow || previewWindow.closed) {
440
- if (options.previewInWindow) {
441
- previewWindow = window.open('', 'preview', options.previewInWindow);
442
- $(window).unload(function() {
443
- previewWindow.close();
444
- });
445
- } else {
446
- iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
447
- if (options.previewPosition == 'after') {
448
- iFrame.insertAfter(footer);
449
- } else {
450
- iFrame.insertBefore(header);
451
- }
452
- previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1];
453
- }
454
- } else if (altKey === true) {
455
- if (iFrame) {
456
- iFrame.remove();
457
- } else {
458
- previewWindow.close();
459
- }
460
- previewWindow = iFrame = false;
461
- }
462
- if (!options.previewAutoRefresh) {
463
- refreshPreview();
464
- }
465
- if (options.previewInWindow) {
466
- previewWindow.focus();
467
- }
468
- }
469
-
470
- // refresh Preview window
471
- function refreshPreview() {
472
- renderPreview();
473
- }
474
-
475
- function renderPreview() {
476
- var phtml;
477
- if (options.previewParser && typeof options.previewParser === 'function') {
478
- var data = options.previewParser( $$.val() );
479
- writeInPreview( localize(data, 1) );
480
- } else if (options.previewParserPath !== '') {
481
- $.ajax({
482
- type: 'POST',
483
- dataType: 'text',
484
- global: false,
485
- url: options.previewParserPath,
486
- data: options.previewParserVar+'='+encodeURIComponent($$.val()),
487
- success: function(data) {
488
- writeInPreview( localize(data, 1) );
489
- }
490
- });
491
- } else {
492
- if (!template) {
493
- $.ajax({
494
- url: options.previewTemplatePath,
495
- dataType: 'text',
496
- global: false,
497
- success: function(data) {
498
- writeInPreview( localize(data, 1).replace(/<!-- content -->/g, $$.val()) );
499
- }
500
- });
501
- }
502
- }
503
- return false;
504
- }
505
-
506
- function writeInPreview(data) {
507
- if (previewWindow.document) {
508
- try {
509
- sp = previewWindow.document.documentElement.scrollTop
510
- } catch(e) {
511
- sp = 0;
512
- }
513
- previewWindow.document.open();
514
- previewWindow.document.write(data);
515
- previewWindow.document.close();
516
- previewWindow.document.documentElement.scrollTop = sp;
517
- }
518
- }
519
-
520
- // set keys pressed
521
- function keyPressed(e) {
522
- shiftKey = e.shiftKey;
523
- altKey = e.altKey;
524
- ctrlKey = (!(e.altKey && e.ctrlKey)) ? (e.ctrlKey || e.metaKey) : false;
525
-
526
- if (e.type === 'keydown') {
527
- if (ctrlKey === true) {
528
- li = $('a[accesskey="'+String.fromCharCode(e.keyCode)+'"]', header).parent('li');
529
- if (li.length !== 0) {
530
- ctrlKey = false;
531
- setTimeout(function() {
532
- li.triggerHandler('mouseup');
533
- },1);
534
- return false;
535
- }
536
- }
537
- if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
538
- if (ctrlKey === true) { // Enter + Ctrl
539
- ctrlKey = false;
540
- markup(options.onCtrlEnter);
541
- return options.onCtrlEnter.keepDefault;
542
- } else if (shiftKey === true) { // Enter + Shift
543
- shiftKey = false;
544
- markup(options.onShiftEnter);
545
- return options.onShiftEnter.keepDefault;
546
- } else { // only Enter
547
- markup(options.onEnter);
548
- return options.onEnter.keepDefault;
549
- }
550
- }
551
- if (e.keyCode === 9) { // Tab key
552
- if (shiftKey == true || ctrlKey == true || altKey == true) {
553
- return false;
554
- }
555
- if (caretOffset !== -1) {
556
- get();
557
- caretOffset = $$.val().length - caretOffset;
558
- set(caretOffset, 0);
559
- caretOffset = -1;
560
- return false;
561
- } else {
562
- markup(options.onTab);
563
- return options.onTab.keepDefault;
564
- }
565
- }
566
- }
567
- }
568
-
569
- init();
570
- });
571
- };
572
-
573
- $.fn.markItUpRemove = function() {
574
- return this.each(function() {
575
- var $$ = $(this).unbind().removeClass('markItUpEditor');
576
- $$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
577
- }
578
- );
579
- };
580
-
581
- $.markItUp = function(settings) {
582
- var options = { target:false };
583
- $.extend(options, settings);
584
- if (options.target) {
585
- return $(options.target).each(function() {
586
- $(this).focus();
587
- $(this).trigger('insertion', [options]);
588
- });
589
- } else {
590
- $('textarea').trigger('insertion', [options]);
591
- }
592
- };
593
- })(jQuery);