j1-template 2022.5.1 → 2022.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
  3. data/assets/data/banner.html +2 -2
  4. data/assets/data/panel.html +4 -4
  5. data/assets/themes/j1/adapter/js/attic.js +19 -2
  6. data/assets/themes/j1/adapter/js/rtable.js +68 -5
  7. data/assets/themes/j1/adapter/js/scroller.js +7 -0
  8. data/assets/themes/j1/core/css/vendor.css +5 -6
  9. data/assets/themes/j1/core/css/vendor.min.css +1 -1
  10. data/assets/themes/j1/core/js/template.js +2 -1
  11. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  12. data/assets/themes/j1/modules/jquery/js/extensions/hasClass.js +20 -0
  13. data/assets/themes/j1/modules/jquery/js/extensions/removeClass.js +24 -0
  14. data/assets/themes/j1/modules/rtable/js/rtable.js +22 -16
  15. data/assets/themes/j1/modules/rtable/js/rtable.min.js +1 -1
  16. data/assets/themes/j1/modules/themeSwitcher/LICENSE +21 -21
  17. data/assets/themes/j1/modules/themeSwitcher/README.md +166 -166
  18. data/lib/j1/commands/app.rb +36 -0
  19. data/lib/j1/commands/generate.rb +1 -1
  20. data/lib/j1/commands/patch.rb +1 -1
  21. data/lib/j1/commands/rebuild.rb +1 -1
  22. data/lib/j1/commands/reset.rb +1 -1
  23. data/lib/j1/commands/setup.rb +1 -1
  24. data/lib/j1/commands/site.rb +1 -1
  25. data/lib/j1/version.rb +1 -1
  26. data/lib/j1_app.rb +1 -1
  27. data/lib/starter_web/Gemfile +1 -1
  28. data/lib/starter_web/README.md +5 -5
  29. data/lib/starter_web/_config.yml +1 -1
  30. data/lib/starter_web/_data/asciidoc2pdf/images/cover/readme +39 -0
  31. data/lib/starter_web/_data/asciidoc2pdf/themes/base-theme.yml +113 -117
  32. data/lib/starter_web/_data/asciidoc2pdf/themes/default-for-print-theme.yml +25 -24
  33. data/lib/starter_web/_data/asciidoc2pdf/themes/default-for-print-with-fallback-font-theme.yml +1 -0
  34. data/lib/starter_web/_data/asciidoc2pdf/themes/default-theme.yml +215 -212
  35. data/lib/starter_web/_data/asciidoc2pdf/themes/default-with-fallback-font-theme.yml +9 -5
  36. data/lib/starter_web/_data/asciidoc2pdf/themes/j1-theme.yml +24 -5
  37. data/lib/starter_web/_data/blocks/banner.yml +1 -1
  38. data/lib/starter_web/_data/modules/defaults/rtable.yml +12 -1
  39. data/lib/starter_web/_data/puma/config.rb +3 -0
  40. data/lib/starter_web/_data/resources.yml +4 -2
  41. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  42. data/lib/starter_web/assets/images/banner/1280x600/lunr.jpg +0 -0
  43. data/lib/starter_web/assets/images/{modules/attics/banner/library-1920x800-bw.jpg → banner/1920x800/library.jpg} +0 -0
  44. data/lib/starter_web/assets/images/banner/scalable/readme +0 -0
  45. data/lib/starter_web/assets/images/modules/attics/1920x1280/{ev.jpg → _ev.jpg} +0 -0
  46. data/lib/starter_web/assets/images/modules/attics/1920x1280/_guillaume-bolduc.jpg +0 -0
  47. data/lib/starter_web/assets/images/modules/attics/1920x1280/crawford-jolly.jpg +0 -0
  48. data/lib/starter_web/assets/images/modules/attics/1920x1280/josh-liu.jpg +0 -0
  49. data/lib/starter_web/assets/images/modules/attics/1920x1280/kristopher-roller.jpg +0 -0
  50. data/lib/starter_web/assets/images/modules/attics/1920x1280/moritz-kindler.jpg +0 -0
  51. data/lib/starter_web/assets/images/modules/attics/1920x1280/nasa.jpg +0 -0
  52. data/lib/starter_web/assets/images/modules/attics/{alexander-redl.jpg → _alexander-redl.jpg} +0 -0
  53. data/lib/starter_web/assets/images/modules/attics/{alexander-shatov-1920x1280.jpg → _alexander-shatov-1920x1280.jpg} +0 -0
  54. data/lib/starter_web/assets/images/modules/attics/{annie-spratt-1920x1280.jpg → _annie-spratt-1920x1280.jpg} +0 -0
  55. data/lib/starter_web/assets/images/modules/attics/{antonino-visalli-1920x1280.jpg → _antonino-visalli-1920x1280.jpg} +0 -0
  56. data/lib/starter_web/assets/images/modules/attics/{christa-dodoo-1920x1280.jpg → _christa-dodoo-1920x1280.jpg} +0 -0
  57. data/lib/starter_web/assets/images/modules/attics/{guillaume-bolduc-1920x1280.jpg → _guillaume-bolduc-1920x1280.jpg} +0 -0
  58. data/lib/starter_web/assets/images/modules/attics/{harpal-singh.jpg → _harpal-singh.jpg} +0 -0
  59. data/lib/starter_web/assets/images/modules/attics/{humble-lamb-1920x1280.jpg → _humble-lamb-1920x1280.jpg} +0 -0
  60. data/lib/starter_web/assets/images/modules/attics/{john-schnobrich-2-1920x1280.jpg → _john-schnobrich-2-1920x1280.jpg} +0 -0
  61. data/lib/starter_web/assets/images/modules/attics/{kirklai-1920x1280.jpg → _kirklai-1920x1280.jpg} +0 -0
  62. data/lib/starter_web/assets/images/modules/attics/{romain-vignes-1920x1280.jpg → _romain-vignes-1920x1280.jpg} +0 -0
  63. data/lib/starter_web/assets/images/modules/attics/{runner-1920x1200.jpg → _runner-1920x1200.jpg} +0 -0
  64. data/lib/starter_web/assets/images/modules/attics/{spacex-1920x1280.jpg → _spacex-1920x1280.jpg} +0 -0
  65. data/lib/starter_web/assets/images/modules/attics/_vladislav-klapin-1920x1280.jpg +0 -0
  66. data/lib/starter_web/assets/images/modules/attics/{wrongtog-1920x1280.jpg → _wrongtog-1920x1280.jpg} +0 -0
  67. data/lib/starter_web/assets/images/modules/attics/{building-blocks-1920x1280-bw.jpg → building-blocks-1920x1280.jpg} +0 -0
  68. data/lib/starter_web/assets/images/modules/attics/lunr-1280x800.jpg +0 -0
  69. data/lib/starter_web/assets/images/modules/attics/{shubham-dhage-2-1920x1280.jpg → shubham-dhage-1920x1280.jpg} +0 -0
  70. data/lib/starter_web/assets/images/modules/attics/vladislav-klapin-1920x1280.jpg +0 -0
  71. data/lib/starter_web/collections/posts/public/featured/_posts/2022-02-01-about-j1.adoc +2 -2
  72. data/lib/starter_web/index.html +23 -18
  73. data/lib/starter_web/package.json +5 -4
  74. data/lib/starter_web/pages/public/about/features.adoc +9 -4
  75. data/lib/starter_web/pages/public/about/reporting_issues.adoc +9 -5
  76. data/lib/starter_web/pages/public/about/site.adoc +8 -2
  77. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/000_intro.adoc +5 -3
  78. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +3 -0
  79. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +3 -0
  80. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/attributes.asciidoc +2 -1
  81. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/{100_converter/000_basic_example.asciidoc → 000_examples/basic_example.asciidoc} +1 -0
  82. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/111_about_the_converter.asciidoc +20 -11
  83. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/112_getting_started.asciidoc +76 -24
  84. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/211_language_overview.asciidoc +33 -29
  85. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/212_values.asciidoc +67 -88
  86. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/213_fonts.asciidoc +40 -39
  87. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/images/readme +1 -0
  88. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/tables/math_expressions.asciidoc +19 -0
  89. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/tables/measurement_units.asciidoc +22 -0
  90. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +20 -5
  91. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/100_chapter.asciidoc +5 -325
  92. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/200_chapter.asciidoc +3 -134
  93. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/images/readme +1 -0
  94. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/build_command_options.asciidoc +72 -0
  95. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/files_and_folders.asciidoc +66 -0
  96. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/global_configuration_options.asciidoc +63 -0
  97. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/global_variables.asciidoc +26 -0
  98. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/page_variables.asciidoc +54 -0
  99. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/serve_command_options.asciidoc +45 -0
  100. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/site_variables.asciidoc +59 -0
  101. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +21 -7
  102. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +124 -122
  103. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +3 -3
  104. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +3 -3
  105. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +3 -3
  106. data/lib/starter_web/pages/public/blog/navigator/archive.html +3 -3
  107. data/lib/starter_web/pages/public/blog/navigator/index.html +3 -3
  108. data/lib/starter_web/pages/public/features/general.adoc +4 -4
  109. data/lib/starter_web/pages/public/features/template.adoc +1 -2
  110. data/lib/starter_web/pages/public/learn/quickstart.adoc +2 -2
  111. data/lib/starter_web/pages/public/learn/roundtrip/{400_asciidoc_extensions.adoc → asciidoc_extensions.adoc} +2 -2
  112. data/lib/starter_web/pages/public/learn/roundtrip/{410_bs_modals_extentions.adoc → bs_modals_extentions.adoc} +2 -2
  113. data/lib/starter_web/pages/public/learn/roundtrip/{300_icon_fonts.adoc → icon_fonts.adoc} +1 -2
  114. data/lib/starter_web/pages/public/learn/roundtrip/{100_present_images.adoc → present_images.adoc} +10 -10
  115. data/lib/starter_web/pages/public/learn/roundtrip/{100_present_videos.adoc → present_videos.adoc} +0 -0
  116. data/lib/starter_web/pages/public/learn/roundtrip/{600_quicksearch.adoc → quicksearch.adoc} +6 -7
  117. data/lib/starter_web/pages/public/learn/roundtrip/{420_responsive_tables_extensions.adoc → responsive_tables_extensions.adoc} +86 -73
  118. data/lib/starter_web/pages/public/learn/roundtrip/{500_themes.adoc → themes.adoc} +2 -2
  119. data/lib/starter_web/pages/public/learn/roundtrip/{200_typography.adoc → typography.adoc} +6 -6
  120. data/lib/starter_web/pages/public/learn/where_to_go.adoc +2 -2
  121. data/lib/starter_web/pages/public/legal/de/100_copyright.adoc +3 -2
  122. data/lib/starter_web/pages/public/legal/de/100_impress.adoc +3 -2
  123. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +3 -2
  124. data/lib/starter_web/pages/public/legal/de/400_comment_policy.adoc +3 -2
  125. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +3 -2
  126. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +3 -2
  127. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +3 -2
  128. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +3 -2
  129. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +2 -2
  130. data/lib/starter_web/pages/public/plans/plans.adoc +2 -2
  131. data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +5 -5
  132. data/lib/starter_web/pages/public/se/se-fake.adoc +2 -2
  133. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  134. data/lib/starter_web/utilsrv/package.json +1 -1
  135. metadata +56 -38
  136. data/lib/starter_web/assets/images/modules/attics/1920x1280/ben-kolde.jpg +0 -0
  137. data/lib/starter_web/assets/images/modules/attics/1920x1280/braden-collum.jpg +0 -0
  138. data/lib/starter_web/assets/images/modules/attics/1920x1280/firmbee-com.jpg +0 -0
  139. data/lib/starter_web/assets/images/modules/attics/1920x1280/max-harlynking.jpg +0 -0
  140. data/lib/starter_web/assets/images/modules/attics/banner/admin-dashboard-bootstrap-1280x800-bw.jpg +0 -0
  141. data/lib/starter_web/assets/images/modules/attics/banner/lunr-banner-1280x800.jpg +0 -0
  142. data/lib/starter_web/assets/images/modules/attics/franck-1920x12800.jpg +0 -0
  143. data/lib/starter_web/assets/images/modules/attics/vladislav-klapin-2-1920x1280.jpg +0 -0
