Skip to content

Instantly share code, notes, and snippets.

View simonmorley's full-sized avatar

Simon Morley simonmorley

  • London
View GitHub Profile
var template =
'html {' +
'\tbackground: url({{ splash.background_image_name }}) no-repeat center center fixed;\n' +
'\t-webkit-background-size: cover;\n' +
'\t-moz-background-size: cover;\n' +
'\t-o-background-size: cover;\n'+
'\tbackground-size: cover;\n'+
'\tbackground-color: {{splash.background_image_name ? \'transparent\' : splash.body_background_colour}}!important;\n'+
'}\n\n'+
@simonmorley
simonmorley / gist:5b8a05ae8c3887233797
Created January 20, 2015 12:37
Medium, creating a login page. Index
<div ng-controller="LoginsController">
<div ng-show="loading == true" ng-cloak>
<div ng-include="'components/layouts/loading.html'"></div>
</div>
<div ng-hide="loading">
<div class='container'>
<div class='splash-container'>
<div ng-hide="false" ng-cloak>
<div class='row'>
<div class='small-12 columns'>
@simonmorley
simonmorley / gist:48c5c32990eacb0106b4
Last active August 29, 2015 14:13
Medium, creating a login page. Form directive.
app.directive('formCode', ['$routeParams', '$location', 'Login', '$compile', '$localStorage', function($routeParams, $location, Login, $compile, $localStorage) {
var link = function(scope,element,attrs) {
scope.submit = function() {
alert(scope.password);
};
scope.letsShop = function() {
var myObj = $location.search();
@simonmorley
simonmorley / gist:7d49013aef542b474586
Created January 20, 2015 12:57
Medium, creating a login page. Inner html
<div id='container-c1' ng-class="splash.design_id === 2 ? 'small-12 medium-6 columns' : 'skinny-c1'">
<h1>{{ splash.header_text }}</h1>
<h2>{{ splash.info }}</h2>
<p>{{ splash.address }}</p>
<div class="social">
<a ng-show="splash.twitter_name" href="https://twitter.com/{{splash.twitter_name}}"><img src="https://d3e9l1phmgx8f2.cloudfront.net/images/social/twitter.svg" width='32px'></a>
<a ng-show="splash.google_name" href="https://plus.google.com/{{splash.google_name}}/about"><img src="https://d3e9l1phmgx8f2.cloudfront.net/images/social/google.svg" width='32px'></a>
<a ng-show="splash.facebook_name" href="http://facebook.com/{{splash.facebook_name}}"><img src="https://d3e9l1phmgx8f2.cloudfront.net/images/social/facebook.svg" width='32px'></a>
<a ng-show="splash.pinterest_name" href="http://pinterest.com/{{splash.pinterest_name}}"><img src="https://d3e9l1phmgx8f2.cloudfront.net/images/social/pinterest.svg" width='32px'></a>
<a ng-show="splash.instagram_name" href="http://instagram.c
@simonmorley
simonmorley / gist:dae7ba49486aca34ab1a
Last active August 29, 2015 14:13
medium creating a splash page, coova service
'use strict';
var app = angular.module('ctLoginsApp.coova.services', ['ngResource']);
app.factory('Coova', ['$resource',
function($resource){
return $resource( 'http://:uamip::uamport' + '/json/status?',
{ callback: 'JSON_CALLBACK' },
@simonmorley
simonmorley / gist:690912f90cffdaa45ab7
Last active August 29, 2015 14:13
medium, creating a splash pages, coova check in forms directive
app.directive('formCode', ['$routeParams', '$location', 'Login', '$compile', '$localStorage', 'Coova', function($routeParams, $location, Login, $compile, $localStorage, Coova) {
var link = function(scope,element,attrs) {
scope.submit = function() {
// Do Stuff
};
var checkStatus = function() {
scope.coova = {};
@simonmorley
simonmorley / gist:bbe890c3633a691c70ef
Last active August 29, 2015 14:13
medium, creating a splash page, create login response
{
"location_id" : "2343279843255694423",
"splash_id": 13,
"username": "08187543-7846-41ad-81af-6f9f588ffdd9@2343279843255694423",
"challengeResp": "52c644e564b7826ab0daa5fb34a45f3d"
}
@simonmorley
simonmorley / gist:6fc31a58cc030f2de560
Created January 20, 2015 20:03
medium, creating a splash page, create login service
'use strict';
var app = angular.module('ctLoginsApp.tony.services', ['ngResource']);
app.factory('Tony', ['$resource', 'API_END_POINT',
function($resource, API_END_POINT){
return $resource(API_END_POINT + '/logins',
{},
@simonmorley
simonmorley / gist:c0ec61311adb334f84ad
Last active August 29, 2015 14:13
medium, creating a splash page, create login for user
scope.submit = function() {
Coova.status({uamip: $routeParams.uamip, uamport: $routeParams.uamport}).$promise.then(function(res) {
scope.status = resp.status;
if (scope.status === 0) {
var challenge = resp.challenge;
doLogin(scope.username, scope.password, challenge);
} else {
// fail login, user online //
}
@simonmorley
simonmorley / gist:d04c6cf1635acd17c122
Created January 20, 2015 22:35
medium, creating a splash page, coova response
{
"version": "1.0",
"clientState": 0,
"challenge": "4ce71fa9eb8cd48e00f29c00a83ebede",
"location": {
"name": "S*** Got Real"
},
"redir": {
"originalURL": "http://www.bbc.co.uk/",
"redirectionURL": "",