Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions controls/strip/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
<!-- Main -->
<script type="text/javascript">
var strip = strip_c({ strip_el: $('.strip') }).init();
$.getJSON('/settings', function(data) {
if (data.antialiasing === false) {
$('html').css('-webkit-font-smoothing', 'auto');
}
});
</script>
</body>
</html>
Expand Down
16 changes: 14 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ var bootstrap = function(http_srv) {
*/
devtools: require('./lib/devtools.js').devtools({
http_port: http_port
})
}),
defaults: require('./lib/defaults.json')
};

breach.init(function() {
Expand All @@ -53,6 +54,11 @@ var bootstrap = function(http_srv) {

breach.expose('init', function(src, args, cb_) {
async.parallel([
function(cb_) {
breach.module('core').call('settings_init', {
defaults: common._.defaults
}, cb_);
},
common._.box.init,
common._.tabs.init,
common._.strip.init,
Expand Down Expand Up @@ -104,12 +110,18 @@ var bootstrap = function(http_srv) {

/* App Configuration */
app.use('/', express.static(__dirname + '/controls'));
app.use(require('body-parser')());
app.use(require('body-parser').json());
app.use(require('method-override')())

app.get('/proxy', function(req, res, next) {
request(req.param('url')).pipe(res);
});

app.get('/settings', function(req, res, next) {
breach.module('core').call('settings_get', null, function(err, settings) {
res.json(settings);
});
});

var http_srv = http.createServer(app).listen(0, '127.0.0.1');

Expand Down
4 changes: 4 additions & 0 deletions lib/defaults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"height": 45,
"antialiasing": true
}
12 changes: 12 additions & 0 deletions lib/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,17 @@ var tabs = function(spec, my) {
});
break;
}
case 'Module Settings': {
breach.module('core').call('tabs_new', {
url: 'breach://modules/#/mod_strip/settings',
visible: true,
focus: true
}, function(err, res) {
console.log('[settings]', res);
});

break;
}
}
}
};
Expand All @@ -557,6 +568,7 @@ var tabs = function(spec, my) {

var items = [
'Reload',
'Module Settings',
null,
'Inspect Element',
'Close DevTools'
Expand Down