@@ -0,0 +1,20 @@
1
+
2
+ ;(function(hasClass) {
3
+
4
+ jQuery.fn.hasClass = function hasClassRegExp( selector ) {
5
+ if ( selector && typeof selector.test === "function" ) {
6
+ for ( var i = 0, l = this.length; i < l; i++ ) {
7
+ var classNames = this[i].className.split( /\s+/ );
8
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
9
+ if (selector.test( classNames[c]) ) {
10
+ return true;
11
+ }
12
+ }
13
+ }
14
+ return false;
15
+ } else {
16
+ return hasClass.call(this, selector);
17
+ }
18
+ }
19
+
20
+ })(jQuery.fn.hasClass);
@@ -0,0 +1,24 @@
1
+ ;(function(removeClass) {
2
+
3
+ jQuery.fn.removeClass = function( value ) {
4
+ if ( value && typeof value.test === "function" ) {
5
+ for ( var i = 0, l = this.length; i < l; i++ ) {
6
+ var elem = this[i];
7
+ if ( elem.nodeType === 1 && elem.className ) {
8
+ var classNames = elem.className.split( /\s+/ );
9
+
10
+ for ( var n = classNames.length; n--; ) {
11
+ if ( value.test(classNames[n]) ) {
12
+ classNames.splice(n, 1);
13
+ }
14
+ }
15
+ elem.className = jQuery.trim( classNames.join(" ") );
16
+ }
17
+ }
18
+ } else {
19
+ removeClass.call(this, value);
20
+ }
21
+ return this;
22
+ }
23
+
24
+ })(jQuery.fn.removeClass);
@@ -16,7 +16,6 @@
16
16
  # See: https://github.com/filamentgroup/tablesaw/blob/master/LICENSE
