This repository has been archived by the owner on Aug 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
377 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
doctype html | ||
html | ||
head | ||
title Phoenix: Messenger Color Changer | ||
// Stylesheets | ||
link(rel='stylesheet', href='css/colorchanger.styl') | ||
link(rel='stylesheet', href='../bower_components/photon/dist/css/photon.min.css') | ||
link(rel='stylesheet', href='../node_modules/simple-color-picker/src/simple-color-picker.css') | ||
script(src='../bower_components/angular/angular.min.js') | ||
script(src='js/phoenix.coffee') | ||
body(ng-app='phoenix') | ||
// Login screen | ||
.window.login-screen(ng-if='!api') | ||
img.logo(src='img/facebook-messenger.svg', width='150px', height='150px') | ||
h1 Phoenix | ||
.info {{ login_info }} | ||
br | ||
form.login-form | ||
.form-group | ||
label(for='username') Facebook login or phone number | ||
input#username.username.form-control(type='text') | ||
.form-group | ||
label(for='password') Facebook password | ||
input#password.password.form-control(type='password') | ||
input.login-button.btn.btn-large.btn-warning(type='submit', value='Continue', ng-disabled='submitted') | ||
p.grey-text Use at your own risk, we are not responsible for the account lockout. | ||
p.grey-text We do not send your data to the NSA ;) (facebook does) | ||
// Color changer | ||
.window.colorchanger(ng-if='!!api') | ||
.window-content | ||
.pane-group | ||
.pane.pane-sm.sidebar | ||
ul.list-group.conversations | ||
li.list-group-item.conversation(ng-repeat='thread in contacts', id='{{ thread.id }}', ng-class='{active: active.id == thread.id}') | ||
img.img-circle.media-object.pull-left(ng-src='{{thread.image}}', alt='') | ||
.color(ng-style='{ background: thread.color }') | ||
.media-body | ||
strong {{ thread.name }} | ||
.pane.colorpicker-holder | ||
.kot(ng-style='{ background: (thread(active.id)||{}).newColor || (thread(active.id)||{}).color }') | ||
.colorpicker(ng-if='!!active') | ||
.predefined-colors | ||
.color-block(ng-repeat="color in predefinedColors" ng-style='{backgroundColor: color}') | ||
.buttons | ||
button.btn.btn-large.btn-warning.change-button Change color | ||
|
||
doctype html | ||
html | ||
head | ||
title Phoenix: Messenger Color Changer | ||
// Stylesheets | ||
link(rel='stylesheet', href='css/colorchanger.styl') | ||
link(rel='stylesheet', href='../bower_components/photon/dist/css/photon.min.css') | ||
link(rel='stylesheet', href='../node_modules/simple-color-picker/src/simple-color-picker.css') | ||
script(src='../bower_components/angular/angular.min.js') | ||
script(src='js/phoenix.coffee') | ||
body(ng-app='phoenix') | ||
// Login screen | ||
.window.login-screen(ng-if='!api') | ||
img.logo(src='img/facebook-messenger.svg', width='150px', height='150px') | ||
h1 Phoenix | ||
.info {{ login_info }} | ||
br | ||
form.login-form | ||
.form-group | ||
label(for='username') Facebook login or phone number | ||
input#username.username.form-control(type='text') | ||
.form-group | ||
label(for='password') Facebook password | ||
input#password.password.form-control(type='password') | ||
input.login-button.btn.btn-large.btn-warning(type='submit', value='Continue', ng-disabled='submitted') | ||
p.grey-text Use at your own risk, we are not responsible for the account lockout. | ||
p.grey-text We do not send your data to the NSA ;) (facebook does) | ||
// Color changer | ||
.window.colorchanger(ng-if='!!api') | ||
.window-content | ||
.pane-group | ||
.pane.pane-sm.sidebar | ||
ul.list-group.conversations | ||
li.list-group-item.conversation(ng-repeat='thread in contacts', id='{{ thread.id }}', ng-class='{active: active.id == thread.id}') | ||
img.img-circle.media-object.pull-left(ng-src='{{thread.image}}', alt='') | ||
.color(ng-style='{ background: thread.color }') | ||
.media-body | ||
strong {{ thread.name }} | ||
.pane.colorpicker-holder | ||
.kot(ng-style='{ background: (thread(active.id)||{}).newColor || (thread(active.id)||{}).color }') | ||
.colorpicker(ng-if='!!active') | ||
.predefined-colors | ||
.color-block(ng-repeat="color in predefinedColors" ng-style='{backgroundColor: color}') | ||
.buttons | ||
button.btn.btn-large.btn-warning.change-button Change color | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
Phoenix.directive 'changeButton', [ | ||
'$rootScope' | ||
'notify' | ||
($root, $notify) -> | ||
restrict: 'C' | ||
link: ($scope, $el,) -> | ||
change = $el[0] | ||
change.on 'click', () -> | ||
id = $scope.active.id | ||
|
||
$root.api.changeThreadColor $root.picker.getHexString(), id, (err) -> | ||
if err? | ||
$notify 'Error changing color...' | ||
return console.error err | ||
debug && console.log id | ||
debug && console.log $root.thread id | ||
$root.thread(id).color = $root.picker.getHexString() | ||
$root.apply() | ||
$notify 'Color changed successfully :D' | ||
] | ||
Phoenix.directive 'changeButton', [ | ||
'$rootScope' | ||
'notify' | ||
($root, $notify) -> | ||
restrict: 'C' | ||
link: ($scope, $el) -> | ||
change = $el[0] | ||
change.on 'click', () -> | ||
id = $scope.active.id | ||
|
||
$root.api.changeThreadColor $root.picker.getHexString(), id, (err) -> | ||
if err? | ||
$notify 'Error changing color...' | ||
return console.error err | ||
debug && console.log id | ||
debug && console.log $root.thread id | ||
$root.thread(id).color = $root.picker.getHexString() | ||
$root.apply() | ||
$notify 'Color changed successfully :D' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Phoenix.directive 'colorBlock', [ | ||
'$rootScope' | ||
($root) -> | ||
restrict: 'C' | ||
link: ($scope, $el) -> | ||
color = $el[0] | ||
color.on 'click', () -> | ||
if $root.active | ||
$root.thread($root.active.id).newColor = @css('background') | ||
$root.picker.setColor @css('background') | ||
$root.apply() | ||
] | ||
Phoenix.directive 'colorBlock', [ | ||
'$rootScope' | ||
($root) -> | ||
restrict: 'C' | ||
link: ($scope, $el) -> | ||
color = $el[0] | ||
color.on 'click', () -> | ||
if $root.active | ||
$root.thread($root.active.id).newColor = @css('background') | ||
$root.picker.setColor @css('background') | ||
$root.apply() | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
ColorPicker = require 'simple-color-picker' | ||
Phoenix.directive 'colorpicker', [ | ||
'$rootScope' | ||
($root) -> | ||
restrict: 'C' | ||
link: ($scope, $el) -> | ||
picker = $el[0] | ||
$root.picker = window.picker = new ColorPicker | ||
color: $root.predefinedColors[0] | ||
el: picker | ||
height: 150 | ||
width: 150 + 25 | ||
background: '#ffffff' | ||
|
||
$root.picker.onChange -> | ||
if $root.active | ||
$root.thread($root.active.id).newColor = $root.picker.getHexString() | ||
$root.apply() | ||
] | ||
ColorPicker = require 'simple-color-picker' | ||
Phoenix.directive 'colorpicker', [ | ||
'$rootScope' | ||
($root) -> | ||
restrict: 'C' | ||
link: ($scope, $el) -> | ||
picker = $el[0] | ||
$root.picker = window.picker = new ColorPicker | ||
color: $root.predefinedColors[0] | ||
el: picker | ||
height: 150 | ||
width: 150 + 25 | ||
background: '#ffffff' | ||
|
||
$root.picker.onChange -> | ||
if $root.active | ||
$root.thread($root.active.id).newColor = $root.picker.getHexString() | ||
$root.apply() | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Phoenix.directive 'conversation', [ | ||
'$rootScope' | ||
($root) -> | ||
restrict: 'C' | ||
link: ($scope, $el) -> | ||
conversation = $el[0] | ||
conversation.on 'click', () -> | ||
$root.thread($root.active.id).newColor = null if $root.active | ||
$root.active = @ | ||
$root.apply() | ||
process.nextTick -> | ||
$root.picker.setColor conversation.q('.color').css 'background' | ||
$root.apply() | ||
] | ||
Phoenix.directive 'conversation', [ | ||
'$rootScope' | ||
($root) -> | ||
restrict: 'C' | ||
link: ($scope, $el) -> | ||
conversation = $el[0] | ||
conversation.on 'click', () -> | ||
$root.thread($root.active.id).newColor = null if $root.active | ||
$root.active = @ | ||
$root.apply() | ||
process.nextTick -> | ||
$root.picker.setColor conversation.q('.color').css 'background' | ||
$root.apply() | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
Phoenix.directive 'form', [ | ||
'$rootScope' | ||
'login' | ||
($root, login) -> | ||
restrict: 'E' | ||
link: ($scope, $el) -> | ||
form = $el[0] | ||
form.on 'submit', (e) -> | ||
e.preventDefault() | ||
login() if $root.submitted == false | ||
] | ||
Phoenix.directive 'form', [ | ||
'$rootScope' | ||
'login' | ||
($root, login) -> | ||
restrict: 'E' | ||
link: ($scope, $el) -> | ||
form = $el[0] | ||
form.on 'submit', (e) -> | ||
e.preventDefault() | ||
login() if $root.submitted == false | ||
] |
Oops, something went wrong.