Skip to content

Commit

Permalink
Finetuning
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Kohlhepp committed May 21, 2011
1 parent dfc3da3 commit 8f0a4c8
Showing 8 changed files with 146 additions and 130 deletions.
18 changes: 11 additions & 7 deletions source/css/main.css
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
// https://github.com/frankkohlhepp/fancy-settings
// License: LGPL v2.1
*/
.fancy {
text-shadow: #F5F5F5 0 1px 0;
}

#sidebar {
position: absolute;
background-image: linear-gradient(top, #EDEDED, #F5F5F5);
@@ -20,9 +24,9 @@
);
background-image: -o-linear-gradient(top, #EDEDED, #F5F5F5);
width: 219px;
height: 100%;
top: 0;
left: 0;
bottom: 0;
border-right: 1px solid #C2C2C2;
box-shadow: inset -8px 0 30px -30px black;
}
@@ -45,8 +49,9 @@

#tab-container {
position: absolute;
width: 100%;
top: 50px;
left: 0;
right: 0;
bottom: 0;
overflow-y: auto;
overflow-x: hidden;
@@ -79,7 +84,7 @@
background-color: #D4D4D4;
border-color: #BFBFBF;
color: black;
text-shadow: none;
text-shadow: #DBDBDB 0 1px 0;
box-shadow: inset -12px 0 30px -30px black;
}

@@ -94,20 +99,19 @@ body.searching #tab-container .tab.active {
#content {
position: absolute;
top: 0;
bottom: 0;
left: 220px;
right: 0;
overflow-y: auto;
overflow-x: auto;
bottom: 0;
overflow: auto;
}

.tab-content {
display: none;
position: absolute;
width: 840px;
top: 0;
bottom: 0;
left: 0;
bottom: 0;
padding: 20px;
padding-top: 15px;
}
32 changes: 21 additions & 11 deletions source/css/setting.css
Original file line number Diff line number Diff line change
@@ -19,57 +19,67 @@
}

.setting.group-name {
width: 130px;
width: 140px;
padding: 0;
font-size: 14px;
font-weight: bold;
vertical-align: top;
}

.setting.bundle {
max-width: 600px;
margin-bottom: 5px;
}

.setting.bundle.description {
margin-left: 2px;
padding-left: 10px;
border-left: 1px solid #C2C2C2;
color: #555555;
}

.setting.bundle.list-box {
margin-bottom: 10px;
}

.setting.label.radio-buttons + .setting.container.radio-buttons {
margin-top: 3px;
}

.setting.label, .setting.element-label {
margin-right: 5px;
margin-right: 7px;
font-size: 13px;
font-weight: normal;
}

.setting.label.checkbox, .setting.element-label {
margin-left: 5px;
margin-right: 0;
}

.setting.label.checkbox {
position: relative;
top: 1px;
}

.setting.label.radio-buttons + .setting.container.radio-buttons {
margin-top: 3px;
}

.setting.element.description {
color: #555555;
}

.setting.element.slider {
position: relative;
top: 4px;
}

.setting.element.list-box {
display: block;
height: 100px;
width: 100%;
display: block;
}

#nothing-found {
display: none;
margin: 0;
margin-top: 10px;
padding: 0;
border: none;
font-size: 18px;
font-weight: lighter;
color: #999999;
}
1 change: 1 addition & 0 deletions source/index.html
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
<script src="js/classes/setting.js"></script>
<script src="js/classes/search.js"></script>
<script src="js/classes/fancy-settings.js"></script>
<script src="manifest.js"></script>
<script src="settings.js"></script>
</head>
<body class="no-select">
47 changes: 15 additions & 32 deletions source/js/classes/fancy-settings.js
Original file line number Diff line number Diff line change
@@ -74,39 +74,22 @@
}
});

