Skip to content

Commit

Permalink
Added first template files
Browse files Browse the repository at this point in the history
  • Loading branch information
coopsatwork committed Sep 20, 2018
1 parent 05f4b14 commit c7d0168
Show file tree
Hide file tree
Showing 22 changed files with 694 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
# LiveProjectsTemplate
This is a template, which lays out a structure for a main project. It can be used by any team working on an MMU LiveProject.

**NOTE**: Your live projects are PUBLIC, on both GitHub and Trello meaning anyone can see the data in them.

To keep you and your client safe, here are some ground rules:

* **NO authentication data:**
* usernames, passwords
* shared secrets
* tokens
* **NO real names**
* no personally attributable data of any sort

##Contents

### Folders

####docs

Holds live wireframes for the project.

(Can also be used to hold the published code, if deploying a single project to GitHub Pages).

####documentation

Holds documentation for the project. See folder for details

####code

Holds the code for the project (if only one github project is required for the product).

####investigations

Example code, and helpful snippets

### Sub Projects

Link to your sub-projects here. Clone the [sub-project repo](https://github.com/CMDT/LiveProjectsSubProject) for each one.

###Trello

Link to your Trello boards here:

* Overview
* Discussions
* Investigations
* Implementations
* Features
* sub-feature (if needed)
* ...
* Design
* component (if needed)
* ...
* Tasks
* Plan

Binary file added docs/Resources/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Resources/images/icon_114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Resources/images/icon_144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Resources/images/icon_57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Resources/images/icon_72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
176 changes: 176 additions & 0 deletions docs/Resources/lib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
// $alt.js
(function(g, document) {

// Alternative DOM Wrapper
function AlternativeDomWrapper( elements ) {
if ( typeof elements.length === 'undefined' )
this.elements = [elements];
else
this.elements = elements;
}

// applies the given function to each of the childern
AlternativeDomWrapper.prototype.each = function each(fn, thisArg) {
var i = 0,
z = this.elements.length;

for (; i < z; i++) {
fn.call(thisArg || this.elements[i], this.elements[i], i);
}
return this;
};


// based on salt.js | https://github.com/james2doyle/saltjs
/*! Salt.js DOM Selector Lib. By @james2doyle */
function salt( selector, context ) {
if ( typeof context === 'undefined' ) context = document;

// an object containing the matching keys and native get commands
var matches = {
'#': 'getElementById',
'.': 'getElementsByClassName',
'@': 'getElementsByName',
'=': 'getElementsByTagName',
'*': 'querySelectorAll'
}[selector[0]]; // you can treat a string as an array of characters

// now pass the target without the key
return (context[matches](selector.slice(1)));
}


// public API
function $alt( document, engine, wrapper ) {

if ( typeof document === 'undefined' )
throw new Error('document is required');

if ( typeof engine === 'undefined' )
engine = salt;

if ( typeof wrapper === 'undefined' )
wrapper = AlternativeDomWrapper;

function api( what, context ) {
if ( typeof context === 'undefined' ) context = document;

// handle $(element) || $(object)
if (typeof what === 'object') {
if ( wrapper !== null ) return new wrapper( what );
else return what;
}

// handle $(fn)
if (typeof what === 'function') {
/c/.test(context.readyState) ? what() : context.addEventListener('DOMContentLoaded', what)
return this;
}

if ( wrapper !== null ) return new wrapper( engine(what, context) );
else return engine(what, context);
}

// augments the wrapper by attaching the given extensions to it's prototype
function extendWrapper( extensions, force ) {
for( name in extensions ) {
x = extensions[name];
if ( extensions.hasOwnProperty(name)
&& typeof x !== 'undefined'
&& ( !wrapper.prototype.hasOwnProperty(name) || force) ) {
wrapper.prototype[name] = x;
}
else
throw new Error('wrapper already has ' + name + ' defined');
}
}

// enable wrapper extensions
api.fn = wrapper.prototype;
api.xfn = extendWrapper;

return api;
}

$alt.AlternativeDomWrapper = AlternativeDomWrapper;

// exports
g.$alt = $alt;

}(this, document));


// $alt-basics.js
var $ = $alt( document );

$.xfn({
// dom
attr: function( name, value ) {
if ( typeof value !== 'undefined' ) {
this.each( function( el ) { el.setAttribute(name, value); });
} else {
return this.elements[0].getAttribute(name);
}
return this;
},

// events
on: function( type, listener, capture) {
return this.each( function( el ) {
el.addEventListener( type, listener, capture );
});
},

off: function( type, listener) {
return this.each( function( el ) {
el.removeEventListener( type, listener, capture );
});
},

// styling
css: function( prop, value ) {
if ( typeof value !== 'undefined' ) {
this.each( function( el ) { el.style[prop] = value; });
} else {
return this.elements[0].style[prop];
}
return this;
},

addClass: function( c ) {
return this.each( function( el ) { el.classList.add( c ); });
},

removeClass: function( c ) {
return this.each( function( el ) { el.classList.remove( c ); });
},

hasClass: function( c ) {
var i = 0,
z = this.elements.length;

for (; i < z; i++) {
if ( this.elements[i].classList.contains( c ) ) return true;
}
return false;
},

// visibility
hide: function() {
return this.css('display', 'none');
},

show: function() {
return this.css('display', '');
}
});


// cookie.min.js
// https://github.com/js-coder/cookie.js
// Copyright (c) 2012 Florian H.
!function(e,t){var n=function(){return n.get.apply(n,arguments)},r=n.utils={isArray:Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},isPlainObject:function(e){return!!e&&Object.prototype.toString.call(e)==="[object Object]"},toArray:function(e){return Array.prototype.slice.call(e)},getKeys:Object.keys||function(e){var t=[],n="";for(n in e)e.hasOwnProperty(n)&&t.push(n);return t},escape:function(e){return String(e).replace(/[,;"\\=\s%]/g,function(e){return encodeURIComponent(e)})},retrieve:function(e,t){return e==null?t:e}};n.defaults={},n.expiresMultiplier=86400,n.set=function(n,i,s){if(r.isPlainObject(n))for(var o in n)n.hasOwnProperty(o)&&this.set(o,n[o],i);else{s=r.isPlainObject(s)?s:{expires:s};var u=s.expires!==t?s.expires:this.defaults.expires||"",a=typeof u;a==="string"&&u!==""?u=new Date(u):a==="number"&&(u=new Date(+(new Date)+1e3*this.expiresMultiplier*u)),u!==""&&"toGMTString"in u&&(u=";expires="+u.toGMTString());var f=s.path||this.defaults.path;f=f?";path="+f:"";var l=s.domain||this.defaults.domain;l=l?";domain="+l:"";var c=s.secure||this.defaults.secure?";secure":"";e.cookie=r.escape(n)+"="+r.escape(i)+u+f+l+c}return this},n.remove=function(e){e=r.isArray(e)?e:r.toArray(arguments);for(var t=0,n=e.length;t<n;t++)this.set(e[t],"",-1);return this},n.empty=function(){return this.remove(r.getKeys(this.all()))},n.get=function(e,n){n=n||t;var i=this.all();if(r.isArray(e)){var s={};for(var o=0,u=e.length;o<u;o++){var a=e[o];s[a]=r.retrieve(i[a],n)}return s}return r.retrieve(i[e],n)},n.all=function(){if(e.cookie==="")return{};var t=e.cookie.split("; "),n={};for(var r=0,i=t.length;r<i;r++){var s=t[r].split("=");n[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return n},n.enabled=function(){if(navigator.cookieEnabled)return!0;var e=n.set("_","_").get("_")==="_";return n.remove("_"),e},typeof define=="function"&&define.amd?define(function(){return n}):typeof exports!="undefined"?exports.cookie=n:window.cookie=n}(document);

// path.min.js
var Path={version:"0.8.4",map:function(a){if(Path.routes.defined.hasOwnProperty(a)){return Path.routes.defined[a]}else{return new Path.core.route(a)}},root:function(a){Path.routes.root=a},rescue:function(a){Path.routes.rescue=a},history:{initial:{},pushState:function(a,b,c){if(Path.history.supported){if(Path.dispatch(c)){history.pushState(a,b,c)}}else{if(Path.history.fallback){window.location.hash="#"+c}}},popState:function(a){var b=!Path.history.initial.popped&&location.href==Path.history.initial.URL;Path.history.initial.popped=true;if(b)return;Path.dispatch(document.location.pathname)},listen:function(a){Path.history.supported=!!(window.history&&window.history.pushState);Path.history.fallback=a;if(Path.history.supported){Path.history.initial.popped="state"in window.history,Path.history.initial.URL=location.href;window.onpopstate=Path.history.popState}else{if(Path.history.fallback){for(route in Path.routes.defined){if(route.charAt(0)!="#"){Path.routes.defined["#"+route]=Path.routes.defined[route];Path.routes.defined["#"+route].path="#"+route}}Path.listen()}}}},match:function(a,b){var c={},d=null,e,f,g,h,i;for(d in Path.routes.defined){if(d!==null&&d!==undefined){d=Path.routes.defined[d];e=d.partition();for(h=0;h<e.length;h++){f=e[h];i=a;if(f.search(/:/)>0){for(g=0;g<f.split("/").length;g++){if(g<i.split("/").length&&f.split("/")[g].charAt(0)===":"){c[f.split("/")[g].replace(/:/,"")]=i.split("/")[g];i=i.replace(i.split("/")[g],f.split("/")[g])}}}if(f===i){if(b){d.params=c}return d}}}}return null},dispatch:function(a){var b,c;if(Path.routes.current!==a){Path.routes.previous=Path.routes.current;Path.routes.current=a;c=Path.match(a,true);if(Path.routes.previous){b=Path.match(Path.routes.previous);if(b!==null&&b.do_exit!==null){b.do_exit()}}if(c!==null){c.run();return true}else{if(Path.routes.rescue!==null){Path.routes.rescue()}}}},listen:function(){var a=function(){Path.dispatch(location.hash)};if(location.hash===""){if(Path.routes.root!==null){location.hash=Path.routes.root}}if("onhashchange"in window&&(!document.documentMode||document.documentMode>=8)){window.onhashchange=a}else{setInterval(a,50)}if(location.hash!==""){Path.dispatch(location.hash)}},core:{route:function(a){this.path=a;this.action=null;this.do_enter=[];this.do_exit=null;this.params={};Path.routes.defined[a]=this}},routes:{current:null,root:null,rescue:null,previous:null,defined:{}}};Path.core.route.prototype={to:function(a){this.action=a;return this},enter:function(a){if(a instanceof Array){this.do_enter=this.do_enter.concat(a)}else{this.do_enter.push(a)}return this},exit:function(a){this.do_exit=a;return this},partition:function(){var a=[],b=[],c=/\(([^}]+?)\)/g,d,e;while(d=c.exec(this.path)){a.push(d[1])}b.push(this.path.split("(")[0]);for(e=0;e<a.length;e++){b.push(b[b.length-1]+a[e])}return b},run:function(){var a=false,b,c,d;if(Path.routes.defined[this.path].hasOwnProperty("do_enter")){if(Path.routes.defined[this.path].do_enter.length>0){for(b=0;b<Path.routes.defined[this.path].do_enter.length;b++){c=Path.routes.defined[this.path].do_enter[b]();if(c===false){a=true;break}}}}if(!a){Path.routes.defined[this.path].action()}}};

37 changes: 37 additions & 0 deletions docs/Resources/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
(function() {
var pinned = false;

function closeNotes() {
var notes = $('.notes');
if (notes.hasClass('pinned')) {
notes.removeClass('visible');
notes.removeClass('pinned');
} else {
$(this.parentElement).removeClass('visible');
}
}

function openNotes() {
$(this.parentElement).addClass('visible');
}

function pinNotes() {
var notes = $('.notes');
notes.addClass('visible');
notes.addClass('pinned');
}

$('.open').on('click', openNotes);
$('.close').on('click', closeNotes);
$('.pin').on('click', pinNotes);

Path.map("#/page/:page_id").to(function(){
var page_id = this.params['page_id'];
$('.page').hide();
$('#'+page_id).show();
});

Path.root("#/page/start");

Path.listen();
}());
103 changes: 103 additions & 0 deletions docs/Resources/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
html, body {
margin: 0;
padding: 0;
}
body {
overflow: hidden;
font-family: Verdana;
font-size: 0.9em;
}
.page {
margin: 0;
padding: 0;
width: 100%;
overflow: hidden;
}
.notes {
background-color: #111;
position: fixed;
box-sizing:border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
width: 48%;
height: 100%;
opacity: 0.9;
color: #fff;
padding: 0;
margin: 0;
top: 0;
left: 100%;
-webkit-transition: left 0.4s;
transition: left 0.4s;
}
.notes .control {
position: absolute;
width: 2em;
height: 2em;
color: #333;
background-color: #777;
opacity: 0.8;
font-size: 1em;
font-weight: bold;
cursor: pointer;
text-align: center;
vertical-align: bottom;
line-height: 2em;
border-radius: 1em;
}

.notes .control.open {
display: block;
top: 0.5em;
left: -2.5em;
}
.notes .control.close {
position: fixed;
display: none;
top: 0.5em;
right: 0.5em;
}
.notes .control.pin {
position: fixed;
display: none;
top: 0.5em;
right: 2.8em;
}
.notes .content {
margin: 2.5em 0 0 0;
padding: 0.5em;
box-sizing:border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
overflow: auto;
width: 100%;
height: 100%;
}
.notes.visible {
left: 52%;
-webkit-transition: left 0.4s;
transition: left 0.4s;
}
.notes.visible .control.open {
display: none;
}
.notes.visible .control.close {
display: block;
}
.notes.visible .control.pin {
display: block;
}

@media screen and (max-width: 600px) {
.notes.visible {
width: 50%;
left: 50%;
}
}
@media screen and (max-width: 480px) {
.notes.visible {
width: 100%;
left: 0
}
}

Binary file added docs/favicon.ico
Binary file not shown.
6 changes: 6 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:p="http://www.evolus.vn/Namespace/Pencil" xmlns:html="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>wireframe</title><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="translucent black" /><link rel="apple-touch-icon-precomposed" href="Resources/images/icon_57x57.png" /><link rel="apple-touch-icon-precomposed" sizes="72x72" href="Resources/images/icon_72x72.png" /><link rel="apple-touch-icon-precomposed" sizes="114x114" href="Resources/images/icon_114x114.png" /><link rel="apple-touch-icon-precomposed" sizes="144x144" href="Resources/images/icon_144x144.png" /><link rel="icon" type="image/png" href="Resources/images/favicon.png" /><link rel="stylesheet" type="text/css" href="Resources/style.css" /><script type="text/javascript" src="Resources/lib.js">
//
</script></head><body><div class="page" id="background"><img src="pages/background.png" width="496" height="898" usemap="#map_background" /><map name="map_background"></map></div><div class="page" id="start"><img src="pages/start.png" width="496" height="898" usemap="#map_start" /><map name="map_start"></map></div><script type="text/javascript" src="Resources/main.js">
//
</script></body></html>
Binary file added docs/pages/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c7d0168

Please sign in to comment.