tb_core 1.2.4 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/admin/core/application.js +1 -2
  4. data/app/assets/javascripts/admin/core/editor.js +23 -67
  5. data/app/assets/libs/jquery-ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  6. data/app/assets/libs/jquery-ui/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  7. data/app/assets/libs/jquery-ui/images/ui-bg_flat_10_000000_40x100.png +0 -0
  8. data/app/assets/libs/jquery-ui/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  9. data/app/assets/libs/jquery-ui/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  10. data/app/assets/libs/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  11. data/app/assets/libs/jquery-ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  12. data/app/assets/libs/jquery-ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  13. data/app/assets/libs/jquery-ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  14. data/app/assets/libs/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
  15. data/app/assets/libs/jquery-ui/images/ui-icons_228ef1_256x240.png +0 -0
  16. data/app/assets/libs/jquery-ui/images/ui-icons_ef8c08_256x240.png +0 -0
  17. data/app/assets/libs/jquery-ui/images/ui-icons_ffd27a_256x240.png +0 -0
  18. data/app/assets/libs/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
  19. data/app/assets/libs/jquery-ui/jquery-ui.css.scss +552 -0
  20. data/app/assets/libs/jquery-ui/jquery-ui.js +5468 -0
  21. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  22. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-bg_flat_0_eeeeee_40x100.png +0 -0
  23. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-bg_flat_55_ffffff_40x100.png +0 -0
  24. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  25. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  26. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
  27. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
  28. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
  29. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-icons_0073ea_256x240.png +0 -0
  30. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-icons_454545_256x240.png +0 -0
  31. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-icons_666666_256x240.png +0 -0
  32. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-icons_ff0084_256x240.png +0 -0
  33. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/images/ui-icons_ffffff_256x240.png +0 -0
  34. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/jquery-ui-1.9.1.custom.css +0 -0
  35. data/app/assets/libs/{jquery-ui → jquery-ui-old}/css/flick/jquery-ui-1.9.1.custom.min.css +0 -0
  36. data/app/assets/libs/{jquery-ui → jquery-ui-old}/js/jquery-ui-1.9.1.custom.js +0 -0
  37. data/app/assets/libs/{jquery-ui → jquery-ui-old}/js/jquery-ui-1.9.1.custom.min.js +0 -0
  38. data/app/assets/stylesheets/admin/core/application.css.scss +6 -2
  39. data/app/controllers/admin/application_controller.rb +1 -6
  40. data/app/controllers/spud/application_controller.rb +27 -9
  41. data/app/views/layouts/admin/error_page.html.erb +12 -0
  42. data/app/views/layouts/error_page.html.erb +6 -0
  43. data/lib/generators/spud/module_generator.rb +14 -0
  44. data/lib/generators/spud/templates/admin_controller.rb.erb +6 -3
  45. data/lib/generators/spud/templates/controller.rb.erb +2 -2
  46. data/lib/generators/spud/templates/views/admin/index.html.erb +7 -1
  47. data/lib/spud_core/belongs_to_app.rb +1 -1
  48. data/lib/spud_core/catch_all_route.rb +3 -0
  49. data/lib/spud_core/configuration.rb +1 -2
  50. data/lib/spud_core/engine.rb +9 -2
  51. data/lib/spud_core/errors.rb +29 -0
  52. data/lib/spud_core/version.rb +1 -1
  53. data/spec/controllers/admin/application_controller_spec.rb +2 -1
  54. data/spec/controllers/admin/users_controller_spec.rb +11 -7
  55. data/spec/controllers/sitemap_controllers_spec.rb +0 -6
  56. data/spec/controllers/spud/application_controller_spec.rb +1 -1
  57. metadata +45 -42
  58. data/app/assets/libs/tinymce/plugins/tableDropdown/editor_plugin.js +0 -140
  59. data/app/views/layouts/not_found.html.erb +0 -6
  60. data/lib/spud_core/exceptions.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf20305470b452af36fca1e23124a676b61cdc50
4
- data.tar.gz: 44b05c92f01040378720ba77e614a650f60d18d5
3
+ metadata.gz: 0995b70d53813ddd5e1ebbbdd6204d05bf578162
4
+ data.tar.gz: 540e350accfc57eb8041a07cddc45b6e2c528f95
5
5
  SHA512:
