scms 4.1.2 → 4.2.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 (56) hide show
  1. checksums.yaml +8 -8
  2. data/assets/blank-template/_config.yml +1 -37
  3. data/assets/blank-template/_layouts/home-layout.erb +85 -0
  4. data/assets/blank-template/_layouts/layout.erb +1 -0
  5. data/assets/blank-template/_pages/cleanurl/_config.yml +1 -0
  6. data/assets/blank-template/_pages/cleanurl/intro.md +1 -0
  7. data/assets/blank-template/_pages/cleanurl/leadin.md +1 -0
  8. data/assets/blank-template/_pages/cleanurl/main.erb +69 -0
  9. data/assets/blank-template/_pages/cleanurl/sidenav.erb +5 -0
  10. data/assets/blank-template/_pages/getting-started/intro.md +1 -0
  11. data/assets/blank-template/_pages/getting-started/leadin.md +1 -0
  12. data/assets/blank-template/_pages/getting-started/main.erb +67 -0
  13. data/assets/blank-template/_pages/getting-started/sidenav.erb +5 -0
  14. data/assets/blank-template/_pages/index/_config.yml +1 -0
  15. data/assets/blank-template/_pages/index/carousel.erb +1 -0
  16. data/assets/blank-template/_pages/index/main.erb +1 -0
  17. data/assets/blank-template/css/bootstrap-theme.css +459 -0
  18. data/assets/blank-template/css/bootstrap-theme.min.css +9 -0
  19. data/assets/blank-template/css/bootstrap.css +7059 -0
  20. data/assets/blank-template/css/bootstrap.min.css +9 -0
  21. data/assets/blank-template/css/carousel.css +1 -0
  22. data/assets/blank-template/css/carousel.scss +151 -0
  23. data/assets/blank-template/css/layout.css +6 -0
  24. data/assets/blank-template/css/layout.scss +459 -0
  25. data/assets/blank-template/fonts/glyphicons-halflings-regular.eot +0 -0
  26. data/assets/blank-template/fonts/glyphicons-halflings-regular.svg +229 -0
  27. data/assets/blank-template/fonts/glyphicons-halflings-regular.ttf +0 -0
  28. data/assets/blank-template/fonts/glyphicons-halflings-regular.woff +0 -0
  29. data/assets/blank-template/js/application.js +61 -0
  30. data/assets/blank-template/js/bootstrap.js +2002 -0
  31. data/assets/blank-template/js/bootstrap.min.js +9 -0
  32. data/assets/blank-template/js/jquery-1.10.2.min.js +6 -0
  33. data/assets/blank-template/js/shims/holder.js +404 -0
  34. data/assets/blank-template/js/shims/html5shiv.js +8 -0
  35. data/assets/blank-template/js/shims/respond.min.js +6 -0
  36. data/assets/blank-template-v1/_config.yml +37 -0
  37. data/assets/{blank-template → blank-template-v1}/_layouts/skin.erb.html +0 -0
  38. data/assets/{blank-template → blank-template-v1}/_s3config.template.yml +0 -0
  39. data/assets/{blank-template → blank-template-v1}/_source/scripts/bootstrap.js +0 -0
  40. data/assets/{blank-template → blank-template-v1}/_source/scripts/script.js +0 -0
  41. data/assets/{blank-template → blank-template-v1}/_source/stylesheets/bootstrap-responsive.css +0 -0
  42. data/assets/{blank-template → blank-template-v1}/_source/stylesheets/bootstrap.css +0 -0
  43. data/assets/{blank-template → blank-template-v1}/_source/stylesheets/style.css +0 -0
  44. data/assets/{blank-template → blank-template-v1}/_views/about/intro.html +0 -0
  45. data/assets/{blank-template → blank-template-v1}/_views/about/main.html +0 -0
  46. data/assets/{blank-template → blank-template-v1}/_views/home/intro.md +0 -0
  47. data/assets/{blank-template → blank-template-v1}/_views/reuse.erb +0 -0
  48. data/assets/{blank-template → blank-template-v1}/images/glyphicons-halflings-white.png +0 -0
  49. data/assets/{blank-template → blank-template-v1}/images/glyphicons-halflings.png +0 -0
  50. data/assets/{blank-template → blank-template-v1}/js/jquery-1.8.2.min.js +0 -0
  51. data/assets/{blank-template → blank-template-v1}/robots.txt +0 -0
  52. data/lib/scms/scms-bundler.rb +108 -0
  53. data/lib/scms/scms-watcher.rb +52 -30
  54. data/lib/scms/version.rb +1 -1
  55. data/lib/scms.rb +24 -8
  56. metadata +52 -17
