Adam Shaw před 8 roky
rodič
revize
6cfe17f27d
2 změnil soubory, kde provedl 34 přidání a 2 odebrání
  1. 23 1
      demos/js/theme-chooser.js
  2. 11 1
      demos/themes.html

+ 23 - 1
demos/js/theme-chooser.js

@@ -12,7 +12,7 @@ function initThemeChooser(settings) {
 
 
 
 
 	function setThemeSystem(themeSystem) {
 	function setThemeSystem(themeSystem) {
-		var $allSelectWraps = $('[data-theme-system]').hide();
+		var $allSelectWraps = $('.selector[data-theme-system]').hide();
 		var $selectWrap = $allSelectWraps.filter('[data-theme-system="' + themeSystem +'"]').show();
 		var $selectWrap = $allSelectWraps.filter('[data-theme-system="' + themeSystem +'"]').show();
 		var $select = $selectWrap.find('select')
 		var $select = $selectWrap.find('select')
 			.off('change') // avoid duplicate handlers :(
 			.off('change') // avoid duplicate handlers :(
@@ -36,6 +36,8 @@ function initThemeChooser(settings) {
 			else {
 			else {
 				settings.change(themeSystem);
 				settings.change(themeSystem);
 			}
 			}
+
+			showCredits(themeSystem, themeName);
 		}
 		}
 
 
 		if (stylesheetUrl) {
 		if (stylesheetUrl) {
@@ -71,6 +73,26 @@ function initThemeChooser(settings) {
 	}
 	}
 
 
 
 
+	function showCredits(themeSystem, themeName) {
+		var creditId;
+
+		if (themeSystem === 'jquery-ui') {
+			creditId = 'jquery-ui';
+		}
+		else if (themeSystem === 'bootstrap3') {
+			if (themeName) {
+				creditId = 'bootstrap-custom';
+			}
+			else {
+				creditId = 'bootstrap-standard';
+			}
+		}
+
+		$('.credits').hide()
+			.filter('[data-credit-id="' + creditId + '"]').show();
+	}
+
+
 	function whenStylesheetLoaded(linkNode, callback) {
 	function whenStylesheetLoaded(linkNode, callback) {
 		var isReady = false;
 		var isReady = false;
 
 

+ 11 - 1
demos/themes.html

@@ -210,10 +210,20 @@
 				</select>
 				</select>
 			</div>
 			</div>
 
 
+			<span id='loading' style='display:none'>loading theme...</span>
+
 		</div>
 		</div>
 
 
 		<div class='right'>
 		<div class='right'>
-			<div id='loading' style='display:none'>loading theme...</div>
+			<span class='credits' data-credit-id='bootstrap-standard' style='display:none'>
+				<a href='https://getbootstrap.com/docs/3.3/' target='_blank'>Theme by Bootstrap</a>
+			</span>
+			<span class='credits' data-credit-id='bootstrap-custom' style='display:none'>
+				<a href='https://bootswatch.com/' target='_blank'>Theme by Bootswatch</a>
+			</span>
+			<span class='credits' data-credit-id='jquery-ui' style='display:none'>
+				<a href='http://jqueryui.com/themeroller/' target='_blank'>Theme by jQuery UI</a>
+			</span>
 		</div>
 		</div>
 
 
 		<div class='clear'></div>
 		<div class='clear'></div>