Skip to content

Commit

Permalink
do not use router
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeapage committed Jun 12, 2015
1 parent 40101b6 commit d5b8026
Show file tree
Hide file tree
Showing 8 changed files with 282 additions and 114 deletions.
49 changes: 5 additions & 44 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ System.config({

System.config({
"map": {
"aurelia-animator-css": "github:aurelia/animator-css@0.3.0",
"aurelia-bootstrapper": "github:aurelia/bootstrapper@0.13.0",
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.8.1",
"aurelia-framework": "github:aurelia/framework@0.12.0",
"aurelia-http-client": "github:aurelia/http-client@0.9.1",
"aurelia-router": "github:aurelia/router@0.9.0",
"aurelia-logging-console": "github:aurelia/logging-console@0.5.0",
"aurelia-loader-default": "github:aurelia/loader-default@0.8.0",
"aurelia-templating-binding": "github:aurelia/templating-binding@0.12.0",
"aurelia-templating-resources": "github:aurelia/templating-resources@0.12.0",
"aurelia-event-aggregator": "github:aurelia/event-aggregator@0.5.0",
"babel": "npm:babel-core@5.4.7",
"babel-runtime": "npm:babel-runtime@5.4.7",
"bootstrap": "github:twbs/bootstrap@3.3.4",
Expand All @@ -30,29 +31,12 @@ System.config({
"css": "github:systemjs/plugin-css@0.1.11",
"font-awesome": "npm:font-awesome@4.3.0",
"polymer/mutationobservers": "github:polymer/mutationobservers@0.4.2",
"github:aurelia/animator-css@0.3.0": {
"aurelia-templating": "github:aurelia/templating@0.12.0"
},
"github:aurelia/binding@0.7.0": {
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.8.1",
"aurelia-metadata": "github:aurelia/metadata@0.6.0",
"aurelia-task-queue": "github:aurelia/task-queue@0.5.0",
"core-js": "npm:core-js@0.9.15"
},
"github:aurelia/bootstrapper@0.13.0": {
"aurelia-event-aggregator": "github:aurelia/event-aggregator@0.5.0",
"aurelia-framework": "github:aurelia/framework@0.12.0",
"aurelia-history": "github:aurelia/history@0.5.0",
"aurelia-history-browser": "github:aurelia/history-browser@0.5.0",
"aurelia-loader-default": "github:aurelia/loader-default@0.8.0",
"aurelia-logging-console": "github:aurelia/logging-console@0.5.0",
"aurelia-router": "github:aurelia/router@0.9.0",
"aurelia-templating": "github:aurelia/templating@0.12.0",
"aurelia-templating-binding": "github:aurelia/templating-binding@0.12.0",
"aurelia-templating-resources": "github:aurelia/templating-resources@0.12.0",
"aurelia-templating-router": "github:aurelia/templating-router@0.13.0",
"core-js": "npm:core-js@0.9.15"
},
"github:aurelia/dependency-injection@0.8.1": {
"aurelia-logging": "github:aurelia/logging@0.5.0",
"aurelia-metadata": "github:aurelia/metadata@0.6.0",
Expand All @@ -72,14 +56,6 @@ System.config({
"aurelia-templating": "github:aurelia/templating@0.12.0",
"core-js": "npm:core-js@0.9.15"
},
"github:aurelia/history-browser@0.5.0": {
"aurelia-history": "github:aurelia/history@0.5.0",
"core-js": "npm:core-js@0.9.15"
},
"github:aurelia/http-client@0.9.1": {
"aurelia-path": "github:aurelia/path@0.7.0",
"core-js": "npm:core-js@0.9.15"
},
"github:aurelia/loader-default@0.8.0": {
"aurelia-loader": "github:aurelia/loader@0.7.0",
"aurelia-metadata": "github:aurelia/metadata@0.6.0"
Expand All @@ -96,14 +72,6 @@ System.config({
"github:aurelia/route-recognizer@0.5.0": {
"core-js": "npm:core-js@0.9.15"
},
"github:aurelia/router@0.9.0": {
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.8.1",
"aurelia-event-aggregator": "github:aurelia/event-aggregator@0.5.0",
"aurelia-history": "github:aurelia/history@0.5.0",
"aurelia-path": "github:aurelia/path@0.7.0",
"aurelia-route-recognizer": "github:aurelia/route-recognizer@0.5.0",
"core-js": "npm:core-js@0.9.15"
},
"github:aurelia/templating-binding@0.12.0": {
"aurelia-binding": "github:aurelia/binding@0.7.0",
"aurelia-logging": "github:aurelia/logging@0.5.0",
Expand All @@ -117,13 +85,6 @@ System.config({
"aurelia-templating": "github:aurelia/templating@0.12.0",
"core-js": "npm:core-js@0.9.15"
},
"github:aurelia/templating-router@0.13.0": {
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.8.1",
"aurelia-metadata": "github:aurelia/metadata@0.6.0",
"aurelia-path": "github:aurelia/path@0.7.0",
"aurelia-router": "github:aurelia/router@0.9.0",
"aurelia-templating": "github:aurelia/templating@0.12.0"
},
"github:aurelia/templating@0.12.0": {
"aurelia-binding": "github:aurelia/binding@0.7.0",
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.8.1",
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="stylesheet" type="text/css" href="dist/main.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body aurelia-app="animation-main">
<body aurelia-app="main">
<div class="splash">
<div class="message"></div>
<i class="fa fa-spinner fa-spin"></i>
Expand All @@ -19,7 +19,7 @@
System.import('core-js').then( function() {
// Imports MutationObserver polyfill
System.import('polymer/mutationobservers').then( function() {
System.import('aurelia-bootstrapper');
System.import('bootstrapper');
});
});
</script>
Expand Down
8 changes: 0 additions & 8 deletions src/animation-main.js

This file was deleted.

32 changes: 30 additions & 2 deletions src/app.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
<template>
<div class="page-host">
<router-view></router-view>
<require from='./cmeditor'></require>

<div class="navbar navbar-fixed-top"><div class="navbar-inner">
<ul class="nav">
<li class="brand"><a href="/">LESS2CSS</a></li>
<li class="divider-vertical"></li>
<li class="less-options"><a href="#" ng-click="toggleDrawer($event)">Options</a></li>
<li class="divider-vertical"></li>
<li class="option-info"><span>LESS Version:&nbsp;<code class="">${lessVersion}</code></span></li>
</ul>
</div></div>

<div class="au-animate main">
<div class="cm-less">
<div class="code-wrap left">
<h2 class="code-label left">LESS</h2>
<cmeditor value.two-way="lessSrc" />
</div>
</div>
<div class="cm-css">
<div class="code-wrap right">
<h2 class="code-label right">CSS</h2>
<cmeditor readonly="true" value.bind="css" />
</div>
</div>
</div>
<footer class="page-footer">
<p>
&#169; 2015 Luke Page, Brian Frichette &amp; Contributors. License&nbsp;<a href="http://opensource.org/licenses/MIT" target="_blank">MIT</a>.</p>
<p class="small">Special thanks for the Open Source technologies that made building this site a pleasure:&nbsp;<a href="http://lesscss.org/" target="_blank">LESS</a>,&nbsp;<a href="http://twitter.github.com/bootstrap/" target="_blank">Twitter Bootstrap</a>,&nbsp;<a href="http://codemirror.net/" target="_blank">CodeMirror</a>,&nbsp;<a href="http://http://aurelia.io/" target="_blank">Aurelia</a>.</p></footer>

</template>
24 changes: 16 additions & 8 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import less from './less';
import 'bootstrap';

export class App {
configureRouter(config, router){
config.title = 'less2css';
config.map([
{ route: [''], moduleId: './main', nav: true, title:'' }
]);

this.router = router;
export class Main {
constructor() {
const lessVersions = less.getVersions();
this.lessVersion = lessVersions[lessVersions.length - 1];
less.loadVersion(this.lessVersion);
}
get lessSrc() {
return this._lessSrc;
}
set lessSrc(value) {
this._lessSrc = value;
less.convert(value)
.then((cssResp) => {
this.css = cssResp.css;
});
}
}
Loading

0 comments on commit d5b8026

Please sign in to comment.