diff --git a/index.html b/index.html
index 92f2665..8e8c9b7 100644
--- a/index.html
+++ b/index.html
@@ -22,12 +22,12 @@ along with this program. If not, see .
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/uhr.js b/uhr.js
index a2f3110..1d00bbb 100644
--- a/uhr.js
+++ b/uhr.js
@@ -25,12 +25,17 @@ along with this program. If not, see .
themes: []
};
// auto-detect themes
- var uhrCSSs = $('head link[rel=stylesheet][href^=uhr-]');
- var matcher = /^(.*)uhr-(.+).css$/;
- for (var i = 0; i < uhrCSSs.length; i++) {
- var name = $(uhrCSSs[i]).attr('href');
- var code = name.match(matcher)[2];
- window._uhr.themes.push(code);
+ var styleSheets = $('head link[rel=stylesheet]');
+ for (var i = 0; i < styleSheets.length; i++) {
+ var styleSheet = $(styleSheets[i]);
+ var styleClass = styleSheet.attr('data-class');
+ if (styleClass !== undefined) {
+ var name = styleSheet.attr('data-name');
+ if (name === undefined) {
+ name = styleClass;
+ }
+ window._uhr.themes.push({'class': styleClass, 'name': name});
+ }
}
$.widget("fritteli.uhr", {
options: {
@@ -233,7 +238,7 @@ along with this program. If not, see .
var themeChooser = $('');
for (var i = 0; i < window._uhr.themes.length; i++) {
var theme = window._uhr.themes[i];
- themeChooser.append('');
+ themeChooser.append('');
}
e.after(themeChooser);
}