FancySettings.__proto__.initWithManifest = function (manifest, callback) {
var request = new Request({
"url": manifest,
"noCache": true
});
request.addEvent("complete", function () {
var response,
settings,
output;

// Remove single line comments
response = request.response.text.replace(/\/\/.*\n/g, "");

try {
response = JSON.parse(response);
} catch (e) {
throw "errorParsingManifest";
}

settings = new FancySettings(response.name, response.icon);
settings.manifestOutput = {};

response.settings.each(function (params) {
output = settings.create(params);
if (params.name !== undefined) {
settings.manifestOutput[params.name] = output;
}
});

if (callback !== undefined) {
callback(settings);
FancySettings.__proto__.initWithManifest = function (callback) {
var settings,
output;

settings = new FancySettings(manifest.name, manifest.icon);
settings.manifest = {};

manifest.settings.each(function (params) {
output = settings.create(params);
if (params.name !== undefined) {
settings.manifest[params.name] = output;
}
});
request.send();

if (callback !== undefined) {
callback(settings);
}
};
}());
3 changes: 2 additions & 1 deletion source/js/classes/search.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
// License: LGPL v2.1
//
(function () {
var Search = this.Search = new Class({
this.Search = new Class({
"index": [],
"groups": {},

@@ -115,6 +115,7 @@

"reset": function () {
this.search.set("value", "");
this.search.blur();
this.find("");
}
});
32 changes: 19 additions & 13 deletions source/js/classes/setting.js
Original file line number Diff line number Diff line change
@@ -9,6 +9,12 @@

settings = new Store("settings");
Bundle = new Class({
// Attributes:
// - tab
// - group
// - name
// - type
//
// Methods:
// - initialize
// - createDOM
@@ -89,7 +95,7 @@

"setupDOM": function () {
if (this.params.text !== undefined) {
this.element.set("text", this.params.text);
this.element.set("html", this.params.text);
}

this.element.inject(this.container);
@@ -136,7 +142,7 @@

"setupDOM": function () {
if (this.params.label !== undefined) {
this.label.set("text", this.params.label);
this.label.set("html", this.params.label);
this.label.inject(this.container);
this.params.searchString += this.params.label + "•";
}
@@ -158,7 +164,7 @@
});

Bundle.Text = new Class({
// name, label, text, masked
// label, text, masked
// action -> change & keyup
"Extends": Bundle,

@@ -183,7 +189,7 @@

"setupDOM": function () {
if (this.params.label !== undefined) {
this.label.set("text", this.params.label);
this.label.set("html", this.params.label);
this.label.inject(this.container);
this.params.searchString += this.params.label + "•";
}
@@ -217,7 +223,7 @@
});

Bundle.Checkbox = new Class({
// name, label
// label
// action -> change
"Extends": Bundle,

@@ -248,7 +254,7 @@
this.container.inject(this.bundle);

if (this.params.label !== undefined) {
this.label.set("text", this.params.label);
this.label.set("html", this.params.label);
this.label.inject(this.container);
this.params.searchString += this.params.label + "•";
}
@@ -270,7 +276,7 @@
});

Bundle.Slider = new Class({
// name, label, max, min, step
// label, max, min, step
// action -> change
"Extends": Bundle,

@@ -295,7 +301,7 @@

"setupDOM": function () {
if (this.params.label !== undefined) {
this.label.set("text", this.params.label);
this.label.set("html", this.params.label);
this.label.inject(this.container);
this.params.searchString += this.params.label + "•";
}
@@ -332,7 +338,7 @@
});

Bundle.PopupButton = new Class({
// name, label, options[{value, text}]
// label, options[{value, text}]
// action -> change
"Extends": Bundle,

@@ -366,7 +372,7 @@

"setupDOM": function () {
if (this.params.label !== undefined) {
this.label.set("text", this.params.label);
this.label.set("html", this.params.label);
this.label.inject(this.container);
this.params.searchString += this.params.label + "•";
}
@@ -377,7 +383,7 @@
});

Bundle.ListBox = new Class({
// name, label, options[{value, text}]
// label, options[{value, text}]
// action -> change
"Extends": Bundle.PopupButton,

@@ -416,7 +422,7 @@
});

Bundle.RadioButtons = new Class({
// name, label, options[{value, text}]
// label, options[{value, text}]
// action -> change
"Extends": Bundle,

@@ -466,7 +472,7 @@

"setupDOM": function () {
if (this.params.label !== undefined) {
this.label.set("text", this.params.label);
this.label.set("html", this.params.label);
this.label.inject(this.bundle, "top");
this.params.searchString += this.params.label + "•";
}
Loading

0 comments on commit 8f0a4c8

Please sign in to comment.