kms 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/kms/application/controllers/assets_controller.coffee.erb +1 -1
  3. data/app/assets/javascripts/kms/application/controllers/pages_controller.coffee.erb +3 -3
  4. data/app/assets/javascripts/kms/application/module.coffee +1 -1
  5. data/app/assets/javascripts/templates/settings.html.slim +5 -5
  6. data/app/assets/stylesheets/kms/custom.css.scss +3 -3
  7. data/app/controllers/kms/application_controller.rb +1 -1
  8. data/app/controllers/kms/public/pages_controller.rb +2 -4
  9. data/app/models/concerns/kms/compile_templates.rb +4 -0
  10. data/app/models/kms/page.rb +0 -3
  11. data/app/models/kms/template.rb +0 -3
  12. data/app/views/devise/passwords/edit.html.erb +22 -0
  13. data/app/views/devise/passwords/new.html.erb +15 -0
  14. data/config/locales/en.yml +18 -16
  15. data/config/locales/ru.yml +19 -17
  16. data/db/migrate/20141027065341_create_pages.rb +1 -1
  17. data/db/migrate/20141027083603_create_templates.rb +1 -1
  18. data/db/migrate/20141027083633_add_template_id_to_pages.rb +1 -1
  19. data/db/migrate/20141029145253_create_assets.rb +1 -1
  20. data/db/migrate/20141031125758_add_ancestry_to_pages.rb +1 -1
  21. data/db/migrate/20141031140308_devise_create_users.rb +1 -1
  22. data/db/migrate/20141119084306_add_fullpath_to_pages.rb +1 -1
  23. data/db/migrate/20141121112652_add_role_to_users.rb +1 -1
  24. data/db/migrate/20141127073902_add_templatable_fields_to_pages.rb +1 -1
  25. data/db/migrate/20141209132901_add_hidden_to_page.rb +1 -1
  26. data/db/migrate/20150209120632_add_position_to_kms_pages.rb +1 -1
  27. data/db/migrate/20160129100437_create_kms_snippets.rb +1 -1
  28. data/db/migrate/20160712094512_create_kms_settings.rb +1 -1
  29. data/lib/kms/engine.rb +1 -0
  30. data/lib/kms/version.rb +1 -1
  31. data/spec/internal/log/test.log +420 -0
  32. data/vendor/assets/bower.json +3 -1
  33. data/vendor/assets/bower_components/angular-cookies/LICENSE.md +21 -0
  34. data/vendor/assets/bower_components/angular-cookies/README.md +2 -11
  35. data/vendor/assets/bower_components/angular-cookies/angular-cookies.js +259 -143
  36. data/vendor/assets/bower_components/angular-cookies/angular-cookies.min.js +5 -4
  37. data/vendor/assets/bower_components/angular-cookies/angular-cookies.min.js.map +3 -3
  38. data/vendor/assets/bower_components/angular-cookies/bower.json +3 -2
  39. data/vendor/assets/bower_components/angular-cookies/index.js +2 -0
  40. data/vendor/assets/bower_components/angular-cookies/package.json +10 -3
  41. data/vendor/assets/bower_components/angular-sanitize/LICENSE.md +21 -0
  42. data/vendor/assets/bower_components/angular-sanitize/README.md +2 -11
  43. data/vendor/assets/bower_components/angular-sanitize/angular-sanitize.js +69 -64
  44. data/vendor/assets/bower_components/angular-sanitize/angular-sanitize.min.js +12 -12
  45. data/vendor/assets/bower_components/angular-sanitize/angular-sanitize.min.js.map +2 -2
  46. data/vendor/assets/bower_components/angular-sanitize/bower.json +3 -2
  47. data/vendor/assets/bower_components/angular-sanitize/index.js +2 -0
  48. data/vendor/assets/bower_components/angular-sanitize/package.json +10 -3
  49. data/vendor/assets/bower_components/angular/LICENSE.md +21 -0
  50. data/vendor/assets/bower_components/angular/README.md +2 -5
  51. data/vendor/assets/bower_components/angular/angular-csp.css +8 -0
  52. data/vendor/assets/bower_components/angular/angular.js +11011 -6910
  53. data/vendor/assets/bower_components/angular/angular.min.js +297 -244
  54. data/vendor/assets/bower_components/angular/angular.min.js.gzip +0 -0
  55. data/vendor/assets/bower_components/angular/angular.min.js.map +3 -3
  56. data/vendor/assets/bower_components/angular/bower.json +2 -1
  57. data/vendor/assets/bower_components/angular/index.js +2 -0
  58. data/vendor/assets/bower_components/angular/package.json +2 -2
  59. metadata +11 -3
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Angular
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -14,21 +14,12 @@ You can install this package either with `npm` or with `bower`.
14
14
  npm install angular-cookies