6
- metadata.gz: 35dd3f7a88ac1603d596f57b60aeadb1d3e7a0a7e9e04bca110dba34d0fa48f742c87242ce6dba1a9877aca5a12adfa0c97b88ca40a844e6ca1fb530d3038219
7
- data.tar.gz: 45f61b833bb35b052c952d0a612fd0019f3b113a434b01110b4428dcf6768e06bae391fb7949e6e27be9b847dee51cbf6eec371cb05dcfffa82f604f29399953
6
+ metadata.gz: 4c82914ae0bc2d21cf85b6f56deebfbd7f5c12b8ac5c0030085fada42db0031ecb1a5e3f39b42fa38f3ab2f7ca491b26ad43ca7e4dde1cdb6d20ba0550f705ae
7
+ data.tar.gz: 0cefa04341cd76b2d2c6aeafdeeebf422379e59bce09944e823a70749218a44e04bc2eb64bff1179cf314170fb8cfbeb2659a8651ead0c0cff74c4aca250d8c0
data/README.md CHANGED
@@ -147,7 +147,7 @@ Create a file in your app at `app/views/admin/users/_show_additions.html.erb`.
147
147
  404 Handling
148
148
  ------------
149
149
 
150
- The base `Spud::ApplicationController` will automatically rescue from any `Spud::NotFoundError` errors by rendering out the `layouts/not_found.html` template. To customize this view, create a template by that name in your own project.
150
+ The base `Spud::ApplicationController` will automatically rescue from any `Spud::NotFoundError` and `Spud::AccessDeniedError` errors by rendering out the `layouts/error_page.html` template. To customize this view, create a template by that name in your own project.
151
151
 
152
152
  When building your own apps you may raise a `Spud::NotFoundError` at any time to halt further execution and cause the 404 page to render. For example:
153
153
 
@@ -1,10 +1,9 @@
1
1
  //= require jquery
2
2
  //= require jquery_ujs
3
3
  //= require tinymce-jquery
4
- //= require tinymce/plugins/tableDropdown/editor_plugin
5
4
  //= require bootstrap/js/bootstrap
6
5
  //= require datepicker/js/bootstrap-datepicker
7
- //= require jquery-ui/js/jquery-ui-1.9.1.custom
6
+ //= require jquery-ui/jquery-ui
8
7
  //= require ../../tb_core
9
8
  //= require_self
10
9
  //= require_tree .
@@ -1,6 +1,3 @@
1
- //= require codemirror
2
- //= require codemirror/modes/markdown
3
-
4
1
  spud.admin.editor = {};
5
2
 