17
17
  # -----------------------------------------------------------------------------
18
18
  */
19
-
20
19
  (function (root, factory) {
21
20
  if (typeof define === 'function' && define.amd) {
22
21
  define(["jquery"], function (jQuery) {
@@ -56,16 +55,18 @@
56
55
  swipePreviousColumn: "Previous column",
57
56
  swipeNextColumn: "Next column"
58
57
  },
58
+
59
59
  // BS4 Media break points
60
- // -----------------------------------------------------------------------------
61
- breakpoint: {
62
- xl: "1200px",
63
- lg: "992px",
64
- md: "768px",
65
- sm: "576px",
66
- xs: "575px",
67
- default: "992px"
60
+ // -------------------------------------------------------------------------
61
+ bsMediaBreakpoints: {
62
+ xl: "1200",
63
+ lg: "992",
64
+ md: "768",
65
+ sm: "576",
66
+ xs: "575",
67
+ default: "992"
68
68
  },
69
+
69
70
  // cut the mustard
70
71
  mustard:
71
72
  "head" in document && // IE9+, Firefox 4+, Safari 5.1+, Mobile Safari 4.1+, Opera 11.5+, Android 2.3+
@@ -115,15 +116,15 @@
115
116
  });
116
117
 
117
118
  // ---------------------------------------------------------------------------
118
- // enhance ???
119
+ // enhance Tablesaw for control elements (advanced mode)
119
120
  // ---------------------------------------------------------------------------
120
121
  if (Tablesaw.mustard) {
121
122
  $(document.documentElement).addClass("tablesaw-enhanced");
122
123
  }
123
124
 
124
- // -------------------------------------------------------------------------
125
+ // ---------------------------------------------------------------------------
125
126
  // plugin
126
- // -------------------------------------------------------------------------
127
+ // ---------------------------------------------------------------------------
127
128
  (function() {
128
129
  var pluginName = "tablesaw";
129
130
  var classes = {
@@ -153,16 +154,17 @@
153
154
  this.$table = $(element);
154
155
 
155
156
  // only one <thead> and <tfoot> are allowed, per the specification
157
+ //
156
158
  this.$thead = this.$table
157
159
  .children()
158
160
  .filter("thead")
159
161
  .eq(0);
160
162
 
161
163
  // multiple <tbody> are allowed, per the specification
164
+ //
162
165
  this.$tbody = this.$table.children().filter("tbody");
163
166
 
164
167
  this.mode = this.$table.attr("data-tablesaw-mode") || defaultMode;
165
-
166
168
  this.$toolbar = null;
167
169
 
168
170
  this.attributes = {
@@ -558,6 +560,7 @@
558
560
  }, 300); // must be greater than the resize timeout below
559
561
  });
560
562
 
563
+ //jadams: show|hide colgroup settings
561
564
  var resizeTimeout;
562
565
  $(window).on("resize", function() {
563
566
  var winWidth;
@@ -568,13 +571,14 @@
568
571
  if ($(curTable).hasClass('rtable')) {
569
572
  winWidth = $(window).width();
570
573
  // set show/hide all table/colgroup elements
571
- //
572
- if ($(window).width() < Tablesaw.options.breakpoint) {
574
+ if ($(window).width() < Tablesaw.bsMediaBreakpoints[Tablesaw.options.breakpoint]) {
573
575
  log_text = '\n' + 'hide colgroups: ' + curTable.attr('id')
576
+ // hide colgroups if table is collapsed
574
577
  curTable.find('colgroup').hide();
575
578
  logger.debug(log_text);
576
579
  } else {
577
580
  log_text = '\n' + 'show colgroup: ' + curTable.attr('id')
581
+ // show colgroups if table is expanded
578
582
  curTable.find('colgroup').show();
579
583
  logger.debug(log_text);
580
584
  }
@@ -585,12 +589,13 @@
585
589
  window.clearTimeout(resizeTimeout);
586
590
  resizeTimeout = window.setTimeout(function() {
587
591
  $doc.trigger(events.resize);
588
- }, 150); // must be less than the scrolling timeout above.
592
+ }, 150); // must be less than the scrolling timeout above
589
593
  }
590
594
 
591
595
  });
592
596
 
593
597
  Tablesaw.Table = Table;
598
+
594
599
  })();
595
600
 
596
601
  (function() {
@@ -721,6 +726,7 @@
721
726
 
722
727
  Tablesaw.Stack = Stack;
723
728
  })();
729
+
724
730
  return Tablesaw;
725
731
 
726
732
  }));
@@ -16,4 +16,4 @@
16
16
  # See: https://github.com/filamentgroup/tablesaw/blob/master/LICENSE
17
17
  # -----------------------------------------------------------------------------
18
18
  */
