/* Settings applet */
/* Some of these styles will move to global styling later */
-#kiwi .settings_container{padding:50px}#kiwi .settings_container .clearfix:before,#kiwi .settings_container .list-inline:before,#kiwi .settings_container .thumbnails:before,#kiwi .settings_container .clearfix:after,#kiwi .settings_container .list-inline:after,#kiwi .settings_container .thumbnails:after{content:' ';display:table}#kiwi .settings_container .clearfix:after,#kiwi .settings_container .list-inline:after,#kiwi .settings_container .thumbnails:after{clear:both}#kiwi .settings_container .list-unstyled,#kiwi .settings_container .list-inline,#kiwi .settings_container .thumbnails{list-style-type:none;margin:0;padding:0}#kiwi .settings_container .list-inline>li,#kiwi .settings_container .thumbnails>li{display:inline-block}#kiwi .settings_container h1,#kiwi .settings_container h2,#kiwi .settings_container h3{margin-top:22px;margin-bottom:11px}#kiwi .settings_container h4,#kiwi .settings_container h5,#kiwi .settings_container h6{margin-top:11px;margin-bottom:11px}#kiwi .settings_container h1{font-size:46px}#kiwi .settings_container h2{font-size:40px}#kiwi .settings_container h3{font-size:34px}#kiwi .settings_container h4{font-size:28px}#kiwi .settings_container h5{font-size:22px}#kiwi .settings_container h6{font-size:16px}#kiwi .settings_container label{cursor:pointer}#kiwi .settings_container input,#kiwi .settings_container select,#kiwi .settings_container textarea{width:100%}#kiwi .settings_container input[size],#kiwi .settings_container select[size],#kiwi .settings_container textarea[size]{width:auto}#kiwi .settings_container input[type="file"],#kiwi .settings_container input[type="image"],#kiwi .settings_container input[type="submit"],#kiwi .settings_container input[type="reset"],#kiwi .settings_container input[type="button"],#kiwi .settings_container input[type="radio"],#kiwi .settings_container input[type="checkbox"]{width:auto}#kiwi .settings_container input[type="radio"],#kiwi .settings_container input[type="checkbox"]{cursor:pointer;margin-top:2px}#kiwi .settings_container input[type="checkbox"]{margin-top:3px}#kiwi .settings_container .radio,#kiwi .settings_container .checkbox{margin-bottom:10px;padding-left:20px}#kiwi .settings_container .radio label,#kiwi .settings_container .checkbox label{cursor:pointer}#kiwi .settings_container .radio:last-child,#kiwi .settings_container .checkbox:last-child{margin-bottom:0}#kiwi .settings_container .radio input[type="radio"],#kiwi .settings_container .checkbox input[type="checkbox"]{float:left;margin-left:-20px}#kiwi .settings_container .radio+.radio,#kiwi .settings_container .checkbox+.checkbox{margin-top:-7px}#kiwi .settings_container .thumbnail{float:left;margin-right:15px;text-align:center}#kiwi .settings_container .thumbnail>.thumbnail_wrapper{border-radius:3px;padding:3px}#kiwi .settings_container .thumbnail>img{border-radius:2px}#kiwi .settings_container .thumbnail.active>.thumbnail_wrapper{background-color:#a6c42c;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #a6c42c),color-stop(100%, #76bd2b));background-image:-webkit-linear-gradient(#a6c42c,#76bd2b);background-image:linear-gradient(#a6c42c,#76bd2b)}#kiwi .settings_container section{padding-bottom:20px}#kiwi .settings_container .theme_color{border-radius:2px;height:75px;width:75px}#kiwi .settings_container .control-group{margin:0 0 20px 20px}#kiwi .settings_container .control-group:last-child{margin-bottom:0}@media screen and (max-width: 768px){#kiwi .settings_container{padding:25px}}
+#kiwi .settings_container {
+ padding: 50px;
+}
+
+#kiwi .settings_container .thumbnails:before {
+ content: ' ';
+ display: table;
+}
+#kiwi .settings_container .thumbnails:after {
+ content: ' ';
+ display: table;
+ clear: both;
+}
+
+#kiwi .settings_container .thumbnails {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+}
+
+#kiwi .settings_container .thumbnails > li {
+ display: inline-block;
+}
+
+#kiwi .settings_container h1 {
+ margin-top: 22px;
+ margin-bottom: 11px;
+ font-size: 46px;
+}
+
+#kiwi .settings_container h2 {
+ margin-top: 22px;
+ margin-bottom: 11px;
+ font-size: 40px;
+}
+
+#kiwi .settings_container h3 {
+ margin-top: 22px;
+ margin-bottom: 11px;
+ font-size: 34px;
+}
+
+#kiwi .settings_container h4 {
+ margin-top: 11px;
+ margin-bottom: 11px;
+ font-size: 28px;
+}
+
+#kiwi .settings_container h5 {
+ margin-top: 11px;
+ margin-bottom: 11px;
+ font-size: 22px;
+}
+
+#kiwi .settings_container h6 {
+ margin-top: 11px;
+ margin-bottom: 11px;
+ font-size: 16px;
+}
+
+#kiwi .settings_container label {
+ cursor: pointer;
+}
+
+#kiwi .settings_container input,
+#kiwi .settings_container select,
+#kiwi .settings_container textarea {
+ width: 100%;
+}
+
+#kiwi .settings_container input[size],
+#kiwi .settings_container select[size],
+#kiwi .settings_container textarea[size] {
+ width: auto;
+}
+
+#kiwi .settings_container input[type="file"],
+#kiwi .settings_container input[type="image"],
+#kiwi .settings_container input[type="submit"],
+#kiwi .settings_container input[type="reset"],
+#kiwi .settings_container input[type="button"] {
+ width: auto;
+}
+
+#kiwi .settings_container input[type="radio"] {
+ width: auto;
+ cursor: pointer;
+ margin-top: 2px;
+}
+
+#kiwi .settings_container input[type="checkbox"] {
+ width: auto;
+ cursor: pointer;
+ margin-top: 3px;
+}
+
+#kiwi .settings_container .radio,
+#kiwi .settings_container .checkbox {
+ margin-bottom: 10px;
+ padding-left: 20px;
+}
+
+#kiwi .settings_container .radio:last-child,
+#kiwi .settings_container .checkbox:last-child {
+ margin-bottom: 0;
+}
+
+#kiwi .settings_container .radio input[type="radio"],
+#kiwi .settings_container .checkbox input[type="checkbox"] {
+ float: left;
+ margin-left: -20px;
+}
+
+#kiwi .settings_container .radio+.radio,
+#kiwi .settings_container .checkbox+.checkbox {
+ margin-top: -7px;
+}
+
+#kiwi .settings_container .thumbnail {
+ float: left;
+ margin-right: 15px;
+ text-align: center;
+}
+#kiwi .settings_container .thumbnail > .thumbnail_wrapper {
+ border-radius: 3px;
+ padding: 3px;
+}
+
+#kiwi .settings_container .thumbnail > img {
+ border-radius: 2px;
+}
+
+#kiwi .settings_container .thumbnail.active > .thumbnail_wrapper {
+ background-color: #a6c42c;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #a6c42c), color-stop(100%, #76bd2b));
+ background-image: -webkit-linear-gradient(#a6c42c, #76bd2b);
+ background-image: linear-gradient(#a6c42c, #76bd2b);
+}
+
+#kiwi .settings_container section {
+ padding-bottom: 20px;
+}
+
+#kiwi .settings_container .theme_color {
+ border-radius: 2px;
+ height: 75px;
+ width: 75px;
+}
+
+#kiwi .settings_container .control-group {
+ margin: 0 0 20px 20px;
+}
+
+#kiwi .settings_container .control-group:last-child {
+ margin-bottom: 0;
+}
+
+@media screen and (max-width: 768px) {
+ #kiwi .settings_container {
+ padding: 25px;
+ }
+}
(function () {\r
- var View = Backbone.View.extend({\r
- events: {\r
- 'change [data-setting]': 'saveSettings',\r
- 'click [data-setting="theme"]': 'selectTheme'\r
- },\r
-\r
- initialize: function (options) {\r
- this.$el = $($('#tmpl_applet_settings').html().trim());\r
-\r
- // Incase any settings change while we have this open, update them\r
- _kiwi.global.settings.on('change', this.loadSettings, this);\r
-\r
- // Now actually show the current settings\r
- this.loadSettings();\r
-\r
- },\r
-\r
- loadSettings: function () {\r
-\r
- var that = this;\r
-\r
- $.each(_kiwi.global.settings.attributes, function(key, value) {\r
-\r
- switch ($('[data-setting="' + key + '"]', that.$el).prop('type')) {\r
- case 'checkbox':\r
- $('[data-setting="' + key + '"]', that.$el).prop('checked', value);\r
- break;\r
- case 'radio':\r
- $('[data-setting="' + key + '"][value="' + value + '"]', that.$el).prop('checked', true);\r
- break;\r
- case 'text':\r
- $('[data-setting="' + key + '"]', that.$el).val(value);\r
- break;\r
- default:\r
- $('[data-setting="' + key + '"][data-value="' + value + '"]', that.$el).addClass('active');\r
- break;\r
- }\r
- });\r
- },\r
-\r
- saveSettings: function (event) {\r
- var value,\r
- settings = _kiwi.global.settings,\r
- $setting = $(event.currentTarget, this.$el)\r
-\r
- switch (event.currentTarget.type) {\r
- case 'checkbox':\r
- value = $setting.is(':checked');\r
- break;\r
- case 'radio':\r
- case 'text':\r
- value = $setting.val();\r
- break;\r
- default:\r
- value = $setting.data('value');\r
- break;\r
- }\r
-\r
- // Stop settings being updated while we're saving one by one\r
- _kiwi.global.settings.off('change', this.loadSettings, this);\r
- settings.set($setting.data('setting'), value);\r
- settings.save();\r
-\r
- // Continue listening for setting changes\r
- _kiwi.global.settings.on('change', this.loadSettings, this);\r
- },\r
-\r
- selectTheme: function(event) {\r
- $('[data-setting="theme"].active', this.$el).removeClass('active');\r
- $(event.currentTarget).addClass('active').trigger('change');\r
- event.preventDefault();\r
- }\r
- });\r
-\r
-\r
- var Applet = Backbone.Model.extend({\r
- initialize: function () {\r
- this.set('title', 'Settings');\r
- this.view = new View();\r
- }\r
- });\r
-\r
-\r
- _kiwi.model.Applet.register('kiwi_settings', Applet);\r
+ var View = Backbone.View.extend({\r
+ events: {\r
+ 'change [data-setting]': 'saveSettings',\r
+ 'click [data-setting="theme"]': 'selectTheme'\r
+ },\r
+\r
+ initialize: function (options) {\r
+ this.$el = $($('#tmpl_applet_settings').html().trim());\r
+\r
+ // Incase any settings change while we have this open, update them\r
+ _kiwi.global.settings.on('change', this.loadSettings, this);\r
+\r
+ // Now actually show the current settings\r
+ this.loadSettings();\r
+\r
+ },\r
+\r
+ loadSettings: function () {\r
+\r
+ var that = this;\r
+\r
+ $.each(_kiwi.global.settings.attributes, function(key, value) {\r
+\r
+ switch ($('[data-setting="' + key + '"]', that.$el).prop('type')) {\r
+ case 'checkbox':\r
+ $('[data-setting="' + key + '"]', that.$el).prop('checked', value);\r
+ break;\r
+ case 'radio':\r
+ $('[data-setting="' + key + '"][value="' + value + '"]', that.$el).prop('checked', true);\r
+ break;\r
+ case 'text':\r
+ $('[data-setting="' + key + '"]', that.$el).val(value);\r
+ break;\r
+ default:\r
+ $('[data-setting="' + key + '"][data-value="' + value + '"]', that.$el).addClass('active');\r
+ break;\r
+ }\r
+ });\r
+ },\r
+\r
+ saveSettings: function (event) {\r
+ var value,\r
+ settings = _kiwi.global.settings,\r
+ $setting = $(event.currentTarget, this.$el)\r
+\r
+ switch (event.currentTarget.type) {\r
+ case 'checkbox':\r
+ value = $setting.is(':checked');\r
+ break;\r
+ case 'radio':\r
+ case 'text':\r
+ value = $setting.val();\r
+ break;\r
+ default:\r
+ value = $setting.data('value');\r
+ break;\r
+ }\r
+\r
+ // Stop settings being updated while we're saving one by one\r
+ _kiwi.global.settings.off('change', this.loadSettings, this);\r
+ settings.set($setting.data('setting'), value);\r
+ settings.save();\r
+\r
+ // Continue listening for setting changes\r
+ _kiwi.global.settings.on('change', this.loadSettings, this);\r
+ },\r
+\r
+ selectTheme: function(event) {\r
+ $('[data-setting="theme"].active', this.$el).removeClass('active');\r
+ $(event.currentTarget).addClass('active').trigger('change');\r
+ event.preventDefault();\r
+ }\r
+ });\r
+\r
+\r
+ var Applet = Backbone.Model.extend({\r
+ initialize: function () {\r
+ this.set('title', 'Settings');\r
+ this.view = new View();\r
+ }\r
+ });\r
+\r
+\r
+ _kiwi.model.Applet.register('kiwi_settings', Applet);\r
})();
\ No newline at end of file