beautiful_scaffold 0.0.1 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. data/Gemfile +21 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +10 -0
  4. data/beautiful_scaffold.gemspec +18 -0
  5. data/lib/generators/USAGE +15 -0
  6. data/lib/generators/beautiful_locale_generator.rb +34 -0
  7. data/lib/generators/beautiful_migration_generator.rb +53 -0
  8. data/lib/generators/beautiful_scaffold_common_methods.rb +104 -0
  9. data/lib/generators/beautiful_scaffold_generator.rb +158 -0
  10. data/lib/generators/templates/app/assets/images/bg-bottom-login.jpg +0 -0
  11. data/lib/generators/templates/app/assets/images/bg-error.png +0 -0
  12. data/lib/generators/templates/app/assets/images/bg-left.jpg +0 -0
  13. data/lib/generators/templates/app/assets/images/bg-notice.jpg +0 -0
  14. data/lib/generators/templates/app/assets/images/bg-notice.png +0 -0
  15. data/lib/generators/templates/app/assets/images/bg-success.png +0 -0
  16. data/lib/generators/templates/app/assets/images/bg-top-login.jpg +0 -0
  17. data/lib/generators/templates/app/assets/images/bg-warning.png +0 -0
  18. data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +80 -0
  19. data/lib/generators/templates/app/assets/javascripts/jquery.pjax.js +370 -0
  20. data/lib/generators/templates/app/assets/javascripts/modernizr.custom.js +4 -0
  21. data/lib/generators/templates/app/assets/stylesheets/beautiful_scaffold.css.scss +719 -0
  22. data/lib/generators/templates/app/assets/stylesheets/reset.css +48 -0
  23. data/lib/generators/templates/app/controllers/base.rb +177 -0
  24. data/lib/generators/templates/app/controllers/master_base.rb +37 -0
  25. data/lib/generators/templates/app/helpers/beautiful_helper.rb +130 -0
  26. data/lib/generators/templates/app/helpers/model_helper.rb +4 -0
  27. data/lib/generators/templates/app/locales/beautiful_scaffold.en.yml +30 -0
  28. data/lib/generators/templates/app/locales/beautiful_scaffold.fr.yml +30 -0
  29. data/lib/generators/templates/app/models/pdf_report.rb +40 -0
  30. data/lib/generators/templates/app/views/_beautiful_menu.html.erb +9 -0
  31. data/lib/generators/templates/app/views/_form.html.erb +24 -0
  32. data/lib/generators/templates/app/views/edit.html.erb +6 -0
  33. data/lib/generators/templates/app/views/index.html.erb +86 -0
  34. data/lib/generators/templates/app/views/layout.html.erb +70 -0
  35. data/lib/generators/templates/app/views/new.html.erb +5 -0
  36. data/lib/generators/templates/app/views/partials/_form_field.html.erb +37 -0
  37. data/lib/generators/templates/app/views/partials/_index_batch.html.erb +6 -0
  38. data/lib/generators/templates/app/views/partials/_index_column.html.erb +19 -0
  39. data/lib/generators/templates/app/views/partials/_index_header.html.erb +9 -0
  40. data/lib/generators/templates/app/views/partials/_index_search.html.erb +10 -0
  41. data/lib/generators/templates/app/views/partials/_show_field.html.erb +14 -0
  42. data/lib/generators/templates/app/views/show.html.erb +7 -0
  43. data/lib/generators/templates/markitup/jquery.markitup.js +593 -0
  44. data/lib/generators/templates/markitup/sets/bbcode/images/bold.png +0 -0
  45. data/lib/generators/templates/markitup/sets/bbcode/images/clean.png +0 -0
  46. data/lib/generators/templates/markitup/sets/bbcode/images/code.png +0 -0
  47. data/lib/generators/templates/markitup/sets/bbcode/images/fonts.png +0 -0
  48. data/lib/generators/templates/markitup/sets/bbcode/images/italic.png +0 -0
  49. data/lib/generators/templates/markitup/sets/bbcode/images/link.png +0 -0
  50. data/lib/generators/templates/markitup/sets/bbcode/images/list-bullet.png +0 -0
  51. data/lib/generators/templates/markitup/sets/bbcode/images/list-item.png +0 -0
  52. data/lib/generators/templates/markitup/sets/bbcode/images/list-numeric.png +0 -0
  53. data/lib/generators/templates/markitup/sets/bbcode/images/picture.png +0 -0
  54. data/lib/generators/templates/markitup/sets/bbcode/images/preview.png +0 -0
  55. data/lib/generators/templates/markitup/sets/bbcode/images/quotes.png +0 -0
  56. data/lib/generators/templates/markitup/sets/bbcode/images/stroke.png +0 -0
  57. data/lib/generators/templates/markitup/sets/bbcode/images/underline.png +0 -0
  58. data/lib/generators/templates/markitup/sets/bbcode/readme.txt +11 -0
  59. data/lib/generators/templates/markitup/sets/bbcode/set.js +39 -0
  60. data/lib/generators/templates/markitup/sets/bbcode/style.css +47 -0
  61. data/lib/generators/templates/markitup/sets/default/images/bold.png +0 -0
  62. data/lib/generators/templates/markitup/sets/default/images/clean.png +0 -0
  63. data/lib/generators/templates/markitup/sets/default/images/image.png +0 -0
  64. data/lib/generators/templates/markitup/sets/default/images/italic.png +0 -0
  65. data/lib/generators/templates/markitup/sets/default/images/link.png +0 -0
  66. data/lib/generators/templates/markitup/sets/default/images/list-bullet.png +0 -0
  67. data/lib/generators/templates/markitup/sets/default/images/list-numeric.png +0 -0
  68. data/lib/generators/templates/markitup/sets/default/images/picture.png +0 -0
  69. data/lib/generators/templates/markitup/sets/default/images/preview.png +0 -0
  70. data/lib/generators/templates/markitup/sets/default/images/stroke.png +0 -0
  71. data/lib/generators/templates/markitup/sets/default/set.js +30 -0
  72. data/lib/generators/templates/markitup/sets/default/style.css +34 -0
  73. data/lib/generators/templates/markitup/sets/html/images/bold.png +0 -0
  74. data/lib/generators/templates/markitup/sets/html/images/clean.png +0 -0
  75. data/lib/generators/templates/markitup/sets/html/images/h1.png +0 -0
  76. data/lib/generators/templates/markitup/sets/html/images/h2.png +0 -0
  77. data/lib/generators/templates/markitup/sets/html/images/h3.png +0 -0
  78. data/lib/generators/templates/markitup/sets/html/images/h4.png +0 -0
  79. data/lib/generators/templates/markitup/sets/html/images/h5.png +0 -0
  80. data/lib/generators/templates/markitup/sets/html/images/h6.png +0 -0
  81. data/lib/generators/templates/markitup/sets/html/images/image.png +0 -0
  82. data/lib/generators/templates/markitup/sets/html/images/italic.png +0 -0
  83. data/lib/generators/templates/markitup/sets/html/images/link.png +0 -0
  84. data/lib/generators/templates/markitup/sets/html/images/list-bullet.png +0 -0
  85. data/lib/generators/templates/markitup/sets/html/images/list-item.png +0 -0
  86. data/lib/generators/templates/markitup/sets/html/images/list-numeric.png +0 -0
  87. data/lib/generators/templates/markitup/sets/html/images/paragraph.png +0 -0
  88. data/lib/generators/templates/markitup/sets/html/images/picture.png +0 -0
  89. data/lib/generators/templates/markitup/sets/html/images/preview.png +0 -0
  90. data/lib/generators/templates/markitup/sets/html/images/stroke.png +0 -0
  91. data/lib/generators/templates/markitup/sets/html/readme.txt +11 -0
  92. data/lib/generators/templates/markitup/sets/html/set.js +39 -0
  93. data/lib/generators/templates/markitup/sets/html/style.css +59 -0
  94. data/lib/generators/templates/markitup/sets/markdown/images/bold.png +0 -0
  95. data/lib/generators/templates/markitup/sets/markdown/images/code.png +0 -0
  96. data/lib/generators/templates/markitup/sets/markdown/images/h1.png +0 -0
  97. data/lib/generators/templates/markitup/sets/markdown/images/h2.png +0 -0
  98. data/lib/generators/templates/markitup/sets/markdown/images/h3.png +0 -0
  99. data/lib/generators/templates/markitup/sets/markdown/images/h4.png +0 -0
  100. data/lib/generators/templates/markitup/sets/markdown/images/h5.png +0 -0
  101. data/lib/generators/templates/markitup/sets/markdown/images/h6.png +0 -0
  102. data/lib/generators/templates/markitup/sets/markdown/images/italic.png +0 -0
  103. data/lib/generators/templates/markitup/sets/markdown/images/link.png +0 -0
  104. data/lib/generators/templates/markitup/sets/markdown/images/list-bullet.png +0 -0
  105. data/lib/generators/templates/markitup/sets/markdown/images/list-numeric.png +0 -0
  106. data/lib/generators/templates/markitup/sets/markdown/images/picture.png +0 -0
  107. data/lib/generators/templates/markitup/sets/markdown/images/preview.png +0 -0
  108. data/lib/generators/templates/markitup/sets/markdown/images/quotes.png +0 -0
  109. data/lib/generators/templates/markitup/sets/markdown/readme.txt +11 -0
  110. data/lib/generators/templates/markitup/sets/markdown/set.js +52 -0
  111. data/lib/generators/templates/markitup/sets/markdown/style.css +54 -0
  112. data/lib/generators/templates/markitup/sets/textile/images/bold.png +0 -0
  113. data/lib/generators/templates/markitup/sets/textile/images/code.png +0 -0
  114. data/lib/generators/templates/markitup/sets/textile/images/h1.png +0 -0
  115. data/lib/generators/templates/markitup/sets/textile/images/h2.png +0 -0
  116. data/lib/generators/templates/markitup/sets/textile/images/h3.png +0 -0
  117. data/lib/generators/templates/markitup/sets/textile/images/h4.png +0 -0
  118. data/lib/generators/templates/markitup/sets/textile/images/h5.png +0 -0
  119. data/lib/generators/templates/markitup/sets/textile/images/h6.png +0 -0
  120. data/lib/generators/templates/markitup/sets/textile/images/italic.png +0 -0
  121. data/lib/generators/templates/markitup/sets/textile/images/link.png +0 -0
  122. data/lib/generators/templates/markitup/sets/textile/images/list-bullet.png +0 -0
  123. data/lib/generators/templates/markitup/sets/textile/images/list-numeric.png +0 -0
  124. data/lib/generators/templates/markitup/sets/textile/images/paragraph.png +0 -0
  125. data/lib/generators/templates/markitup/sets/textile/images/picture.png +0 -0
  126. data/lib/generators/templates/markitup/sets/textile/images/preview.png +0 -0
  127. data/lib/generators/templates/markitup/sets/textile/images/quotes.png +0 -0
  128. data/lib/generators/templates/markitup/sets/textile/images/stroke.png +0 -0
  129. data/lib/generators/templates/markitup/sets/textile/readme.txt +11 -0
  130. data/lib/generators/templates/markitup/sets/textile/set.js +40 -0
  131. data/lib/generators/templates/markitup/sets/textile/style.css +60 -0
  132. data/lib/generators/templates/markitup/sets/wiki/images/bold.png +0 -0
  133. data/lib/generators/templates/markitup/sets/wiki/images/code.png +0 -0
  134. data/lib/generators/templates/markitup/sets/wiki/images/h1.png +0 -0
  135. data/lib/generators/templates/markitup/sets/wiki/images/h2.png +0 -0
  136. data/lib/generators/templates/markitup/sets/wiki/images/h3.png +0 -0
  137. data/lib/generators/templates/markitup/sets/wiki/images/h4.png +0 -0
  138. data/lib/generators/templates/markitup/sets/wiki/images/h5.png +0 -0
  139. data/lib/generators/templates/markitup/sets/wiki/images/h6.png +0 -0
  140. data/lib/generators/templates/markitup/sets/wiki/images/italic.png +0 -0
  141. data/lib/generators/templates/markitup/sets/wiki/images/link.png +0 -0
  142. data/lib/generators/templates/markitup/sets/wiki/images/list-bullet.png +0 -0
  143. data/lib/generators/templates/markitup/sets/wiki/images/list-numeric.png +0 -0
  144. data/lib/generators/templates/markitup/sets/wiki/images/picture.png +0 -0
  145. data/lib/generators/templates/markitup/sets/wiki/images/preview.png +0 -0
  146. data/lib/generators/templates/markitup/sets/wiki/images/quotes.png +0 -0
  147. data/lib/generators/templates/markitup/sets/wiki/images/stroke.png +0 -0
  148. data/lib/generators/templates/markitup/sets/wiki/images/url.png +0 -0
  149. data/lib/generators/templates/markitup/sets/wiki/readme.txt +11 -0
  150. data/lib/generators/templates/markitup/sets/wiki/set.js +37 -0
  151. data/lib/generators/templates/markitup/sets/wiki/style.css +57 -0
  152. data/lib/generators/templates/markitup/skins/markitup/images/bg-container.png +0 -0
  153. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
  154. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
  155. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-html.png +0 -0
  156. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-json.png +0 -0
  157. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
  158. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
  159. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
  160. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
  161. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor.png +0 -0
  162. data/lib/generators/templates/markitup/skins/markitup/images/handle.png +0 -0
  163. data/lib/generators/templates/markitup/skins/markitup/images/menu.png +0 -0
  164. data/lib/generators/templates/markitup/skins/markitup/images/submenu.png +0 -0
  165. data/lib/generators/templates/markitup/skins/markitup/style.css +147 -0
  166. data/lib/generators/templates/markitup/skins/simple/images/handle.png +0 -0
  167. data/lib/generators/templates/markitup/skins/simple/images/menu.png +0 -0
  168. data/lib/generators/templates/markitup/skins/simple/images/submenu.png +0 -0
  169. data/lib/generators/templates/markitup/skins/simple/style.css +118 -0
  170. data/lib/generators/templates/markitup/templates/preview.css +5 -0
  171. data/lib/generators/templates/markitup/templates/preview.html +11 -0
  172. data/lib/generators/templates/modules/beautiful_scaffold_module.rb +28 -0
  173. metadata +175 -3