15
15
  ```
16
16
 
17
- Add a `<script>` to your `index.html`:
18
-
19
- ```html
20
- <script src="/node_modules/angular-cookies/angular-cookies.js"></script>
21
- ```
22
-
23
17
  Then add `ngCookies` as a dependency for your app:
24
18
 
25
19
  ```javascript
26
- angular.module('myApp', ['ngCookies']);
20
+ angular.module('myApp', [require('angular-cookies')]);
27
21
  ```
28
22
 
29
- Note that this package is not in CommonJS format, so doing `require('angular-cookies')` will
30
- return `undefined`.
31
-
32
23
  ### bower
33
24
 
34
25
  ```shell
@@ -56,7 +47,7 @@ Documentation is available on the
56
47
 
57
48
  The MIT License
58
49
 
59
- Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
50
+ Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
60
51
 
61
52
  Permission is hereby granted, free of charge, to any person obtaining a copy
62
53
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license AngularJS v1.2.27
3
- * (c) 2010-2014 Google, Inc. http://angularjs.org
2
+ * @license AngularJS v1.4.14
3
+ * (c) 2010-2015 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
6
6
  (function(window, angular, undefined) {'use strict';
@@ -17,190 +17,306 @@
17
17
  *
18
18
  * <div doc-module-components="ngCookies"></div>
19
19
  *
20
- * See {@link ngCookies.$cookies `$cookies`} and
21
- * {@link ngCookies.$cookieStore `$cookieStore`} for usage.
20
+ * See {@link ngCookies.$cookies `$cookies`} for usage.
22
21
  */
23
22
 
24
23
 
25
24
  angular.module('ngCookies', ['ng']).
26
25
  /**
27
- * @ngdoc service
28
- * @name $cookies
29
- *
26
+ * @ngdoc provider
27
+ * @name $cookiesProvider
30
28
  * @description
31
- * Provides read/write access to browser's cookies.
32
- *
33
- * Only a simple Object is exposed and by adding or removing properties to/from this object, new
34
- * cookies are created/deleted at the end of current $eval.
35
- * The object's properties can only be strings.
36
- *
37
- * Requires the {@link ngCookies `ngCookies`} module to be installed.
38
- *
39
- * @example
40
- *
41
- * ```js
42
- * angular.module('cookiesExample', ['ngCookies'])
43
- * .controller('ExampleController', ['$cookies', function($cookies) {
44
- * // Retrieving a cookie
45
- * var favoriteCookie = $cookies.myFavorite;
46
- * // Setting a cookie
47
- * $cookies.myFavorite = 'oatmeal';
48
- * }]);
49
- * ```
50
- */
51
- factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) {
52
- var cookies = {},
53
- lastCookies = {},
54
- lastBrowserCookies,
55
- runEval = false,
56
- copy = angular.copy,
57
- isUndefined = angular.isUndefined;
58
-
59
- //creates a poller fn that copies all cookies from the $browser to service & inits the service
60
- $browser.addPollFn(function() {
61
- var currentCookies = $browser.cookies();
62
- if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl
63
- lastBrowserCookies = currentCookies;
64
- copy(currentCookies, lastCookies);
65
- copy(currentCookies, cookies);
66
- if (runEval) $rootScope.$apply();
67
- }
68
- })();
69
-
70
- runEval = true;
71
-
72
- //at the end of each eval, push cookies
73
- //TODO: this should happen before the "delayed" watches fire, because if some cookies are not
74
- // strings or browser refuses to store some cookies, we update the model in the push fn.
75
- $rootScope.$watch(push);
76
-
77
- return cookies;
78
-
79
-
80
- /**
81
- * Pushes all the cookies from the service to the browser and verifies if all cookies were
82
- * stored.
83
- */
84
- function push() {
85
- var name,
86
- value,
87
- browserCookies,
88
- updated;
89
-
90
- //delete any cookies deleted in $cookies
91
- for (name in lastCookies) {
92
- if (isUndefined(cookies[name])) {
93
- $browser.cookies(name, undefined);
94
- }
95
- }
96
-
97
- //update all cookies updated in $cookies
98
- for(name in cookies) {
99
- value = cookies[name];
100
- if (!angular.isString(value)) {
101
- value = '' + value;
102
- cookies[name] = value;
103
- }
104
- if (value !== lastCookies[name]) {
105
- $browser.cookies(name, value);
106
- updated = true;
107
- }
108
- }
109
-
110
- //verify what was actually stored
111
- if (updated){
112
- updated = false;
113
- browserCookies = $browser.cookies();
114
-
115
- for (name in cookies) {
116
- if (cookies[name] !== browserCookies[name]) {
117
- //delete or reset all cookies that the browser dropped from $cookies
118
- if (isUndefined(browserCookies[name])) {
119
- delete cookies[name];
120
- } else {
121
- cookies[name] = browserCookies[name];
122
- }
123
- updated = true;
124
- }
125
- }
126
- }
127
- }
128
- }]).
129
-
29
+ * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service.
30
+ * */
31
+ provider('$cookies', [function $CookiesProvider() {
32
+ /**
33
+ * @ngdoc property
34
+ * @name $cookiesProvider#defaults
35
+ * @description
36
+ *
37
+ * Object containing default options to pass when setting cookies.
38
+ *
39
+ * The object may have following properties:
40
+ *
41
+ * - **path** - `{string}` - The cookie will be available only for this path and its
42
+ * sub-paths. By default, this is the URL that appears in your `<base>` tag.
43
+ * - **domain** - `{string}` - The cookie will be available only for this domain and
44
+ * its sub-domains. For security reasons the user agent will not accept the cookie
45
+ * if the current domain is not a sub-domain of this domain or equal to it.
46
+ * - **expires** - `{string|Date}` - String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT"
47
+ * or a Date object indicating the exact date/time this cookie will expire.
48
+ * - **secure** - `{boolean}` - If `true`, then the cookie will only be available through a
49
+ * secured connection.
50
+ *
51
+ * Note: By default, the address that appears in your `<base>` tag will be used as the path.
52
+ * This is important so that cookies will be visible for all routes when html5mode is enabled.
53
+ *
54
+ **/
55
+ var defaults = this.defaults = {};
130
56
 
131
- /**
132
- * @ngdoc service
133
- * @name $cookieStore
134
- * @requires $cookies
135
- *
136
- * @description
137
- * Provides a key-value (string-object) storage, that is backed by session cookies.
138
- * Objects put or retrieved from this storage are automatically serialized or
139
- * deserialized by angular's toJson/fromJson.
140
- *
141
- * Requires the {@link ngCookies `ngCookies`} module to be installed.
142
- *
143
- * @example
144
- *
145
- * ```js
146
- * angular.module('cookieStoreExample', ['ngCookies'])
147
- * .controller('ExampleController', ['$cookieStore', function($cookieStore) {
148
- * // Put cookie
149
- * $cookieStore.put('myFavorite','oatmeal');
150
- * // Get cookie
151
- * var favoriteCookie = $cookieStore.get('myFavorite');
152
- * // Removing a cookie
153
- * $cookieStore.remove('myFavorite');
154
- * }]);
155
- * ```
156
- */
157
- factory('$cookieStore', ['$cookies', function($cookies) {
57
+ function calcOptions(options) {
58
+ return options ? angular.extend({}, defaults, options) : defaults;
59
+ }
158
60
 
61
+ /**
62
+ * @ngdoc service
63
+ * @name $cookies
64
+ *
65
+ * @description
66
+ * Provides read/write access to browser's cookies.
67
+ *
68
+ * <div class="alert alert-info">
69
+ * Up until Angular 1.3, `$cookies` exposed properties that represented the
70
+ * current browser cookie values. In version 1.4, this behavior has changed, and
71
+ * `$cookies` now provides a standard api of getters, setters etc.
72
+ * </div>
73
+ *
74
+ * Requires the {@link ngCookies `ngCookies`} module to be installed.
75
+ *
76
+ * @example
77
+ *
78
+ * ```js
79
+ * angular.module('cookiesExample', ['ngCookies'])
80
+ * .controller('ExampleController', ['$cookies', function($cookies) {
81
+ * // Retrieving a cookie
82
+ * var favoriteCookie = $cookies.get('myFavorite');
83
+ * // Setting a cookie
84
+ * $cookies.put('myFavorite', 'oatmeal');
85
+ * }]);
86
+ * ```
87
+ */
88
+ this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) {
159
89
  return {
160
90
  /**
161
91
  * @ngdoc method
162
- * @name $cookieStore#get
92
+ * @name $cookies#get
163
93
  *
164
94
  * @description
165
95
  * Returns the value of given cookie key
166
96
  *
167
97
  * @param {string} key Id to use for lookup.
168
- * @returns {Object} Deserialized cookie value.
98
+ * @returns {string} Raw cookie value.
169
99
  */
170
100
  get: function(key) {
171
- var value = $cookies[key];
101
+ return $$cookieReader()[key];
102
+ },
103
+
104
+ /**
105
+ * @ngdoc method
106
+ * @name $cookies#getObject
107
+ *
108
+ * @description
109
+ * Returns the deserialized value of given cookie key
110
+ *
111
+ * @param {string} key Id to use for lookup.
112
+ * @returns {Object} Deserialized cookie value.
113
+ */
114
+ getObject: function(key) {
115
+ var value = this.get(key);
172
116
  return value ? angular.fromJson(value) : value;
173
117
  },
174
118
 
175
119
  /**
176
120
  * @ngdoc method
177
- * @name $cookieStore#put
121
+ * @name $cookies#getAll
122
+ *
123
+ * @description
124
+ * Returns a key value object with all the cookies
125
+ *
126
+ * @returns {Object} All cookies
127
+ */
128
+ getAll: function() {
129
+ return $$cookieReader();
130
+ },
131
+
132
+ /**
133
+ * @ngdoc method
134
+ * @name $cookies#put
178
135
  *
179
136
  * @description
180
137
  * Sets a value for given cookie key
181
138
  *
182
139
  * @param {string} key Id for the `value`.
140
+ * @param {string} value Raw value to be stored.
141
+ * @param {Object=} options Options object.
142
+ * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
143
+ */
144
+ put: function(key, value, options) {
145
+ $$cookieWriter(key, value, calcOptions(options));
146
+ },
147
+
148
+ /**
149
+ * @ngdoc method
150
+ * @name $cookies#putObject
151
+ *
152
+ * @description
153
+ * Serializes and sets a value for given cookie key
154
+ *
155
+ * @param {string} key Id for the `value`.
183
156
  * @param {Object} value Value to be stored.
157
+ * @param {Object=} options Options object.
158
+ * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
184
159
  */
185
- put: function(key, value) {
186
- $cookies[key] = angular.toJson(value);
160
+ putObject: function(key, value, options) {
161
+ this.put(key, angular.toJson(value), options);
187
162
  },
188
163
 
189
164
  /**
190
165
  * @ngdoc method
191
- * @name $cookieStore#remove
166
+ * @name $cookies#remove
192
167
  *
193
168
  * @description
194
169
  * Remove given cookie
195
170
  *
196
171
  * @param {string} key Id of the key-value pair to delete.
172
+ * @param {Object=} options Options object.
173
+ * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
197
174
  */
198
- remove: function(key) {
199
- delete $cookies[key];
175
+ remove: function(key, options) {
176
+ $$cookieWriter(key, undefined, calcOptions(options));
200
177
  }
201
178
  };
179
+ }];
180
+ }]);
181
+
182
+ angular.module('ngCookies').
183
+ /**
184
+ * @ngdoc service
185
+ * @name $cookieStore
186
+ * @deprecated
187
+ * @requires $cookies
188
+ *
189
+ * @description
190
+ * Provides a key-value (string-object) storage, that is backed by session cookies.
191
+ * Objects put or retrieved from this storage are automatically serialized or
192
+ * deserialized by angular's toJson/fromJson.
193
+ *
194
+ * Requires the {@link ngCookies `ngCookies`} module to be installed.
195
+ *
196
+ * <div class="alert alert-danger">
197
+ * **Note:** The $cookieStore service is **deprecated**.
198
+ * Please use the {@link ngCookies.$cookies `$cookies`} service instead.
199
+ * </div>
200
+ *
201
+ * @example
202
+ *
203
+ * ```js
204
+ * angular.module('cookieStoreExample', ['ngCookies'])
205
+ * .controller('ExampleController', ['$cookieStore', function($cookieStore) {
206
+ * // Put cookie
207
+ * $cookieStore.put('myFavorite','oatmeal');
208
+ * // Get cookie
209
+ * var favoriteCookie = $cookieStore.get('myFavorite');
210
+ * // Removing a cookie
211
+ * $cookieStore.remove('myFavorite');
212
+ * }]);
213
+ * ```
214
+ */
215
+ factory('$cookieStore', ['$cookies', function($cookies) {
216
+
217
+ return {
218
+ /**
219
+ * @ngdoc method
220
+ * @name $cookieStore#get
221
+ *
222
+ * @description
223
+ * Returns the value of given cookie key
224
+ *
225
+ * @param {string} key Id to use for lookup.
226
+ * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist.
227
+ */
228
+ get: function(key) {
229
+ return $cookies.getObject(key);
230
+ },
231
+
232
+ /**
233
+ * @ngdoc method
234
+ * @name $cookieStore#put
235
+ *
236
+ * @description
237
+ * Sets a value for given cookie key
238
+ *
239
+ * @param {string} key Id for the `value`.
240
+ * @param {Object} value Value to be stored.
241
+ */
242
+ put: function(key, value) {
243
+ $cookies.putObject(key, value);
244
+ },
245
+
246
+ /**
247
+ * @ngdoc method
248
+ * @name $cookieStore#remove
249
+ *
250
+ * @description
251
+ * Remove given cookie
252
+ *
253
+ * @param {string} key Id of the key-value pair to delete.
254
+ */
255
+ remove: function(key) {
256
+ $cookies.remove(key);
257
+ }
258
+ };
259
+
260
+ }]);
261
+
262
+ /**
263
+ * @name $$cookieWriter
264
+ * @requires $document
265
+ *
266
+ * @description
267
+ * This is a private service for writing cookies
268
+ *
269
+ * @param {string} name Cookie name
270
+ * @param {string=} value Cookie value (if undefined, cookie will be deleted)
271
+ * @param {Object=} options Object with options that need to be stored for the cookie.
272
+ */
273
+ function $$CookieWriter($document, $log, $browser) {
274
+ var cookiePath = $browser.baseHref();
275
+ var rawDocument = $document[0];
276
+
277
+ function buildCookieString(name, value, options) {
278
+ var path, expires;
279
+ options = options || {};
280
+ expires = options.expires;
281
+ path = angular.isDefined(options.path) ? options.path : cookiePath;
282
+ if (angular.isUndefined(value)) {
283
+ expires = 'Thu, 01 Jan 1970 00:00:00 GMT';
284
+ value = '';
285
+ }
286
+ if (angular.isString(expires)) {
287
+ expires = new Date(expires);
288
+ }
289
+
290
+ var str = encodeURIComponent(name) + '=' + encodeURIComponent(value);
291
+ str += path ? ';path=' + path : '';
292
+ str += options.domain ? ';domain=' + options.domain : '';
293
+ str += expires ? ';expires=' + expires.toUTCString() : '';
294
+ str += options.secure ? ';secure' : '';
295
+
296
+ // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:
297
+ // - 300 cookies
298
+ // - 20 cookies per unique domain
299
+ // - 4096 bytes per cookie
300
+ var cookieLength = str.length + 1;
301
+ if (cookieLength > 4096) {
302
+ $log.warn("Cookie '" + name +
303
+ "' possibly not set or overflowed because it was too large (" +
304
+ cookieLength + " > 4096 bytes)!");
305
+ }
306
+
307
+ return str;
308
+ }
309
+
310
+ return function(name, value, options) {
311
+ rawDocument.cookie = buildCookieString(name, value, options);
312
+ };
313
+ }
314
+
315
+ $$CookieWriter.$inject = ['$document', '$log', '$browser'];
202
316
 
203
- }]);
317
+ angular.module('ngCookies').provider('$$cookieWriter', function $$CookieWriterProvider() {
318
+ this.$get = $$CookieWriter;
319
+ });
204
320
 
205
321
 
206
322
  })(window, window.angular);