19
- !function(e,a){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e.Tablesaw=a(t,e)}):"object"==typeof exports?"document"in e?module.exports=a(require("jquery"),e):module.exports=a(require("jquery")(e),e):e.Tablesaw=a(jQuery,e)}("undefined"!=typeof window?window:this,function(h,c){"use strict";var u=c.document,a=/complete|loaded/.test(u.readyState);u.addEventListener("DOMContentLoaded",function(){a=!0});var p={i18n:{modeStack:"Stack",modeSwipe:"Swipe",modeToggle:"Toggle",modeSwitchColumnsAbbreviated:"Cols",modeSwitchColumns:"Columns",columnToggleButton:"Columns",columnToggleError:"No eligible columns.",sort:"Sort",swipePreviousColumn:"Previous column",swipeNextColumn:"Next column"},breakpoint:{xl:"1200px",lg:"992px",md:"768px",sm:"576px",xs:"575px",default:"992px"},mustard:"head"in u&&(!c.blackberry||c.WebKitPoint)&&!c.operamini,$:h,_init:function(t,e){p.$(t||u).trigger("enhance.tablesaw"),p.options=e},init:function(t,e){(a=a||/complete|loaded/.test(u.readyState))?p._init(t,e):"addEventListener"in u&&u.addEventListener("DOMContentLoaded",function(){p._init(t,e)})}};return h(u).on("enhance.tablesaw",function(){"undefined"!=typeof TablesawConfig&&TablesawConfig.i18n&&(p.i18n=h.extend(p.i18n,TablesawConfig.i18n||{})),p.i18n.modes=[p.i18n.modeStack,p.i18n.modeSwipe,p.i18n.modeToggle]}),p.mustard&&h(u.documentElement).addClass("tablesaw-enhanced"),function(){var e="tablesaw",a="tablesaw-bar",n={create:"tablesawcreate",destroy:"tablesawdestroy",refresh:"tablesawrefresh",resize:"tablesawresize"},i={},r=log4javascript.getLogger("j1.rtable");function t(t){if(!t)throw new Error("Tablesaw requires an element.");this.table=t,this.$table=h(t),this.$thead=this.$table.children().filter("thead").eq(0),this.$tbody=this.$table.children().filter("tbody"),this.mode=this.$table.attr("data-tablesaw-mode")||"stack",this.$toolbar=null,this.attributes={subrow:"data-tablesaw-subrow",ignorerow:"data-tablesaw-ignorerow"},this.init()}p.events=n,t.prototype.init=function(){if(!this.$thead.length)throw new Error("tablesaw: a <thead> is required, but none was found.");if(!this.$thead.find("th").length)throw new Error("tablesaw: no header cells found. Are you using <th> inside of <thead>?");this.$table.attr("id")||this.$table.attr("id",e+"-"+Math.round(1e4*Math.random())),this.createToolbar(),this._initCells(),this.$table.data(e,this),this.$table.trigger(n.create,[this])},t.prototype.getConfig=function(t){t=h.extend(i,t||{});return h.extend(t,"undefined"!=typeof TablesawConfig?TablesawConfig:{})},t.prototype._getPrimaryHeaderRow=function(){return this._getHeaderRows().eq(0)},t.prototype._getHeaderRows=function(){return this.$thead.children().filter("tr").filter(function(){return!h(this).is("[data-tablesaw-ignorerow]")})},t.prototype._getRowIndex=function(t){return t.prevAll().length},t.prototype._getHeaderRowIndeces=function(){var t=this,e=[];return this._getHeaderRows().each(function(){e.push(t._getRowIndex(h(this)))}),e},t.prototype._getPrimaryHeaderCells=function(t){return(t||this._getPrimaryHeaderRow()).find("th")},t.prototype._$getCells=function(t){var a=this;return h(t).add(t.cells).filter(function(){var t=h(this),e=t.parent(),t=t.is("[colspan]");return!(e.is("["+a.attributes.subrow+"]")||e.is("["+a.attributes.ignorerow+"]")&&t)})},t.prototype._getVisibleColspan=function(){var e=0;return this._getPrimaryHeaderCells().each(function(){var t=h(this);"none"!==t.css("display")&&(e+=parseInt(t.attr("colspan"),10)||1)}),e},t.prototype.getColspanForCell=function(t){var e=this._getVisibleColspan(),a=0;return t.closest("tr").data("tablesaw-rowspanned")&&a++,t.siblings().each(function(){var t=h(this),e=parseInt(t.attr("colspan"),10)||1;"none"!==t.css("display")&&(a+=e)}),e-a},t.prototype.isCellInColumn=function(t,e){return h(t).add(t.cells).filter(function(){return this===e}).length},t.prototype.updateColspanCells=function(n,i,r){var o=this,t=o._getPrimaryHeaderRow();this.$table.find("[rowspan][data-tablesaw-priority]").each(function(){var t,e=h(this);"persist"===e.attr("data-tablesaw-priority")&&(t=e.closest("tr"),1<(e=parseInt(e.attr("rowspan"),10))&&((t=t.next()).data("tablesaw-rowspanned",!0),e--))}),this.$table.find("[colspan],[data-tablesaw-maxcolspan]").filter(function(){return h(this).closest("tr")[0]!==t[0]}).each(function(){var t,e,a=h(this);void 0!==r&&!o.isCellInColumn(i,this)||(t=o.getColspanForCell(a),n&&void 0!==r&&a[0===t?"addClass":"removeClass"](n),(e=parseInt(a.attr("data-tablesaw-maxcolspan"),10))?e<t&&(t=e):a.attr("data-tablesaw-maxcolspan",a.attr("colspan")),a.attr("colspan",t))})},t.prototype._findPrimaryHeadersForCell=function(t){for(var e=this._getPrimaryHeaderRow(),a=this._getRowIndex(e),n=[],i=0;i<this.headerMapping.length;i++)if(i!==a)for(var r=0;r<this.headerMapping[i].length;r++)this.headerMapping[i][r]===t&&n.push(this.headerMapping[a][r]);return n},t.prototype.getRows=function(){var t=this;return this.$table.find("tr").filter(function(){return h(this).closest("table").is(t.$table)})},t.prototype.getBodyRows=function(t){return(t?h(t):this.$tbody).children().filter("tr")},t.prototype.getHeaderCellIndex=function(t){for(var e=this.headerMapping[0],a=0;a<e.length;a++)if(e[a]===t)return a;return-1},t.prototype._initCells=function(){this.$table.find("[data-tablesaw-maxcolspan]").each(function(){var t=h(this);t.attr("colspan",t.attr("data-tablesaw-maxcolspan"))});var t=this.getRows(),o=[];t.each(function(t){o[t]=[]}),t.each(function(i){var r=0;h(this).children().each(function(){for(var t=parseInt(this.getAttribute("data-tablesaw-maxcolspan")||this.getAttribute("colspan"),10),e=parseInt(this.getAttribute("rowspan"),10);o[i][r];)r++;if(o[i][r]=this,t)for(var a=0;a<t-1;a++)r++,o[i][r]=this;if(e)for(var n=1;n<e;n++)o[i+n][r]=this;r++})});for(var e=this._getHeaderRowIndeces(),a=0;a<o[0].length;a++)for(var n=0,i=e.length;n<i;n++){var r,s=o[e[n]][a],l=e[n];for(s.cells||(s.cells=[]);l<o.length;)s!==(r=o[l][a])&&s.cells.push(r),l++}this.headerMapping=o},t.prototype.refresh=function(){this._initCells(),this.$table.trigger(n.refresh,[this])},t.prototype._getToolbarAnchor=function(){var t=this.$table.parent();return t.is(".tablesaw-overflow")?t:this.$table},t.prototype._getToolbar=function(t){return(t=t||this._getToolbarAnchor()).prev().filter("."+a)},t.prototype.createToolbar=function(){var t=this._getToolbarAnchor(),e=this._getToolbar(t);e.length||(e=h("<div>").addClass(a).insertBefore(t)),this.$toolbar=e,this.mode&&this.$toolbar.addClass("tablesaw-mode-"+this.mode)},t.prototype.destroy=function(){this._getToolbar().each(function(){this.className=this.className.replace(/\btablesaw-mode\-\w*\b/gi,"")});var t=this.$table.attr("id");h(u).off("."+t),h(c).off("."+t),this.$table.trigger(n.destroy,[this]),this.$table.removeData(e)},h.fn[e]=function(){return this.each(function(){h(this).data(e)||new t(this)})};var o=h(u);o.on("enhance.tablesaw",function(t){p.mustard&&((t=h(t.target)).parent().length&&(t=t.parent()),t.find("table").filter("[data-tablesaw],[data-tablesaw-mode],[data-tablesaw-sortable]")[e]())});var s,l,d=!1;o.on("scroll.tablesaw",function(){d=!0,c.clearTimeout(s),s=c.setTimeout(function(){d=!1},300)}),h(c).on("resize",function(){h("table").each(function(){var t,e=h(this);h(e).hasClass("rtable")&&(h(c).width(),h(c).width()<p.options.breakpoint?(t="\nhide colgroups: "+e.attr("id"),e.find("colgroup").hide()):(t="\nshow colgroup: "+e.attr("id"),e.find("colgroup").show()),r.debug(t))}),d||(c.clearTimeout(l),l=c.setTimeout(function(){o.trigger(n.resize)},150))}),p.Table=t}(),function(){function a(t,e){this.tablesaw=e,this.$table=h(t),this.labelless=this.$table.is("["+o+"]"),this.hideempty=this.$table.is("["+s+"]"),this.$table.data(r,this)}var t="tablesaw-stack",n="tablesaw-cell-label",i="tablesaw-cell-content",r="tablesaw-stack",o="data-tablesaw-no-labels",s="data-tablesaw-hide-empty";a.prototype.init=function(){var a;this.$table.addClass(t),this.labelless||(a=this).$table.find("th, td").filter(function(){return!h(this).closest("thead").length}).filter(function(){return!(h(this).is("["+o+"]")||h(this).closest("tr").is("["+o+"]")||a.hideempty&&!h(this).html())}).each(function(){var o=h(u.createElement("b")).addClass(n),t=h(this);h(a.tablesaw._findPrimaryHeadersForCell(this)).each(function(t){var e=h(this.cloneNode(!0)),a=e.find(".tablesaw-sortable-btn");e.find(".tablesaw-sortable-arrow").remove();var n=e.find("[data-tablesaw-checkall]");if(n.closest("label").remove(),n.length)o=h([]);else{0<t&&o.append(u.createTextNode(", "));for(var i,r=(a.length?a:e)[0];i=r.firstChild;)o[0].appendChild(i)}}),o.length&&!t.find("."+i).length&&t.wrapInner("<span class='"+i+"'></span>");var e=t.find("."+n);e.length?e.replaceWith(o):(t.prepend(u.createTextNode(" ")),t.prepend(o))})},a.prototype.destroy=function(){this.$table.removeClass(t),this.$table.find("."+n).remove(),this.$table.find("."+i).each(function(){h(this).replaceWith(h(this.childNodes))})},h(u).on(p.events.create,function(t,e){"stack"===e.mode&&new a(e.table,e).init()}).on(p.events.refresh,function(t,e){"stack"===e.mode&&h(e.table).data(r).init()}).on(p.events.destroy,function(t,e){"stack"===e.mode&&h(e.table).data(r).destroy()}),p.Stack=a}(),p});
19
+ !function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(a){return t.Tablesaw=e(a,t)}):"object"==typeof exports?module.exports=e("document"in t?require("jquery"):require("jquery")(t),t):t.Tablesaw=e(jQuery,t)}("undefined"!=typeof window?window:this,function(t,e){"use strict";var a=e.document,i=/complete|loaded/.test(a.readyState);a.addEventListener("DOMContentLoaded",function(){i=!0});var n,r,s,o,l,d,h,c={i18n:{modeStack:"Stack",modeSwipe:"Swipe",modeToggle:"Toggle",modeSwitchColumnsAbbreviated:"Cols",modeSwitchColumns:"Columns",columnToggleButton:"Columns",columnToggleError:"No eligible columns.",sort:"Sort",swipePreviousColumn:"Previous column",swipeNextColumn:"Next column"},bsMediaBreakpoints:{xl:"1200",lg:"992",md:"768",sm:"576",xs:"575",default:"992"},mustard:"head"in a&&(!e.blackberry||e.WebKitPoint)&&!e.operamini,$:t,_init:function(t,e){c.$(t||a).trigger("enhance.tablesaw"),c.options=e},init:function(t,e){(i=i||/complete|loaded/.test(a.readyState))?c._init(t,e):"addEventListener"in a&&a.addEventListener("DOMContentLoaded",function(){c._init(t,e)})}};return t(a).on("enhance.tablesaw",function(){"undefined"!=typeof TablesawConfig&&TablesawConfig.i18n&&(c.i18n=t.extend(c.i18n,TablesawConfig.i18n||{})),c.i18n.modes=[c.i18n.modeStack,c.i18n.modeSwipe,c.i18n.modeToggle]}),c.mustard&&t(a.documentElement).addClass("tablesaw-enhanced"),function(){var i="tablesaw-bar",n={create:"tablesawcreate",destroy:"tablesawdestroy",refresh:"tablesawrefresh",resize:"tablesawresize"},r={},s=log4javascript.getLogger("j1.rtable");c.events=n;var o=function(e){if(!e)throw new Error("Tablesaw requires an element.");this.table=e,this.$table=t(e),this.$thead=this.$table.children().filter("thead").eq(0),this.$tbody=this.$table.children().filter("tbody"),this.mode=this.$table.attr("data-tablesaw-mode")||"stack",this.$toolbar=null,this.attributes={subrow:"data-tablesaw-subrow",ignorerow:"data-tablesaw-ignorerow"},this.init()};o.prototype.init=function(){if(!this.$thead.length)throw new Error("tablesaw: a <thead> is required, but none was found.");if(!this.$thead.find("th").length)throw new Error("tablesaw: no header cells found. Are you using <th> inside of <thead>?");this.$table.attr("id")||this.$table.attr("id","tablesaw-"+Math.round(1e4*Math.random())),this.createToolbar(),this._initCells(),this.$table.data("tablesaw",this),this.$table.trigger(n.create,[this])},o.prototype.getConfig=function(e){var a=t.extend(r,e||{});return t.extend(a,"undefined"!=typeof TablesawConfig?TablesawConfig:{})},o.prototype._getPrimaryHeaderRow=function(){return this._getHeaderRows().eq(0)},o.prototype._getHeaderRows=function(){return this.$thead.children().filter("tr").filter(function(){return!t(this).is("[data-tablesaw-ignorerow]")})},o.prototype._getRowIndex=function(t){return t.prevAll().length},o.prototype._getHeaderRowIndeces=function(){var e=this,a=[];return this._getHeaderRows().each(function(){a.push(e._getRowIndex(t(this)))}),a},o.prototype._getPrimaryHeaderCells=function(t){return(t||this._getPrimaryHeaderRow()).find("th")},o.prototype._$getCells=function(e){var a=this;return t(e).add(e.cells).filter(function(){var e=t(this),i=e.parent(),n=e.is("[colspan]");return!(i.is("["+a.attributes.subrow+"]")||i.is("["+a.attributes.ignorerow+"]")&&n)})},o.prototype._getVisibleColspan=function(){var e=0;return this._getPrimaryHeaderCells().each(function(){var a=t(this);"none"!==a.css("display")&&(e+=parseInt(a.attr("colspan"),10)||1)}),e},o.prototype.getColspanForCell=function(e){var a=this._getVisibleColspan(),i=0;return e.closest("tr").data("tablesaw-rowspanned")&&i++,e.siblings().each(function(){var e=t(this),a=parseInt(e.attr("colspan"),10)||1;"none"!==e.css("display")&&(i+=a)}),a-i},o.prototype.isCellInColumn=function(e,a){return t(e).add(e.cells).filter(function(){return this===a}).length},o.prototype.updateColspanCells=function(e,a,i){var n=this,r=n._getPrimaryHeaderRow();this.$table.find("[rowspan][data-tablesaw-priority]").each(function(){var e=t(this);if("persist"===e.attr("data-tablesaw-priority")){var a=e.closest("tr"),i=parseInt(e.attr("rowspan"),10);i>1&&((a=a.next()).data("tablesaw-rowspanned",!0),i--)}}),this.$table.find("[colspan],[data-tablesaw-maxcolspan]").filter(function(){return t(this).closest("tr")[0]!==r[0]}).each(function(){var r=t(this);if(void 0===i||n.isCellInColumn(a,this)){var s=n.getColspanForCell(r);e&&void 0!==i&&r[0===s?"addClass":"removeClass"](e);var o=parseInt(r.attr("data-tablesaw-maxcolspan"),10);o?s>o&&(s=o):r.attr("data-tablesaw-maxcolspan",r.attr("colspan")),r.attr("colspan",s)}})},o.prototype._findPrimaryHeadersForCell=function(t){for(var e=this._getPrimaryHeaderRow(),a=this._getRowIndex(e),i=[],n=0;n<this.headerMapping.length;n++)if(n!==a)for(var r=0;r<this.headerMapping[n].length;r++)this.headerMapping[n][r]===t&&i.push(this.headerMapping[a][r]);return i},o.prototype.getRows=function(){var e=this;return this.$table.find("tr").filter(function(){return t(this).closest("table").is(e.$table)})},o.prototype.getBodyRows=function(e){return(e?t(e):this.$tbody).children().filter("tr")},o.prototype.getHeaderCellIndex=function(t){for(var e=this.headerMapping[0],a=0;a<e.length;a++)if(e[a]===t)return a;return-1},o.prototype._initCells=function(){this.$table.find("[data-tablesaw-maxcolspan]").each(function(){var e=t(this);e.attr("colspan",e.attr("data-tablesaw-maxcolspan"))});var e=this.getRows(),a=[];e.each(function(t){a[t]=[]}),e.each(function(e){var i=0;t(this).children().each(function(){for(var t=parseInt(this.getAttribute("data-tablesaw-maxcolspan")||this.getAttribute("colspan"),10),n=parseInt(this.getAttribute("rowspan"),10);a[e][i];)i++;if(a[e][i]=this,t)for(var r=0;r<t-1;r++)i++,a[e][i]=this;if(n)for(var s=1;s<n;s++)a[e+s][i]=this;i++})});for(var i=this._getHeaderRowIndeces(),n=0;n<a[0].length;n++)for(var r=0,s=i.length;r<s;r++){var o,l=a[i[r]][n],d=i[r];for(l.cells||(l.cells=[]);d<a.length;)l!==(o=a[d][n])&&l.cells.push(o),d++}this.headerMapping=a},o.prototype.refresh=function(){this._initCells(),this.$table.trigger(n.refresh,[this])},o.prototype._getToolbarAnchor=function(){var t=this.$table.parent();return t.is(".tablesaw-overflow")?t:this.$table},o.prototype._getToolbar=function(t){return t||(t=this._getToolbarAnchor()),t.prev().filter("."+i)},o.prototype.createToolbar=function(){var e=this._getToolbarAnchor(),a=this._getToolbar(e);a.length||(a=t("<div>").addClass(i).insertBefore(e)),this.$toolbar=a,this.mode&&this.$toolbar.addClass("tablesaw-mode-"+this.mode)},o.prototype.destroy=function(){this._getToolbar().each(function(){this.className=this.className.replace(/\btablesaw-mode\-\w*\b/gi,"")});var i=this.$table.attr("id");t(a).off("."+i),t(e).off("."+i),this.$table.trigger(n.destroy,[this]),this.$table.removeData("tablesaw")},t.fn.tablesaw=function(){return this.each(function(){t(this).data("tablesaw")||new o(this)})};var l=t(a);l.on("enhance.tablesaw",function(e){if(c.mustard){var a=t(e.target);a.parent().length&&(a=a.parent()),a.find("table").filter("[data-tablesaw],[data-tablesaw-mode],[data-tablesaw-sortable]").tablesaw()}});var d,h,u=!1;l.on("scroll.tablesaw",function(){u=!0,e.clearTimeout(d),d=e.setTimeout(function(){u=!1},300)}),t(e).on("resize",function(){t("table").each(function(){var a,i=t(this);t(i).hasClass("rtable")&&(t(e).width(),t(e).width()<c.bsMediaBreakpoints[c.options.breakpoint]?(a="\nhide colgroups: "+i.attr("id"),i.find("colgroup").hide(),s.debug(a)):(a="\nshow colgroup: "+i.attr("id"),i.find("colgroup").show(),s.debug(a)))}),u||(e.clearTimeout(h),h=e.setTimeout(function(){l.trigger(n.resize)},150))}),c.Table=o}(),n="tablesaw-stack",r="tablesaw-cell-label",s="tablesaw-cell-content",o="tablesaw-stack",l="data-tablesaw-no-labels",d="data-tablesaw-hide-empty",(h=function(e,a){this.tablesaw=a,this.$table=t(e),this.labelless=this.$table.is("["+l+"]"),this.hideempty=this.$table.is("["+d+"]"),this.$table.data(o,this)}).prototype.init=function(){if(this.$table.addClass(n),!this.labelless){var e=this;this.$table.find("th, td").filter(function(){return!t(this).closest("thead").length}).filter(function(){return!(t(this).is("["+l+"]")||t(this).closest("tr").is("["+l+"]")||e.hideempty&&!t(this).html())}).each(function(){var i=t(a.createElement("b")).addClass(r),n=t(this);t(e.tablesaw._findPrimaryHeadersForCell(this)).each(function(e){var n=t(this.cloneNode(!0)),r=n.find(".tablesaw-sortable-btn");n.find(".tablesaw-sortable-arrow").remove();var s=n.find("[data-tablesaw-checkall]");if(s.closest("label").remove(),s.length)i=t([]);else{e>0&&i.append(a.createTextNode(", "));for(var o,l=r.length?r[0]:n[0];o=l.firstChild;)i[0].appendChild(o)}}),i.length&&!n.find("."+s).length&&n.wrapInner("<span class='"+s+"'></span>");var o=n.find("."+r);o.length?o.replaceWith(i):(n.prepend(a.createTextNode(" ")),n.prepend(i))})}},h.prototype.destroy=function(){this.$table.removeClass(n),this.$table.find("."+r).remove(),this.$table.find("."+s).each(function(){t(this).replaceWith(t(this.childNodes))})},t(a).on(c.events.create,function(t,e){"stack"===e.mode&&new h(e.table,e).init()}).on(c.events.refresh,function(e,a){"stack"===a.mode&&t(a.table).data(o).init()}).on(c.events.destroy,function(e,a){"stack"===a.mode&&t(a.table).data(o).destroy()}),c.Stack=h,c});
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 Joseph Guadagno
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.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Joseph Guadagno
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.
@@ -1,166 +1,166 @@
1
- # bootstrapThemeSwitcher
2
-
3
- jQuery plugin for dynamically loading Twitter Bootstrap themes from Bootswatch. This plugin allows for the automatic populating of `UL` and `SELECT` elements with the names of themes available, can switch a theme, save the selected theme to a cookie and load the selected theme from a cookie.
4
-
5
- ## Support
6
-
7
- * Bugs and Feature requests
8
-
9
- **Bugs** and **Feature requests** can be reported using the [issues tracker](https://github.com/jguadagno/bootstrapThemeSwitcher/issues).
10
- Please read the [issue guidelines](https://github.com/jguadagno/bootstrapThemeSwitcher/blob/master/CONTRIBUTING.md) before posting.
11
-
12
- ## Features
13
-
14
- **Dynamically Load Theme Name**
15
- The plugin will pull in a list of the latest themes from [Bootswatch](http://www.bootswatch.com). This will populate a `select` or `ul` element with a list of themes to choose.
16
- **Switch the Bootstrap Theme**
17
- The dynamically loaded themes will automatically switch the theme when chosen.
18
- **Saves theme to a cookie**
19
- Takes the selected theme information and saves it to a cookie to reload later
20
- **Loads a theme from a cookie**
21
- Loads a previous saved theme from a cookie
22
-
23
- ## Requirements
24
-
25
- ### Mandatory requirements
26
-
27
- * [jQuery](http://jquery.com/) v1.11+
28
- * [jQuery Cookie plugin](https://github.com/carhartl/jquery-cookie)
29
-
30
- ## License
31
-
32
- Released under the [MIT license](http://www.opensource.org/licenses/MIT).
33
-
34
- ## Usage
35
-
36
- ### Clear
37
-
38
- ```javascript
39
- $(selector).bootstrapThemeSelector('clear');
40
- ```
41
-
42
- Empties/removes the loaded `ul` or `select` element theme names
43
-
44
- ### Destroy
45
-
46
- ```javascript
47
- $(selector).bootstrapThemeSelector('destroy');
48
- ```
49
-
50
- Removes any reference to the bootstrapThemeSelector, empties the loaded control and removes the events.
51
-
52
-
53
- ### LoadThemeFromCookies
54
-
55
- ```javascript
56
- $(selector).bootstrapThemeSelector('loadThemeFromCookies');
57
- ```
58
-
59
- Checks for the presence of the theme cookie and loads that theme. `options` can be passed in to change the default cookies, path, etc.
60
-
61
- ### switchTheme
62
-
63
- ```javascript
64
- $(selector).bootstrapThemeSelector('switchTheme', themeName, cssFile);
65
- ```
66
-
67
- Loads a theme with the given `cssFile`. If the cssFile is `undefined`, the default bootstrap theme will be loaded from a CDN. You can use this option to load your own custom theme.
68
-
69
- ### Update
70
-
71
- ```javascript
72
- $(selector).bootstrapThemeSelector('update');
73
- ```
74
-
75
- Refreshs the theme list for the provided `selector`
76
-
77
- ## Examples
78
-
79
- Setup an `UL` or `SELECT` with the id of `#ThemeSelect` with a list of themes
80
- ``` javascript
81
- // Setup the theme selectors
82
- $('#ThemeSelect').bootstrapThemeSwitcher();
83
- ```
84
-
85
- Change the theme
86
- ``` javascript
87
- // Change the theme
88
- $().bootstrapThemeSwitcher('switchTheme', 'default', '//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css');
89
- ```
90
-
91
- Load the previously saved theme from the site cookie
92
- ``` javascript
93
- // Load the previously selected theme from the cookies
94
- $().bootstrapThemeSwitcher('loadThemeFromCookie');
95
- ```
96
- ## Plugin Options
97
-
98
- Bootstrap Theme Switcher can be set globally by setting the `$.bootstrapThemeSwitcher.defaults` object or individually for each call to `$.bootstrapThemeSwitcher()` by
99
- passing a plain object to the options arguement. Per-call options over the default options.
100
-
101
- ### cssThemeLink
102
-
103
- cssThemeLink: 'bootstrapTheme'
104
-
105
- The ID used for the bootstrap theme css file
106
-
107
- ### saveToCookie
108
-
109
- saveToCookie: true
110
-
111
- If true, a cookie will be saved with the currently selected theme
112
-
113
- ### cookieThemeName
114
-
115
- bootstrapTheme.name
116
-
117
- The name of the cookie to be used to store the theme name
118
-
119
- ### cookieThemeCss
120
-
121
- cookieThemeCss: 'bootstrapTheme.css'
122
-
123
- The name of the cookie to be used to store the css file used for the theme
124
-
125
- ### cookieExpiration
126
-
127
- expires: 7
128
-
129
- The number of days the cookies should expire
130
-
131
- ### cookiePath
132
-
133
- cookiePath: '/'
134
-
135
- The path the cookie should be stored
136
-
137
- ### defaultCssFile
138
-
139
- defaultCssFile: '//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'
140
-
141
- The default css file the plugin should use if it can not load the themes from Bootswatch
142
-
143
- ### bootswatchApiUrl
144
-
145
- bootswatchApiUrl: 'http://api.bootswatch.com'
146
-
147
- The url for the bootswatch api
148
-
149
- ### bootswatchApiVersion
150
-
151
- bootswatchApiVersion: '3'
152
-
153
- The version of the bootswatch api to use.
154
-
155
- ### localFeed
156
-
157
- localFeed: ''
158
-
159
- The path to a JSON file that contains the themes you want to use. If this parameter is used, the control will be loaded
160
- the themes from here and not go to the bootswatchApiUrl. A sample of the json file can be found at [themes.json](https://github.com/jguadagno/bootstrapThemeSwitcher/blob/master/Examples/themes.json)
161
-
162
- ### excludeBootswatch
163
-
164
- excludeBootswatch: ''
165
-
166
- Comma seperated list of BootSwatch names (e.g. Slate,Yeti) that should be excluded from the rendered &lt;ul&gt; or &lt;select&gt;
1
+ # bootstrapThemeSwitcher
2
+
3
+ jQuery plugin for dynamically loading Twitter Bootstrap themes from Bootswatch. This plugin allows for the automatic populating of `UL` and `SELECT` elements with the names of themes available, can switch a theme, save the selected theme to a cookie and load the selected theme from a cookie.
4
+
5
+ ## Support
6
+
7
+ * Bugs and Feature requests
8
+
9
+ **Bugs** and **Feature requests** can be reported using the [issues tracker](https://github.com/jguadagno/bootstrapThemeSwitcher/issues).
10
+ Please read the [issue guidelines](https://github.com/jguadagno/bootstrapThemeSwitcher/blob/master/CONTRIBUTING.md) before posting.
11
+
12
+ ## Features
13
+
14
+ **Dynamically Load Theme Name**
15
+ The plugin will pull in a list of the latest themes from [Bootswatch](http://www.bootswatch.com). This will populate a `select` or `ul` element with a list of themes to choose.
16
+ **Switch the Bootstrap Theme**
17
+ The dynamically loaded themes will automatically switch the theme when chosen.
18
+ **Saves theme to a cookie**
19
+ Takes the selected theme information and saves it to a cookie to reload later
20
+ **Loads a theme from a cookie**
21
+ Loads a previous saved theme from a cookie
22
+
23
+ ## Requirements
24
+
25
+ ### Mandatory requirements
26
+
27
+ * [jQuery](http://jquery.com/) v1.11+
28
+ * [jQuery Cookie plugin](https://github.com/carhartl/jquery-cookie)
29
+
30
+ ## License
31
+
32
+ Released under the [MIT license](http://www.opensource.org/licenses/MIT).
33
+
34
+ ## Usage
35
+
36
+ ### Clear
37
+
38
+ ```javascript
39
+ $(selector).bootstrapThemeSelector('clear');
40
+ ```
41
+
42
+ Empties/removes the loaded `ul` or `select` element theme names
43
+
44
+ ### Destroy
45
+
46
+ ```javascript
47
+ $(selector).bootstrapThemeSelector('destroy');
48
+ ```
49
+
50
+ Removes any reference to the bootstrapThemeSelector, empties the loaded control and removes the events.
51
+
52
+
53
+ ### LoadThemeFromCookies
54
+
55
+ ```javascript
56
+ $(selector).bootstrapThemeSelector('loadThemeFromCookies');
57
+ ```
58
+
59
+ Checks for the presence of the theme cookie and loads that theme. `options` can be passed in to change the default cookies, path, etc.
60
+
61
+ ### switchTheme
62
+
63
+ ```javascript
64
+ $(selector).bootstrapThemeSelector('switchTheme', themeName, cssFile);
65
+ ```
66
+
67
+ Loads a theme with the given `cssFile`. If the cssFile is `undefined`, the default bootstrap theme will be loaded from a CDN. You can use this option to load your own custom theme.
68
+
69
+ ### Update
70
+
71
+ ```javascript
72
+ $(selector).bootstrapThemeSelector('update');
73
+ ```
74
+
75
+ Refreshs the theme list for the provided `selector`
76
+
77
+ ## Examples
78
+
79
+ Setup an `UL` or `SELECT` with the id of `#ThemeSelect` with a list of themes
80
+ ``` javascript
81
+ // Setup the theme selectors
82
+ $('#ThemeSelect').bootstrapThemeSwitcher();
83
+ ```
84
+
85
+ Change the theme
86
+ ``` javascript
87
+ // Change the theme
88
+ $().bootstrapThemeSwitcher('switchTheme', 'default', '//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css');
89
+ ```
90
+
91
+ Load the previously saved theme from the site cookie
92
+ ``` javascript
93
+ // Load the previously selected theme from the cookies
94
+ $().bootstrapThemeSwitcher('loadThemeFromCookie');
95
+ ```
96
+ ## Plugin Options
97
+
98
+ Bootstrap Theme Switcher can be set globally by setting the `$.bootstrapThemeSwitcher.defaults` object or individually for each call to `$.bootstrapThemeSwitcher()` by
99
+ passing a plain object to the options arguement. Per-call options over the default options.
100
+
101
+ ### cssThemeLink
102
+
103
+ cssThemeLink: 'bootstrapTheme'
104
+
105
+ The ID used for the bootstrap theme css file
106
+
107
+ ### saveToCookie
108
+
109
+ saveToCookie: true
110
+
111
+ If true, a cookie will be saved with the currently selected theme
112
+
113
+ ### cookieThemeName
114
+
115
+ bootstrapTheme.name
116
+
117
+ The name of the cookie to be used to store the theme name
118
+
119
+ ### cookieThemeCss
120
+
121
+ cookieThemeCss: 'bootstrapTheme.css'
122
+
123
+ The name of the cookie to be used to store the css file used for the theme
124
+
125
+ ### cookieExpiration
126
+
127
+ expires: 7
128
+
129
+ The number of days the cookies should expire
130
+
131
+ ### cookiePath
132
+
133
+ cookiePath: '/'
134
+
135
+ The path the cookie should be stored
136
+
137
+ ### defaultCssFile
138
+
139
+ defaultCssFile: '//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'
140
+
141
+ The default css file the plugin should use if it can not load the themes from Bootswatch
142
+
143
+ ### bootswatchApiUrl
144
+
145
+ bootswatchApiUrl: 'http://api.bootswatch.com'
146
+
147
+ The url for the bootswatch api
148
+
149
+ ### bootswatchApiVersion
150
+
151
+ bootswatchApiVersion: '3'
152
+
153
+ The version of the bootswatch api to use.
154
+
155
+ ### localFeed
156
+
157
+ localFeed: ''
158
+
159
+ The path to a JSON file that contains the themes you want to use. If this parameter is used, the control will be loaded
160
+ the themes from here and not go to the bootswatchApiUrl. A sample of the json file can be found at [themes.json](https://github.com/jguadagno/bootstrapThemeSwitcher/blob/master/Examples/themes.json)
161
+
162
+ ### excludeBootswatch
163
+
164
+ excludeBootswatch: ''
165
+
166
+ Comma seperated list of BootSwatch names (e.g. Slate,Yeti) that should be excluded from the rendered &lt;ul&gt; or &lt;select&gt;
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module J1
4
+ module Commands
5
+ class App < Command
6
+ #noinspection MissingYardParamTag
7
+ class << self
8
+
9
+ def init_with_program(prog)
10
+ prog.command(:app) do |c|
11
+ c.description 'Run the site of a J1 Project as an WebApp'
12
+ c.syntax 'app'
13
+ c.action do |args, options|
14
+ J1::Commands::App.process(args, options)
15
+ end
16
+ end
17
+ end
18
+
19
+ def process(args, options = {})
20
+ timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
21
+ if J1::Utils::is_project?
22
+ if J1::Utils::is_project_setup?
23
+ J1.logger.info "#{timestamp} - APP: Starting up your site ..."
24
+ process = J1::Utils::Exec2.run('APP','npm', 'run', 'j1-app')
25
+ else
26
+ raise SystemExit
27
+ end
28
+ else
29
+ raise SystemExit
30
+ end
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+ end
@@ -9,7 +9,7 @@ module J1
9
9
 
10
10
  def init_with_program(prog)
11
11
  prog.command(:generate) do |c|
12
- c.description 'Generates a J1 project scaffold in PATH'
12
+ c.description 'Generates a J1 Project scaffold in PATH'
13
13
  c.syntax 'generate PATH'
14
14
  c.option 'force', '--force', 'Force a site to be created even the PATH already exists'
15
15
  c.option 'skip-bundle', '--skip-bundle', 'Skip bundle install'