@@ -0,0 +1,11 @@
1
+ Markup language:
2
+ Wiki
3
+
4
+ Description:
5
+ A basic Wiki markup set with Headings, Bold, Italic, Stroke through, Picture, Link, List, Quotes, Code, Preview button.
6
+
7
+ Install:
8
+ - Download the zip file
9
+ - Unzip it in your markItUp! sets folder
10
+ - Modify your JS link to point at this set.js
11
+ - Modify your CSS link to point at this style.css
@@ -0,0 +1,37 @@
1
+ // -------------------------------------------------------------------
2
+ // markItUp!
3
+ // -------------------------------------------------------------------
4
+ // Copyright (C) 2008 Jay Salvat
5
+ // http://markitup.jaysalvat.com/
6
+ // -------------------------------------------------------------------
7
+ // Mediawiki Wiki tags example
8
+ // -------------------------------------------------------------------
9
+ // Feel free to add more tags
10
+ // -------------------------------------------------------------------
11
+ myWikiSettings = {
12
+ previewParserPath: '', // path to your Wiki parser
13
+ onShiftEnter: {keepDefault:false, replaceWith:'\n\n'},
14
+ markupSet: [
15
+ {name:'Heading 1', key:'1', openWith:'== ', closeWith:' ==', placeHolder:'Your title here...' },
16
+ {name:'Heading 2', key:'2', openWith:'=== ', closeWith:' ===', placeHolder:'Your title here...' },
17
+ {name:'Heading 3', key:'3', openWith:'==== ', closeWith:' ====', placeHolder:'Your title here...' },
18
+ {name:'Heading 4', key:'4', openWith:'===== ', closeWith:' =====', placeHolder:'Your title here...' },
19
+ {name:'Heading 5', key:'5', openWith:'====== ', closeWith:' ======', placeHolder:'Your title here...' },
20
+ {separator:'---------------' },
21
+ {name:'Bold', key:'B', openWith:"'''", closeWith:"'''"},
22
+ {name:'Italic', key:'I', openWith:"''", closeWith:"''"},
23
+ {name:'Stroke through', key:'S', openWith:'<s>', closeWith:'</s>'},
24
+ {separator:'---------------' },
25
+ {name:'Bulleted list', openWith:'(!(* |!|*)!)'},
26
+ {name:'Numeric list', openWith:'(!(# |!|#)!)'},
27
+ {separator:'---------------' },
28
+ {name:'Picture', key:"P", replaceWith:'[[Image:[![Url:!:http://]!]|[![name]!]]]'},
29
+ {name:'Link', key:"L", openWith:"[[![Link]!] ", closeWith:']', placeHolder:'Your text to link here...' },
30
+ {name:'Url', openWith:"[[![Url:!:http://]!] ", closeWith:']', placeHolder:'Your text to link here...' },
31
+ {separator:'---------------' },
32
+ {name:'Quotes', openWith:'(!(> |!|>)!)', placeHolder:''},
33
+ {name:'Code', openWith:'(!(<source lang="[![Language:!:php]!]">|!|<pre>)!)', closeWith:'(!(</source>|!|</pre>)!)'},
34
+ {separator:'---------------' },
35
+ {name:'Preview', call:'preview', className:'preview'}
36
+ ]
37
+ }
@@ -0,0 +1,57 @@
1
+ /* -------------------------------------------------------------------
2
+ // markItUp!
3
+ // By Jay Salvat - http://markitup.jaysalvat.com/
4
+ // ------------------------------------------------------------------*/
5
+ .wiki .markItUpButton1 a {
6
+ background-image:url(images/h1.png);
7
+ }
8
+ .wiki .markItUpButton2 a {
9
+ background-image:url(images/h2.png);
10
+ }
11
+ .wiki .markItUpButton3 a {
12
+ background-image:url(images/h3.png);
13
+ }
14
+ .wiki .markItUpButton4 a {
15
+ background-image:url(images/h4.png);
16
+ }
17
+ .wiki .markItUpButton5 a {
18
+ background-image:url(images/h5.png);
19
+ }
20
+
21
+ .wiki .markItUpButton6 a {
22
+ background-image:url(images/bold.png);
23
+ }
24
+ .wiki .markItUpButton7 a {
25
+ background-image:url(images/italic.png);
26
+ }
27
+ .wiki .markItUpButton8 a {
28
+ background-image:url(images/stroke.png);
29
+ }
30
+
31
+ .wiki .markItUpButton9 a {
32
+ background-image:url(images/list-bullet.png);
33
+ }
34
+ .wiki .markItUpButton10 a {
35
+ background-image:url(images/list-numeric.png);
36
+ }
37
+
38
+ .wiki .markItUpButton11 a {
39
+ background-image:url(images/picture.png);
40
+ }
41
+ .wiki .markItUpButton12 a {
42
+ background-image:url(images/link.png);
43
+ }
44
+ .wiki .markItUpButton13 a {
45
+ background-image:url(images/url.png);
46
+ }
47
+
48
+ .wiki .markItUpButton14 a {
49
+ background-image:url(images/quotes.png);
50
+ }
51
+ .wiki .markItUpButton15 a {
52
+ background-image:url(images/code.png);
53
+ }
54
+
55
+ .wiki .preview a {
56
+ background-image:url(images/preview.png);
57
+ }
@@ -0,0 +1,147 @@
1
+ /* -------------------------------------------------------------------
2
+ // markItUp! Universal MarkUp Engine, JQuery plugin
3
+ // By Jay Salvat - http://markitup.jaysalvat.com/
4
+ // ------------------------------------------------------------------*/
5
+ .markItUp * {
6
+ margin:0px; padding:0px;
7
+ outline:none;
8
+ }
9
+ .markItUp a:link,
10
+ .markItUp a:visited {
11
+ color:#000;
12
+ text-decoration:none;
13
+ }
14
+ .markItUp {
15
+ width:700px;
16
+ margin:5px 0 5px 0;
17
+ border:5px solid #F5F5F5;
18
+ }
19
+ .markItUpContainer {
20
+ border:1px solid #3C769D;
21
+ background:#FFF url(images/bg-container.png) repeat-x top left;
22
+ padding:5px 5px 2px 5px;
23
+ font:11px Verdana, Arial, Helvetica, sans-serif;
24
+ }
25
+ .markItUpEditor {
26
+ font:12px 'Courier New', Courier, monospace;
27
+ padding:5px 5px 5px 35px;
28
+ border:3px solid #3C769D;
29
+ width:643px;
30
+ height:320px;
31
+ background:#FFF url(images/bg-editor.png) no-repeat;
32
+ clear:both;
33
+ line-height:18px;
34
+ overflow:auto;
35
+ }
36
+ .markItUpPreviewFrame {
37
+ overflow:auto;
38
+ background-color:#FFFFFF;
39
+ border:1px solid #3C769D;
40
+ width:99.9%;
41
+ height:300px;
42
+ margin:5px 0;
43
+ }
44
+ .markItUpFooter {
45
+ width:100%;
46
+ cursor:n-resize;
47
+ }
48
+ .markItUpResizeHandle {
49
+ overflow:hidden;
50
+ width:22px; height:5px;
51
+ margin-left:auto;
52
+ margin-right:auto;
53
+ background-image:url(images/handle.png);
54
+ cursor:n-resize;
55
+ }
56
+ /***************************************************************************************/
57
+ /* first row of buttons */
58
+ .markItUpHeader ul li {
59
+ list-style:none;
60
+ float:left;
61
+ position:relative;
62
+ }
63
+ .markItUpHeader ul li ul{
64
+ display:none;
65
+ }
66
+ .markItUpHeader ul li:hover > ul{
67
+ display:block;
68
+ }
69
+ .markItUpHeader ul .markItUpDropMenu {
70
+ background:transparent url(images/menu.png) no-repeat 115% 50%;
71
+ margin-right:5px;
72
+ }
73
+ .markItUpHeader ul .markItUpDropMenu li {
74
+ margin-right:0px;
75
+ }
76
+ .markItUpHeader ul .markItUpSeparator {
77
+ margin:0 10px;
78
+ width:1px;
79
+ height:16px;
80
+ overflow:hidden;
81
+ background-color:#CCC;
82
+ }
83
+ .markItUpHeader ul ul .markItUpSeparator {
84
+ width:auto; height:1px;
85
+ margin:0px;
86
+ }
87
+ /* next rows of buttons */
88
+ .markItUpHeader ul ul {
89
+ display:none;
90
+ position:absolute;
91
+ top:18px; left:0px;
92
+ background:#F5F5F5;
93
+ border:1px solid #3C769D;
94
+ height:inherit;
95
+ }
96
+ .markItUpHeader ul ul li {
97
+ float:none;
98
+ border-bottom:1px solid #3C769D;
99
+ }
100
+ .markItUpHeader ul ul .markItUpDropMenu {
101
+ background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%;
102
+ }
103
+ /* next rows of buttons */
104
+ .markItUpHeader ul ul ul {
105
+ position:absolute;
106
+ top:-1px; left:150px;
107
+ }
108
+ .markItUpHeader ul ul ul li {
109
+ float:none;
110
+ }
111
+ .markItUpHeader ul a {
112
+ display:block;
113
+ width:16px; height:16px;
114
+ text-indent:-10000px;
115
+ background-repeat:no-repeat;
116
+ padding:3px;
117
+ margin:0px;
118
+ }
119
+ .markItUpHeader ul ul a {
120
+ display:block;
121
+ padding-left:0px;
122
+ text-indent:0;
123
+ width:120px;
124
+ padding:5px 5px 5px 25px;
125
+ background-position:2px 50%;
126
+ }
127
+ .markItUpHeader ul ul a:hover {
128
+ color:#FFF;
129
+ background-color:#3C769D;
130
+ }
131
+ /***************************************************************************************/
132
+ .html .markItUpEditor {
133
+ background-image:url(images/bg-editor-html.png);
134
+ }
135
+ .markdown .markItUpEditor {
136
+ background-image:url(images/bg-editor-markdown.png);
137
+ }
138
+ .textile .markItUpEditor {
139
+ background-image:url(images/bg-editor-textile.png);
140
+ }
141
+ .bbcode .markItUpEditor {
142
+ background-image:url(images/bg-editor-bbcode.png);
143
+ }
144
+ .wiki .markItUpEditor,
145
+ .dotclear .markItUpEditor {
146
+ background-image:url(images/bg-editor-wiki.png);
147
+ }
@@ -0,0 +1,118 @@
1
+ /* -------------------------------------------------------------------
2
+ // markItUp! Universal MarkUp Engine, JQuery plugin
3
+ // By Jay Salvat - http://markitup.jaysalvat.com/
4
+ // ------------------------------------------------------------------*/
5
+ .markItUp * {
6
+ margin:0px; padding:0px;
7
+ outline:none;
8
+ }
9
+ .markItUp a:link,
10
+ .markItUp a:visited {
11
+ color:#000;
12
+ text-decoration:none;
13
+ }
14
+ .markItUp {
15
+ width:700px;
16
+ margin:5px 0 5px 0;
17
+ }
18
+ .markItUpContainer {
19
+ font:11px Verdana, Arial, Helvetica, sans-serif;
20
+ }
21
+ .markItUpEditor {
22
+ font:12px 'Courier New', Courier, monospace;
23
+ padding:5px;
24
+ width:690px;
25
+ height:320px;
26
+ clear:both;
27
+ line-height:18px;
28
+ overflow:auto;
29
+ }
30
+ .markItUpPreviewFrame {
31
+ overflow:auto;
32
+ background-color:#FFF;
33
+ width:99.9%;
34
+ height:300px;
35
+ margin:5px 0;
36
+ }
37
+ .markItUpFooter {
38
+ width:100%;
39
+ }
40
+ .markItUpResizeHandle {
41
+ overflow:hidden;
42
+ width:22px; height:5px;
43
+ margin-left:auto;
44
+ margin-right:auto;
45
+ background-image:url(images/handle.png);
46
+ cursor:n-resize;
47
+ }
48
+ /***************************************************************************************/
49
+ /* first row of buttons */
50
+ .markItUpHeader ul li {
51
+ list-style:none;
52
+ float:left;
53
+ position:relative;
54
+ }
55
+ .markItUpHeader ul li:hover > ul{
56
+ display:block;
57
+ }
58
+ .markItUpHeader ul .markItUpDropMenu {
59
+ background:transparent url(images/menu.png) no-repeat 115% 50%;
60
+ margin-right:5px;
61
+ }
62
+ .markItUpHeader ul .markItUpDropMenu li {
63
+ margin-right:0px;
64
+ }
65
+ /* next rows of buttons */
66
+ .markItUpHeader ul ul {
67
+ display:none;
68
+ position:absolute;
69
+ top:18px; left:0px;
70
+ background:#FFF;
71
+ border:1px solid #000;
72
+ }
73
+ .markItUpHeader ul ul li {
74
+ float:none;
75
+ border-bottom:1px solid #000;
76
+ }
77
+ .markItUpHeader ul ul .markItUpDropMenu {
78
+ background:#FFF url(images/submenu.png) no-repeat 100% 50%;
79
+ }
80
+ .markItUpHeader ul .markItUpSeparator {
81
+ margin:0 10px;
82
+ width:1px;
83
+ height:16px;
84
+ overflow:hidden;
85
+ background-color:#CCC;
86
+ }
87
+ .markItUpHeader ul ul .markItUpSeparator {
88
+ width:auto; height:1px;
89
+ margin:0px;
90
+ }
91
+ /* next rows of buttons */
92
+ .markItUpHeader ul ul ul {
93
+ position:absolute;
94
+ top:-1px; left:150px;
95
+ }
96
+ .markItUpHeader ul ul ul li {
97
+ float:none;
98
+ }
99
+ .markItUpHeader ul a {
100
+ display:block;
101
+ width:16px; height:16px;
102
+ text-indent:-10000px;
103
+ background-repeat:no-repeat;
104
+ padding:3px;
105
+ margin:0px;
106
+ }
107
+ .markItUpHeader ul ul a {
108
+ display:block;
109
+ padding-left:0px;
110
+ text-indent:0;
111
+ width:120px;
112
+ padding:5px 5px 5px 25px;
113
+ background-position:2px 50%;
114
+ }
115
+ .markItUpHeader ul ul a:hover {
116
+ color:#FFF;
117
+ background-color:#000;
118
+ }
@@ -0,0 +1,5 @@
1
+ /* preview style examples */
2
+ body {
3
+ background-color:#EFEFEF;
4
+ font:70% Verdana, Arial, Helvetica, sans-serif;
5
+ }
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <title>markItUp! preview template</title>
6
+ <link rel="stylesheet" type="text/css" href="~/templates/preview.css" />
7
+ </head>
8
+ <body>
9
+ <!-- content -->
10
+ </body>
11
+ </html>
@@ -0,0 +1,28 @@
1
+ module BeautifulScaffoldModule
2
+ def generate_fulltext_field(fields)
3
+ fields.each{ |f|
4
+ html, clear = htmlize(self[f], self[f + '_typetext'])
5
+ self[f + '_fulltext'] = clear
6
+ }
7
+ end
8
+
9
+ def htmlize(text, type)
10
+ case type
11
+ when 'bbcode' then
12
+ require 'bb-ruby'
13
+ html = text.bbcode_to_html
14
+ when 'html' then
15
+ html = text
16
+ when 'textile' then
17
+ html = RedCloth.new(text).to_html
18
+ when 'markdown' then
19
+ require 'rdiscount'
20
+ html = RDiscount.new(text).to_html
21
+ when 'wiki' then
22
+ html = WikiCloth::Parser.new({:data => text}).to_html
23
+ else
24
+ html
25
+ end
26
+ return html, Sanitize.clean(html)
27
+ end
28
+ end