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.
- checksums.yaml +4 -4
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
- data/assets/data/banner.html +2 -2
- data/assets/data/panel.html +4 -4
- data/assets/themes/j1/adapter/js/attic.js +19 -2
- data/assets/themes/j1/adapter/js/rtable.js +68 -5
- data/assets/themes/j1/adapter/js/scroller.js +7 -0
- data/assets/themes/j1/core/css/vendor.css +5 -6
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +2 -1
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/jquery/js/extensions/hasClass.js +20 -0
- data/assets/themes/j1/modules/jquery/js/extensions/removeClass.js +24 -0
- data/assets/themes/j1/modules/rtable/js/rtable.js +22 -16
- data/assets/themes/j1/modules/rtable/js/rtable.min.js +1 -1
- data/assets/themes/j1/modules/themeSwitcher/LICENSE +21 -21
- data/assets/themes/j1/modules/themeSwitcher/README.md +166 -166
- data/lib/j1/commands/app.rb +36 -0
- data/lib/j1/commands/generate.rb +1 -1
- data/lib/j1/commands/patch.rb +1 -1
- data/lib/j1/commands/rebuild.rb +1 -1
- data/lib/j1/commands/reset.rb +1 -1
- data/lib/j1/commands/setup.rb +1 -1
- data/lib/j1/commands/site.rb +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/j1_app.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/asciidoc2pdf/images/cover/readme +39 -0
- data/lib/starter_web/_data/asciidoc2pdf/themes/base-theme.yml +113 -117
- data/lib/starter_web/_data/asciidoc2pdf/themes/default-for-print-theme.yml +25 -24
- data/lib/starter_web/_data/asciidoc2pdf/themes/default-for-print-with-fallback-font-theme.yml +1 -0
- data/lib/starter_web/_data/asciidoc2pdf/themes/default-theme.yml +215 -212
- data/lib/starter_web/_data/asciidoc2pdf/themes/default-with-fallback-font-theme.yml +9 -5
- data/lib/starter_web/_data/asciidoc2pdf/themes/j1-theme.yml +24 -5
- data/lib/starter_web/_data/blocks/banner.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/rtable.yml +12 -1
- data/lib/starter_web/_data/puma/config.rb +3 -0
- data/lib/starter_web/_data/resources.yml +4 -2
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/assets/images/banner/1280x600/lunr.jpg +0 -0
- data/lib/starter_web/assets/images/{modules/attics/banner/library-1920x800-bw.jpg → banner/1920x800/library.jpg} +0 -0
- data/lib/starter_web/assets/images/banner/scalable/readme +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/{ev.jpg → _ev.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/_guillaume-bolduc.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/crawford-jolly.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/josh-liu.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/kristopher-roller.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/moritz-kindler.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/nasa.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/{alexander-redl.jpg → _alexander-redl.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{alexander-shatov-1920x1280.jpg → _alexander-shatov-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{annie-spratt-1920x1280.jpg → _annie-spratt-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{antonino-visalli-1920x1280.jpg → _antonino-visalli-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{christa-dodoo-1920x1280.jpg → _christa-dodoo-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{guillaume-bolduc-1920x1280.jpg → _guillaume-bolduc-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{harpal-singh.jpg → _harpal-singh.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{humble-lamb-1920x1280.jpg → _humble-lamb-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{john-schnobrich-2-1920x1280.jpg → _john-schnobrich-2-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{kirklai-1920x1280.jpg → _kirklai-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{romain-vignes-1920x1280.jpg → _romain-vignes-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{runner-1920x1200.jpg → _runner-1920x1200.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{spacex-1920x1280.jpg → _spacex-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/_vladislav-klapin-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/{wrongtog-1920x1280.jpg → _wrongtog-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{building-blocks-1920x1280-bw.jpg → building-blocks-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/lunr-1280x800.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/{shubham-dhage-2-1920x1280.jpg → shubham-dhage-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/vladislav-klapin-1920x1280.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/2022-02-01-about-j1.adoc +2 -2
- data/lib/starter_web/index.html +23 -18
- data/lib/starter_web/package.json +5 -4
- data/lib/starter_web/pages/public/about/features.adoc +9 -4
- data/lib/starter_web/pages/public/about/reporting_issues.adoc +9 -5
- data/lib/starter_web/pages/public/about/site.adoc +8 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/000_intro.adoc +5 -3
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +3 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +3 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/attributes.asciidoc +2 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/{100_converter/000_basic_example.asciidoc → 000_examples/basic_example.asciidoc} +1 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/111_about_the_converter.asciidoc +20 -11
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/112_getting_started.asciidoc +76 -24
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/211_language_overview.asciidoc +33 -29
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/212_values.asciidoc +67 -88
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/213_fonts.asciidoc +40 -39
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/images/readme +1 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/tables/math_expressions.asciidoc +19 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/tables/measurement_units.asciidoc +22 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +20 -5
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/100_chapter.asciidoc +5 -325
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/200_chapter.asciidoc +3 -134
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/images/readme +1 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/build_command_options.asciidoc +72 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/files_and_folders.asciidoc +66 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/global_configuration_options.asciidoc +63 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/global_variables.asciidoc +26 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/page_variables.asciidoc +54 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/serve_command_options.asciidoc +45 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/site_variables.asciidoc +59 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +21 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +124 -122
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/archive.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/index.html +3 -3
- data/lib/starter_web/pages/public/features/general.adoc +4 -4
- data/lib/starter_web/pages/public/features/template.adoc +1 -2
- data/lib/starter_web/pages/public/learn/quickstart.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{400_asciidoc_extensions.adoc → asciidoc_extensions.adoc} +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{410_bs_modals_extentions.adoc → bs_modals_extentions.adoc} +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{300_icon_fonts.adoc → icon_fonts.adoc} +1 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{100_present_images.adoc → present_images.adoc} +10 -10
- data/lib/starter_web/pages/public/learn/roundtrip/{100_present_videos.adoc → present_videos.adoc} +0 -0
- data/lib/starter_web/pages/public/learn/roundtrip/{600_quicksearch.adoc → quicksearch.adoc} +6 -7
- data/lib/starter_web/pages/public/learn/roundtrip/{420_responsive_tables_extensions.adoc → responsive_tables_extensions.adoc} +86 -73
- data/lib/starter_web/pages/public/learn/roundtrip/{500_themes.adoc → themes.adoc} +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{200_typography.adoc → typography.adoc} +6 -6
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +2 -2
- data/lib/starter_web/pages/public/legal/de/100_copyright.adoc +3 -2
- data/lib/starter_web/pages/public/legal/de/100_impress.adoc +3 -2
- data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +3 -2
- data/lib/starter_web/pages/public/legal/de/400_comment_policy.adoc +3 -2
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +3 -2
- data/lib/starter_web/pages/public/legal/en/200_impress.adoc +3 -2
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +3 -2
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +3 -2
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +2 -2
- data/lib/starter_web/pages/public/plans/plans.adoc +2 -2
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +5 -5
- data/lib/starter_web/pages/public/se/se-fake.adoc +2 -2
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +56 -38
- data/lib/starter_web/assets/images/modules/attics/1920x1280/ben-kolde.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/braden-collum.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/firmbee-com.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/max-harlynking.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/admin-dashboard-bootstrap-1280x800-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/lunr-banner-1280x800.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/franck-1920x12800.jpg +0 -0
- 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
|
-
|
62
|
-
xl: "
|
63
|
-
lg: "
|
64
|
-
md: "
|
65
|
-
sm: "
|
66
|
-
xs: "
|
67
|
-
default: "
|
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
|
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 <ul> or <select>
|
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 <ul> or <select>
|
@@ -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
|
data/lib/j1/commands/generate.rb
CHANGED
@@ -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
|
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'
|