Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
76b5488
Change wording and branding to reflect broader vision.
martindale Aug 13, 2015
7257126
Merge branch 'master' of github.com:martindale/maki into better-splash
martindale Aug 13, 2015
960756c
Merge branch 'semantic-2.0' into better-splash
martindale Aug 13, 2015
7fc300c
Redesign front page completely.
martindale Aug 13, 2015
024f7be
Add maki-icon.png to be cropped, simple icon.
martindale Aug 13, 2015
5aefa34
Snapshot current updates.
martindale Aug 13, 2015
7585f05
Switch examples to items.
martindale Aug 14, 2015
dffb023
Fix up navbar in lieu of Semantic-Org/Semantic-UI#2360
martindale Aug 18, 2015
d6c5ae8
Further iterations on new splash.
martindale Aug 21, 2015
0577a80
Add LICENSE, better description.
martindale Aug 21, 2015
e59a257
Add plugins as a resource.
martindale Aug 21, 2015
8bc33be
Override plugin view.
martindale Aug 21, 2015
97893e6
Add labels for version, coverage.
martindale Aug 21, 2015
411eb79
Add links to actual page.
martindale Aug 21, 2015
2feaecf
Allow for plugin descriptions.
martindale Aug 21, 2015
298d213
Add icon for plugins.
martindale Aug 21, 2015
a8ab28f
Add tracking code.
martindale Aug 21, 2015
e63b2f7
Fix button on login.
martindale Aug 23, 2015
4fbdfd6
Merge branch 'master' into better-splash
martindale Aug 24, 2015
a9993d1
Add images, better text to the examples page.
martindale Aug 24, 2015
16dc76b
Give bonus points for being open source!
martindale Aug 24, 2015
090a048
Add more examples.
martindale Aug 24, 2015
cd5f6ab
Merge branch 'master' into better-splash
martindale Sep 3, 2015
bc072b5
Add slack to header.
martindale Sep 3, 2015
62ba096
Merge branch 'master' into better-splash
martindale Nov 28, 2015
99b7ede
Add new tutorials.
martindale Nov 30, 2015
f18f79b
Merge pull request #108 from martindale/tutorials
martindale Nov 30, 2015
26bfc15
add missing page template.
martindale Nov 30, 2015
40f4cb1
Merge branch 'better-splash' of github.com:martindale/maki into bette…
martindale Nov 30, 2015
fefecb2
Fix some formatting issues with code blocks.
martindale Nov 30, 2015
6bba149
Add metadata to `hello-world` tutorial.
martindale Nov 30, 2015
c19c6f4
Begin to add headers to each page.
martindale Nov 30, 2015
59478ed
Add latest `maki-cms-local`.
martindale Nov 30, 2015
45dfc04
Modularize the self-edit code.
martindale Nov 30, 2015
170c0ee
Add metadata to all tutorials, update nodemon config.
martindale Nov 30, 2015
e6708cf
Add missing tooltip.
martindale Nov 30, 2015
c7d5c0f
Add better instructions to initial setup.
martindale Dec 27, 2015
432041c
Phrasing, button sizing.
martindale Dec 27, 2015
d8c91ae
Improve documentation, change front-page link.
martindale Jan 2, 2016
aae3d4d
Add components docs.
martindale Jan 2, 2016
7cfd6b2
Update link structure.
martindale Jan 2, 2016
e3bb6e1
Add new /developers page.
martindale Jan 3, 2016
96375a0
Move getting-involved around.
martindale Jan 3, 2016
9c3860b
Add link to getting involved.
martindale Jan 3, 2016
e5e8a70
Initial working prototype for components.
martindale Jan 31, 2016
6c68179
Working Polymer components.
martindale Feb 1, 2016
5a8f774
Add page.jade
martindale Feb 4, 2016
56ab44d
Merge branch 'better-splash' into polymer-port
martindale Feb 4, 2016
06c27a4
Consolidate all work into Components.
martindale Feb 5, 2016
6a198fd
Bump version number.
martindale Feb 5, 2016
b28010f
Uglify Page.js
martindale Feb 5, 2016
69ae21e
Fix tests for now working plugins. :)
martindale Feb 5, 2016
df4efa2
Working messaging with server.
martindale Feb 6, 2016
5444312
Add client-side datastore.
martindale Feb 7, 2016
10955ba
Add missing index component.
martindale Feb 7, 2016
31ce1a8
Consolidate various scripts, stylings.
martindale Feb 7, 2016
431f4f0
Consolidate various components.
martindale Feb 8, 2016
9ff99b0
Enable support for custom indices.
martindale Feb 9, 2016
a8e6903
Improve component-ization, add support for Resource creation in plugins.
martindale Feb 10, 2016
548aaaa
Add splash file.
martindale Feb 10, 2016
3b4884c
Add all changes from melody prototyping.
martindale Feb 24, 2016
3aae398
Merge pull request #116 from martindale/melody
martindale Feb 24, 2016
6b15189
Update and internalize changes from martindale/melody#9.
martindale Feb 25, 2016
d8fcd82
Remove "internal" attribute from Index.
martindale Feb 25, 2016
2ca65eb
Make single component URLs function correctly for deployed applications.
martindale Mar 14, 2016
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
4 changes: 4 additions & 0 deletions .nodemonignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
public/* # static files
#/views/*
data/*
docs/*
examples/*
node_modules/*
8 changes: 8 additions & 0 deletions components/404.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dom-module#maki-undefined
template
.ui.container
h1 Not Found
script.
Polymer({
is: 'maki-undefined'
});
166 changes: 166 additions & 0 deletions components/application.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
dom-module#maki-application
style.
#navigation {
width: 100%;
}

template
maki-datastore(name="#{config.service.namespace}")
maki-channel(autoconnect, reconnect="true")

.pusher
.ui.inverted.vertical.center.aligned.segment
.ui.container
maki-navbar

.content(for="viewport")
maki-index

.ui.inverted.vertical.footer.segment
.ui.container
.ui.stackable.inverted.divided.equal.height.stackable.grid
.six.wide.column
h4.ui.inverted.header About
p This website is powered by Maki, a full-stack framework that implements strong-typing at the network level. You can see and engage with <a href="/api">the auto-generated API</a> to learn more.
p Maki is a labor of love, a result of several years of iterations and re-architectures in pursuit of a clean, hand-rolled framework for building clean, useful applications. We hope you like it.
//-.ui.inverted.link.list
a.item(href="#") Protocol
a.item(href="#") Whitepaper
a.item(href="#") Roadmap
a.item(href="#") Contact Us
.seven.wide.column
h4.ui.inverted.header Copyleft
p #{config.service.name} has not supplied a LICENSE file in <code>config/index.json</code>.
p Maki is copyleft, and encourages you to copy, clone, and <em>create</em>. After all, without a rich public domain, how else can we innovate? Much to our chagrin, the software itself is more formally <a href="https://github.com/martindale/maki/blob/master/LICENSE">MIT licensed</a>, while our content is licensed under <a href="http://creativecommons.org/licenses/by/4.0/">CC-BY</a>.
.three.wide.column
h4.ui.inverted.header Elsewhere
.ui.inverted.link.list
a.item(href="https://github.com/martindale/maki", rel="me")
i.icon.github
| GitHub
a.item(href="https://twitter.com/martindale", rel="me")
i.icon.twitter
| Twitter
a.item(href="https://facebook.com/eric.martindale", rel="me")
i.icon.facebook
| Facebook
//-a.item(href="#", rel="me")
i.icon.medium
| Medium

script(src="/js/page.min.js")
script(src="/js/jquery.js")
script.
window.maki = Polymer({
is: 'maki-application',
properties: {
src: {
type: String
},
for: {
type: String
},
route: {
type: String
},
routes: {
type: Object,
value: {}
},
components: {
type: Object,
value: {}
},
resources: {
type: Object,
observer: '_resourcesUpdated'
},
datastore: {
type: Object
},
worker: { type: Object }
},
_route: function(ctx) {
var self = this;

var component = 'maki-undefined';
for (var route in self.routes) {
var regex = self.routes[route];
var viewport = document.querySelectorAll('[for=viewport]')[0];

console.log('[MAKI:APPLICATION]', 'testing', regex, 'against', ctx.path);

if (regex.test(ctx.path)) {
console.log('[MAKI:APPLICATION]', 'picking', route, 'from', ctx.path);
component = self.components[route];
view = document.createElement(component);
view.type = self.resourceMap[route];
view.type.route = route;
break;
}
}

console.log('[MAKI:APPLICATION]', 'settled on rendering:', view.type.route, view);
//console.log('[MAKI:APPLICATION]', 'type.static:', view.type.static);
//console.log('[MAKI:APPLICATION]', 'setting and appending...');

view.setAttribute('src', ctx.path);

while (viewport.hasChildNodes()) {
viewport.removeChild(viewport.lastChild);
}
viewport.appendChild(view);
},
_resourcesUpdated: function(resources) {
var self = this;
var _route = self._route.bind(self);

self.resourceMap = {};

console.log('[MAKI:APPLICATION]', '_resourcesUpdated', resources);

var order = ['Person', 'Post', 'Index'];
Object.keys(resources).forEach(function(name) {
var resource = resources[name];
console.log('[MAKI:APPLICATION]', 'initializing', name);
['get', 'query'].forEach(function(action) {
console.log('[MAKI:APPLICATION]', 'looking for', action, 'in', resource.routes);
var route = resource.routes[action];
if (!route) return;

console.log('[MAKI:APPLICATION]', 'components are:', resource.components);

self.routes[route] = new RegExp(eval(resource.paths[action]));
self.components[route] = resource.components[action];
self.resourceMap[route] = resource;
page(route, _route);
});
});

self.routes['/'] = new RegExp(/^\/$/);
self.components['/'] = (resources.Index && resources.Index.components) ? resources.Index.components.query : 'maki-index';

page('/', _route);
page('*', _route);

page();
},
created: function() {
var self = this;

self.route = window.location.pathname;
//self.worker = new Worker('/worker.js');

$.ajax({
type: 'OPTIONS',
url: '/',
headers: {
'Accept': 'application/json'
},
success: function(data) {
self.config = data.config;
self.resources = data.resources;
}
});
}
});
113 changes: 113 additions & 0 deletions components/channel.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
dom-module#maki-channel
script(src="/js/uuid.js")
script(src="/js/jsonrpc.js")
script.
Polymer({
is: 'maki-channel',
properties: {
autoconnect: {
type: Boolean
},
reconnect: {
type: Boolean
},
subscriptions: {
type: Array
},
ws: {
type: Object
},
src: {
type: String
},
},
ready: function() {
var self = this;
console.log('[MAKI:CHANNEL]', 'ready');
if (self.autoconnect === true) {
self._connect();
}
},
_send: function(method, params) {
var self = this;
self.ws.send(JSON.stringify({
'jsonrpc': '2.0',
'method': method,
'params': params,
'id': uuid.v4() // TODO: sequence?
}));
},
_subscribe: function(path) {
console.log('[MAKI:CHANNEL]', 'subscribing to:', path);
var self = this;
self._send('subscribe', {
channel: path
});
},
_consume: function() {
var self = this;
var elements = document.querySelectorAll('[src]');

console.log('[MAKI:CHANNEL]', '_consume', elements);

for (var i = 0; i < elements.length; i++) {
var element = elements[i];
self._subscribe(element.src);
}
},
_connect: function() {
var self = this;
var maki = document.querySelectorAll('maki-application')[0];
var protocol = (document.location.protocol === 'http:') ? 'ws://' : 'wss://';
var path = protocol + document.location.host; // + self.src;

console.log('[MAKI:CHANNEL]', 'websocket connecting to: ', path);

self.ws = new WebSocket(path);
self.ws.onclose = function onClose() {
if (self.reconnect === true) {
setTimeout(function() {
self._connect();
}, 500);
}
}
self.ws.onmessage = function onMessage(msg) {
try {
var data = JSON.parse( msg.data );
} catch (e) {
var data = {};
}
// experimental JSON-RPC implementation
if (data.jsonrpc === '2.0') {
switch (data.method) {
case 'ping':
console.log('[MAKI:CHANNEL]', 'received ping. playing pong...');
self.ws.send(JSON.stringify({
'jsonrpc': '2.0',
'result': 'pong',
'id': data.id
}));
break;
case 'patch':
// TODO: update in-memory data (two-way binding);
console.log('[MAKI:CHANNEL]', 'received `patch` event:', data.params.channel , data );
var channel = data.params.channel;
var ops = data.params.ops;
var datastore = document.querySelectorAll('maki-datastore')[0];

datastore._patch(channel, ops);

break;
default:
console.error('[MAKI:CHANNEL]', 'unhandled jsonrpc method ' , data.method);
break;
}
} else {

}
}
self.ws.onopen = function onOpen() {
console.log('[MAKI:CHANNEL]', 'websocket open.');
}
},
});
91 changes: 91 additions & 0 deletions components/collection.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
dom-module#maki-collection
template
.ui.vertical.segment
.ui.container
h2
//-template(if$="{{type.options.icon}}")
i(class$="ui icon {{type.options.icon}}")
a(href="/{{type.names.query}}") {{type.plural}}
p {{type.description}}
code
pre {{resource}}

.ui.five.cards
template(is="dom-repeat", items="{{items}}")
.ui.card
template(if="{{item.image}}")
.image
img(src="/img/maki-logo.png")
.content
a.header(href="/{{type.names.query}}/{{item.slug}}") {{item.name}} {{item.username}}
p.description {{item.description}}
template(if="{{item.action}}")
a.ui.bottom.attached.button(if="{{item.action}}", href="{{item.action.href}}") {{item.action.text}}
//-maki-item(src="/people/{{item.id}}", item="{{item}}")

script.
Polymer({
is: 'maki-collection',
listeners: {
'datastore:query': '_handleQuery',
'state:change': '_applyState'
},
properties: {
src: {
type: String,
observer: '_sourceChanged'
},
type: {
type: Object
},
items: {
type: Array,
notify: true
},
},
_handleQuery: function(e, key) {
var self = this;
var datastore = document.querySelectorAll('maki-datastore')[0];
console.log('[MAKI:COLLECTION]','_handleQuery:', e, key);
datastore._retrieve(key, function(err, data) {
if (!data) self.fire('datastore:miss', hash);
if (err) {
console.error('_handleQuery error:', err);
data = [];
}
self.fire('state:change', data);
});
},
_applyState: function(e) {
var self = this;
var state = e.detail;

if (!(state instanceof Array)) {
state = [state];
}

self.items = state;
},
_sourceChanged: function(source) {
var self = this;
var maki = document.querySelectorAll('maki-application')[0];
console.log('[MAKI:COLLECTION]', 'collection sourceChanged:', source);
//self.resource = maki.resourceMap[source];
self.fire('datastore:query', source);
},
_sync: function() {
var self = this;
console.log('[MAKI:COLLECTION]', '_sync');
self.fire('datastore:query', self.src);
},
ready: function() {
var self = this;
console.log('[MAKI:COLLECTION]', 'ready');
},
attached: function() {
var self = this;
var channel = document.querySelectorAll('maki-channel')[0];
console.log('[MAKI:COLLECTION]', 'collection is attached:', self.src);
channel._subscribe(self.src);
}
});
Loading