@@ -0,0 +1,404 @@
1
+ /*
2
+
3
+ Holder - 2.1 - client side image placeholders
4
+ (c) 2012-2013 Ivan Malopinsky / http://imsky.co
5
+
6
+ Provided under the MIT License.
7
+ Commercial use requires attribution.
8
+
9
+ */
10
+
11
+ var Holder = Holder || {};
12
+ (function (app, win) {
13
+
14
+ var preempted = false,
15
+ fallback = false,
16
+ canvas = document.createElement('canvas');
17
+
18
+ if (!canvas.getContext) {
19
+ fallback = true;
20
+ } else {
21
+ if (canvas.toDataURL("image/png")
22
+ .indexOf("data:image/png") < 0) {
23
+ //Android doesn't support data URI
24
+ fallback = true;
25
+ } else {
26
+ var ctx = canvas.getContext("2d");
27
+ }
28
+ }
29
+
30
+ var dpr = 1, bsr = 1;
31
+
32
+ if(!fallback){
33
+ dpr = window.devicePixelRatio || 1,
34
+ bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;
35
+ }
36
+
37
+ var ratio = dpr / bsr;
38
+
39
+ //getElementsByClassName polyfill
40
+ document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s})
41
+
42
+ //getComputedStyle polyfill
43
+ window.getComputedStyle||(window.getComputedStyle=function(e){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this})
44
+
45
+ //http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications
46
+ function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}}
47
+
48
+ //https://gist.github.com/991057 by Jed Schmidt with modifications
49
+ function selector(a){
50
+ a=a.match(/^(\W)?(.*)/);var b=document["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2]);
51
+ var ret=[]; b!==null&&(b.length?ret=b:b.length===0?ret=b:ret=[b]); return ret;
52
+ }
53
+
54
+ //shallow object property extend
55
+ function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}
56
+
57
+ //hasOwnProperty polyfill
58
+ if (!Object.prototype.hasOwnProperty)
59
+ /*jshint -W001, -W103 */
60
+ Object.prototype.hasOwnProperty = function(prop) {
61
+ var proto = this.__proto__ || this.constructor.prototype;
62
+ return (prop in this) && (!(prop in proto) || proto[prop] !== this[prop]);
63
+ }
64
+ /*jshint +W001, +W103 */
65
+
66
+ function text_size(width, height, template) {
67
+ height = parseInt(height, 10);
68
+ width = parseInt(width, 10);
69
+ var bigSide = Math.max(height, width)
70
+ var smallSide = Math.min(height, width)
71
+ var scale = 1 / 12;
72
+ var newHeight = Math.min(smallSide * 0.75, 0.75 * bigSide * scale);
73
+ return {
74
+ height: Math.round(Math.max(template.size, newHeight))
75
+ }
76
+ }
77
+
78
+ function draw(ctx, dimensions, template, ratio, literal) {
79
+ var ts = text_size(dimensions.width, dimensions.height, template);
80
+ var text_height = ts.height;
81
+ var width = dimensions.width * ratio,
82
+ height = dimensions.height * ratio;
83
+ var font = template.font ? template.font : "sans-serif";
84
+ canvas.width = width;
85
+ canvas.height = height;
86
+ ctx.textAlign = "center";
87
+ ctx.textBaseline = "middle";
88
+ ctx.fillStyle = template.background;
89
+ ctx.fillRect(0, 0, width, height);
90
+ ctx.fillStyle = template.foreground;
91
+ ctx.font = "bold " + text_height + "px " + font;
92
+ var text = template.text ? template.text : (Math.floor(dimensions.width) + "x" + Math.floor(dimensions.height));
93
+ if (literal) {
94
+ text = template.literalText;
95
+ }
96
+ var text_width = ctx.measureText(text).width;
97
+ if (text_width / width >= 0.75) {
98
+ text_height = Math.floor(text_height * 0.75 * (width / text_width));
99
+ }
100
+ //Resetting font size if necessary
101
+ ctx.font = "bold " + (text_height * ratio) + "px " + font;
102
+ ctx.fillText(text, (width / 2), (height / 2), width);
103
+ return canvas.toDataURL("image/png");
104
+ }
105
+
106
+ function render(mode, el, holder, src) {
107
+ var dimensions = holder.dimensions,
108
+ theme = holder.theme,
109
+ text = holder.text ? decodeURIComponent(holder.text) : holder.text;
110
+ var dimensions_caption = dimensions.width + "x" + dimensions.height;
111
+ theme = (text ? extend(theme, {
112
+ text: text
113
+ }) : theme);
114
+ theme = (holder.font ? extend(theme, {
115
+ font: holder.font
116
+ }) : theme);
117
+ el.setAttribute("data-src", src);
118
+ theme.literalText = dimensions_caption;
119
+ holder.originalTheme = holder.theme;
120
+ holder.theme = theme;
121
+
122
+ if (mode == "image") {
123
+ el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption);
124
+ if (fallback || !holder.auto) {
125
+ el.style.width = dimensions.width + "px";
126
+ el.style.height = dimensions.height + "px";
127
+ }
128
+ if (fallback) {
129
+ el.style.backgroundColor = theme.background;
130
+ } else {
131
+ el.setAttribute("src", draw(ctx, dimensions, theme, ratio));
132
+ }
133
+ } else if (mode == "background") {
134
+ if (!fallback) {
135
+ el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")";
136
+ el.style.backgroundSize = dimensions.width + "px " + dimensions.height + "px";
137
+ }
138
+ } else if (mode == "fluid") {
139
+ el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption);
140
+ if (dimensions.height.slice(-1) == "%") {
141
+ el.style.height = dimensions.height
142
+ } else {
143
+ el.style.height = dimensions.height + "px"
144
+ }
145
+ if (dimensions.width.slice(-1) == "%") {
146
+ el.style.width = dimensions.width
147
+ } else {
148
+ el.style.width = dimensions.width + "px"
149
+ }
150
+ if (el.style.display == "inline" || el.style.display === "") {
151
+ el.style.display = "block";
152
+ }
153
+ if (fallback) {
154
+ el.style.backgroundColor = theme.background;
155
+ } else {
156
+ el.holderData = holder;
157
+ fluid_images.push(el);
158
+ fluid_update(el);
159
+ }
160
+ }
161
+ }
162
+
163
+ function fluid_update(element) {
164
+ var images;
165
+ if (element.nodeType == null) {
166
+ images = fluid_images;
167
+ } else {
168
+ images = [element]
169
+ }
170
+ for (var i in images) {
171
+ var el = images[i]
172
+ if (el.holderData) {
173
+ var holder = el.holderData;
174
+ el.setAttribute("src", draw(ctx, {
175
+ height: el.clientHeight,
176
+ width: el.clientWidth
177
+ }, holder.theme, ratio, !! holder.literal));
178
+ }
179
+ }
180
+ }
181
+
182
+ function parse_flags(flags, options) {
183
+ var ret = {
184
+ theme: settings.themes.gray
185
+ };
186
+ var render = false;
187
+ for (sl = flags.length, j = 0; j < sl; j++) {
188
+ var flag = flags[j];
189
+ if (app.flags.dimensions.match(flag)) {
190
+ render = true;
191
+ ret.dimensions = app.flags.dimensions.output(flag);
192
+ } else if (app.flags.fluid.match(flag)) {
193
+ render = true;
194
+ ret.dimensions = app.flags.fluid.output(flag);
195
+ ret.fluid = true;
196
+ } else if (app.flags.literal.match(flag)) {
197
+ ret.literal = true;
198
+ } else if (app.flags.colors.match(flag)) {
199
+ ret.theme = app.flags.colors.output(flag);
200
+ } else if (options.themes[flag]) {
201
+ //If a theme is specified, it will override custom colors
202
+ ret.theme = options.themes[flag];
203
+ } else if (app.flags.font.match(flag)) {
204
+ ret.font = app.flags.font.output(flag);
205
+ } else if (app.flags.auto.match(flag)) {
206
+ ret.auto = true;
207
+ } else if (app.flags.text.match(flag)) {
208
+ ret.text = app.flags.text.output(flag);
209
+ }
210
+ }
211
+ return render ? ret : false;
212
+ }
213
+ var fluid_images = [];
214
+ var settings = {
215
+ domain: "holder.js",
216
+ images: "img",
217
+ bgnodes: ".holderjs",
218
+ themes: {
219
+ "gray": {
220
+ background: "#eee",
221
+ foreground: "#aaa",
222
+ size: 12
223
+ },
224
+ "social": {
225
+ background: "#3a5a97",
226
+ foreground: "#fff",
227
+ size: 12
228
+ },
229
+ "industrial": {
230
+ background: "#434A52",
231
+ foreground: "#C2F200",
232
+ size: 12
233
+ }
234
+ },
235
+ stylesheet: ""
236
+ };
237
+ app.flags = {
238
+ dimensions: {
239
+ regex: /^(\d+)x(\d+)$/,
240
+ output: function (val) {
241
+ var exec = this.regex.exec(val);
242
+ return {
243
+ width: +exec[1],
244
+ height: +exec[2]
245
+ }
246
+ }
247
+ },
248
+ fluid: {
249
+ regex: /^([0-9%]+)x([0-9%]+)$/,
250
+ output: function (val) {
251
+ var exec = this.regex.exec(val);
252
+ return {
253
+ width: exec[1],
254
+ height: exec[2]
255
+ }
256
+ }
257
+ },
258
+ colors: {
259
+ regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i,
260
+ output: function (val) {
261
+ var exec = this.regex.exec(val);
262
+ return {
263
+ size: settings.themes.gray.size,
264
+ foreground: "#" + exec[2],
265
+ background: "#" + exec[1]
266
+ }
267
+ }
268
+ },
269
+ text: {
270
+ regex: /text\:(.*)/,
271
+ output: function (val) {
272
+ return this.regex.exec(val)[1];
273
+ }
274
+ },
275
+ font: {
276
+ regex: /font\:(.*)/,
277
+ output: function (val) {
278
+ return this.regex.exec(val)[1];
279
+ }
280
+ },
281
+ auto: {
282
+ regex: /^auto$/
283
+ },
284
+ literal: {
285
+ regex: /^literal$/
286
+ }
287
+ }
288
+ for (var flag in app.flags) {
289
+ if (!app.flags.hasOwnProperty(flag)) continue;
290
+ app.flags[flag].match = function (val) {
291
+ return val.match(this.regex)
292
+ }
293
+ }
294
+ app.add_theme = function (name, theme) {
295
+ name != null && theme != null && (settings.themes[name] = theme);
296
+ return app;
297
+ };
298
+ app.add_image = function (src, el) {
299
+ var node = selector(el);
300
+ if (node.length) {
301
+ for (var i = 0, l = node.length; i < l; i++) {
302
+ var img = document.createElement("img")
303
+ img.setAttribute("data-src", src);
304
+ node[i].appendChild(img);
305
+ }
306
+ }
307
+ return app;
308
+ };
309
+ app.run = function (o) {
310
+ var options = extend(settings, o),
311
+ images = [],
312
+ imageNodes = [],
313
+ bgnodes = [];
314
+ if (typeof (options.images) == "string") {
315
+ imageNodes = selector(options.images);
316
+ } else if (window.NodeList && options.images instanceof window.NodeList) {
317
+ imageNodes = options.images;
318
+ } else if (window.Node && options.images instanceof window.Node) {
319
+ imageNodes = [options.images];
320
+ }
321
+ if (typeof (options.bgnodes) == "string") {
322
+ bgnodes = selector(options.bgnodes);
323
+ } else if (window.NodeList && options.elements instanceof window.NodeList) {
324
+ bgnodes = options.bgnodes;
325
+ } else if (window.Node && options.bgnodes instanceof window.Node) {
326
+ bgnodes = [options.bgnodes];
327
+ }
328
+ preempted = true;
329
+ for (i = 0, l = imageNodes.length; i < l; i++) images.push(imageNodes[i]);
330
+ var holdercss = document.getElementById("holderjs-style");
331
+ if (!holdercss) {
332
+ holdercss = document.createElement("style");
333
+ holdercss.setAttribute("id", "holderjs-style");
334
+ holdercss.type = "text/css";
335
+ document.getElementsByTagName("head")[0].appendChild(holdercss);
336
+ }
337
+ if (!options.nocss) {
338
+ if (holdercss.styleSheet) {
339
+ holdercss.styleSheet.cssText += options.stylesheet;
340
+ } else {
341
+ holdercss.appendChild(document.createTextNode(options.stylesheet));
342
+ }
343
+ }
344
+ var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)");
345
+ for (var l = bgnodes.length, i = 0; i < l; i++) {
346
+ var src = window.getComputedStyle(bgnodes[i], null)
347
+ .getPropertyValue("background-image");
348
+ var flags = src.match(cssregex);
349
+ var bgsrc = bgnodes[i].getAttribute("data-background-src");
350
+ if (flags) {
351
+ var holder = parse_flags(flags[1].split("/"), options);
352
+ if (holder) {
353
+ render("background", bgnodes[i], holder, src);
354
+ }
355
+ } else if (bgsrc != null) {
356
+ var holder = parse_flags(bgsrc.substr(bgsrc.lastIndexOf(options.domain) + options.domain.length + 1)
357
+ .split("/"), options);
358
+ if (holder) {
359
+ render("background", bgnodes[i], holder, src);
360
+ }
361
+ }
362
+ }
363
+ for (l = images.length, i = 0; i < l; i++) {
364
+ var attr_data_src, attr_src;
365
+ attr_src = attr_data_src = src = null;
366
+ try {
367
+ attr_src = images[i].getAttribute("src");
368
+ attr_datasrc = images[i].getAttribute("data-src");
369
+ } catch (e) {}
370
+ if (attr_datasrc == null && !! attr_src && attr_src.indexOf(options.domain) >= 0) {
371
+ src = attr_src;
372
+ } else if ( !! attr_datasrc && attr_datasrc.indexOf(options.domain) >= 0) {
373
+ src = attr_datasrc;
374
+ }
375
+ if (src) {
376
+ var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1)
377
+ .split("/"), options);
378
+ if (holder) {
379
+ if (holder.fluid) {
380
+ render("fluid", images[i], holder, src)
381
+ } else {
382
+ render("image", images[i], holder, src);
383
+ }
384
+ }
385
+ }
386
+ }
387
+ return app;
388
+ };
389
+ contentLoaded(win, function () {
390
+ if (window.addEventListener) {
391
+ window.addEventListener("resize", fluid_update, false);
392
+ window.addEventListener("orientationchange", fluid_update, false);
393
+ } else {
394
+ window.attachEvent("onresize", fluid_update)
395
+ }
396
+ preempted || app.run();
397
+ });
398
+ if (typeof define === "function" && define.amd) {
399
+ define([], function () {
400
+ return app;
401
+ });
402
+ }
403
+
404
+ })(Holder, window);
@@ -0,0 +1,8 @@
1
+ /*
2
+ HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3
+ */
4
+ (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
5
+ a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
6
+ c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
7
+ "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
8
+ if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
@@ -0,0 +1,6 @@
1
+ /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
2
+ /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
3
+ window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document);
4
+
5
+ /*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
6
+ (function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this);
@@ -0,0 +1,37 @@
1
+ template: _layouts/skin.erb.html # The website skin (erb template)
2
+ #rooturl: http://www.mywebsite.com/ #Whats the website root when published - All references in html will be replaced with this
3
+ # Define your pages here
4
+ pages:
5
+ - index:
6
+ generate: index.html
7
+ navigation: Home
8
+ title: My Homepage
9
+ description: Meta description
10
+ keywords: "CMS, S3, Ruby"
11
+ views:
12
+ intro: _views/home/intro.md
13
+ main: "_views/reuse.erb?h1=Heading 1&h2=Heading 2&h3=Heading 3"
14
+ - about:
15
+ generate: about.html
16
+ navigation: About
17
+ views:
18
+ intro: _views/about/intro.html
19
+ main: "_views/reuse.erb?h1=Reuse 1&h2=Reuse 2&h3=Reuse 3"
20
+ - contact: #Pageless for nav only
21
+ navigation: contact
22
+ navigation_meta: contactform
23
+ url: about:blank
24
+
25
+ # Define your bundles here (versioning is recomended if your caching assets)
26
+ bundles:
27
+ - script:
28
+ generate: js/script.bundle.min-v2.1.1.js
29
+ files:
30
+ - _source/scripts/bootstrap.js
31
+ - _source/scripts/script.js
32
+ - style:
33
+ generate: css/style.bundle-1.0.css
34
+ files:
35
+ - _source/stylesheets/bootstrap.css
36
+ - _source/stylesheets/bootstrap-responsive.css
37
+ - _source/stylesheets/style.css
@@ -0,0 +1,108 @@
1
+ module ScmsBundler
2
+ require 'fileutils'
3
+ require 'scms/scms-bundler.rb'
4
+
5
+ def ScmsBundler.run()
6
+ Dir.glob('**/*.bundle').each do|bundle|
7
+ ScmsBundler.bundle(bundle)
8
+ end
9
+ end
10
+
11
+ def ScmsBundler.bundle(bundle)
12
+ puts "Parsing bundle: #{bundle}"
13
+
14
+
15
+ content = ""
16
+ if File::exists?(bundle)
17
+ wd = File.dirname(bundle)
18
+
19
+
20
+ File.readlines(bundle).each do |line|
21
+ bundleFile = line.strip
22
+ bundleFile = bundleFile.gsub('\n', '')
23
+
24
+ next if bundleFile == nil
25
+ next if bundleFile == ""
26
+
27
+ if !line.match(/^#/)
28
+ b = File.join(wd, bundleFile)
29
+ puts "Including: #{line}"
30
+ if File::exists?(b)
31
+ content += File.read(b) + "\n"
32
+ else
33
+ puts "Can not read: #{b}"
34
+ end
35
+ end
36
+ end
37
+
38
+ out = ScmsBundler.getGeneratedBundleName(bundle)
39
+ begin
40
+ File.open(out, 'w') {|f| f.write(content) }
41
+ ScmsUtils.successLog("Created: #{out}")
42
+ rescue Exception=>e
43
+ ScmsUtils.errLog("Error creating bundle: #{out}")
44
+ ScmsUtils.errLog(e.message)
45
+ ScmsUtils.log(e.backtrace.inspect)
46
+ end
47
+ end
48
+ end
49
+
50
+ def ScmsBundler.watch()
51
+ # Listen to changes to files withing a bundle
52
+ Dir.glob('**/*.bundle').each do|bundle|
53
+ ScmsBundler.watchBundle(bundle)
54
+ end
55
+ end
56
+
57
+ def ScmsBundler.watchBundle(bundle)
58
+ files = ScmsBundler.getBundleFiles(bundle)
59
+ Thread.new {
60
+ FileWatcher.new(files).watch do |filename|
61
+ begin
62
+ ScmsBundler.bundle(bundle)
63
+ rescue Exception=>e
64
+ ScmsUtils.errLog(e.message)
65
+ ScmsUtils.log(e.backtrace.inspect)
66
+ end
67
+ end
68
+ }
69
+ end
70
+
71
+ def ScmsBundler.getBundleFiles(bundle)
72
+ files = []
73
+ if File::exists?(bundle)
74
+ wd = File.dirname(bundle)
75
+ File.readlines(bundle).each do |line|
76
+ bundleFile = line.strip
77
+ bundleFile = bundleFile.gsub('\n', '')
78
+
79
+ next if bundleFile == nil
80
+ next if bundleFile == ""
81
+ next if line.match(/^generate:/)
82
+
83
+ if !line.match(/^#/)
84
+ b = File.join(wd, bundleFile)
85
+ if File::exists?(b)
86
+ files << b
87
+ end
88
+ end
89
+ end
90
+ end
91
+ return files
92
+ end
93
+
94
+ def ScmsBundler.getGeneratedBundleName(bundle)
95
+ name = bundle.gsub(".bundle", "")
96
+
97
+ if File::exists?(bundle)
98
+ wd = File.dirname(bundle)
99
+ File.readlines(bundle).each do |line|
100
+ if line.match(/^generate:/)
101
+ name = File.join(wd, line.gsub("generate:", "").strip)
102
+ break
103
+ end
104
+ end
105
+ end
106
+ return name
107
+ end
108
+ end