6
3
  (function(){
@@ -8,17 +5,18 @@ spud.admin.editor = {};
8
5
  var editor = spud.admin.editor;
9
6
 
10
7
  var registeredPlugins = [
11
- 'autolink','lists','table','tableDropdown','advhr','advimage','advlink','inlinepopups','media','paste'
8
+ 'autolink','lists','image','link','media','paste', 'code'
12
9
  ];
13
10
 
14
11
  var registeredButtons = [
15
- ['bold','italic','underline','strikethrough','|','justifyleft','justifycenter','justifyright','justifyfull','|','formatselect','cut','copy','paste', 'pasteword','pastetext','|','bullist','numlist','outdent','indent','|','tableDropdown','|','link','unlink','anchor','image','code'],
16
- [],
17
- [],
18
- []
12
+ 'undo', 'redo', '|',
13
+ 'bold','italic','underline','strikethrough','|',
14
+ 'formatselect','|',
15
+ 'cut','copy','paste', 'pasteword','pastetext','|',
16
+ 'bullist','numlist','outdent','indent','|',
17
+ 'link','unlink','image', '|', 'code', '|'
19
18
  ];
20
19
 
21
-
22
20
  var validElements = "@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|" +
23
21
  "onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|" +
24
22
  "onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|" +
@@ -43,8 +41,6 @@ spud.admin.editor = {};
43
41
 
44
42
  var extendedValidElements = [];
45
43
 
46
- var validFormats = "p,h1,h2,h3,h4,h5,h6";
47
-
48
44
  editor.init = function(options) {
49
45
  editor.monitorFormatters();
50
46
  options = options || {};
@@ -52,14 +48,10 @@ spud.admin.editor = {};
52
48
  $(selector).each(function() {
53
49
  var $this = $(this);
54
50
  var dataFormat = $this.attr('data-format');
55
- switch(dataFormat) {
56
- case 'Markdown':
57
- editor.initCodeMirrorWithOptions(this,'markdown', options || {});
58
- break;
59
- case 'HTML':
60
- default:
61
- editor.initMCEWithOptions(this, options || {});
51
+ if(dataFormat == 'Markdown'){
52
+ console.warn('Markdown is not supported at this time.');
62
53
  }
54
+ editor.initMCEWithOptions(this, options || {});
63
55
  });
64
56
 
65
57
  };
@@ -78,32 +70,18 @@ spud.admin.editor = {};
78
70
 
79
71
  editor.initMCEWithOptions = function(element, options){
80
72
 
81
- var theme = options.theme || 'advanced';
73
+ var theme = options.theme || 'modern';
82
74
  var height = options.height || 400;
83
75
  var width = options.width || $(element).width();
84
-
85
- var buttons = [];
86
- if(options.buttons){
87
- for(var i=0; i<4; i++){
88
- var row = options.buttons[i] || [];
89
- buttons.push(row);
90
- }
91
- }
92
- else{
93
- buttons = registeredButtons;
94
- }
76
+ var buttons = options.buttons || registeredButtons;
77
+ var plugins = options.plugins || registeredPlugins;
95
78
 
96
79
  $(element).tinymce({
97
80
  theme: theme,
98
81
  language: 'en',
99
- plugins: registeredPlugins.join(','),
100
- theme_advanced_toolbar_location: "top",
101
- theme_advanced_buttons1: buttons[0].join(','),
102
- theme_advanced_buttons2: buttons[1].join(','),
103
- theme_advanced_buttons3: buttons[2].join(','),
104
- theme_advanced_buttons4: buttons[3].join(','),
105
- theme_advanced_toolbar_align: 'left',
106
- theme_advanced_blockformats: validFormats,
82
+ menubar: false,
83
+ plugins: plugins.join(' '),
84
+ toolbar: buttons.join(' '),
107
85
  convert_urls: false,
108
86
  valid_elements: validElements,
109
87
  media_strict: false,
@@ -113,32 +91,8 @@ spud.admin.editor = {};
113
91
  });
114
92
  };
115
93
 
116
- var codeMirrors = [];
117
- editor.initCodeMirrorWithOptions = function(element, format, options) {
118
- var editor = CodeMirror.fromTextArea(element, {
119
- mode: 'markdown',
120
- lineNumbers: true,
121
- lineWrapping: true,
122
- theme: "default",
123
- extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"}
124
- });
125
- codeMirrors.push(editor);
126
-
127
- $(element).attr('code-mirror-id',codeMirrors.length-1);
128
- };
129
-
130
- editor.unload = function(selectorOptional) {
131
- var selector = selectorOptional || 'textarea.tinymce';
132
- $(selector).each(function() {
133
- var $this = $(this);
134
- if($this.attr('code-mirror-id')) {
135
- codeMirrors[parseInt($this.attr('code-mirror-id'),10)].toTextArea();
136
- codeMirrors[parseInt($this.attr('code-mirror-id'),10)] = null;
137
- $this.removeAttr('code-mirror-id');
138
- }
139
- tinyMCE.execCommand('mceRemoveControl',false,this.id);
140
- });
141
-
94
+ editor.unload = function() {
95
+ tinyMCE.remove();
142
96
  };
143
97
 
144
98
  editor.registerPlugin = function(pluginName){
@@ -163,12 +117,14 @@ spud.admin.editor = {};
163
117
  };
164
118
 
165
119
  editor.registerButton = function(buttonNameOrArray, rowNum){
166
- rowNum = rowNum || 0;
120
+ if(rowNum){
121
+ console.warn('rowNum parameter is no longer used.');
122
+ }
167
123
  if(typeof(buttonNameOrArray) == 'object'){
168
- registeredButtons[rowNum].concat(buttonNameOrArray);
124
+ registeredButtons.concat(buttonNameOrArray);
169
125
  }
170
126
  else{
171
- registeredButtons[rowNum].push(buttonNameOrArray);
127
+ registeredButtons.push(buttonNameOrArray);
172
128
  }
173
129
  };
174
130
  })();