-
Notifications
You must be signed in to change notification settings - Fork 100
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
15 changed files
with
474 additions
and
200 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,15 +1,69 @@ | ||
.cg-notify-message { | ||
position:fixed; | ||
right:10px; | ||
top:-50px; | ||
z-index: 9999; | ||
|
||
font-size:22px; | ||
font-weight: bold; | ||
text-shadow:1px 1px 3px rgba(255,255,255,1),-1px -1px 3px rgba(255,255,255,1),0px 0px 7px white; | ||
|
||
-webkit-transition: top 0.5s ease-out,opacity 0.5s ease-out; | ||
-moz-transition: top 0.5s ease-out,opacity 0.5s ease-out; | ||
-o-transition: top 0.5s ease-out,opacity 0.5s ease-out; | ||
transition: top 0.5s ease-out,opacity 0.5s ease-out; | ||
position:fixed; | ||
left:50%; | ||
top:0px; | ||
z-index: 9999; | ||
max-width:400px; | ||
text-align: center; | ||
|
||
background-color: #d9edf7; | ||
color: #31708f; | ||
padding: 15px; | ||
border: 1px solid #bce8f1; | ||
border-radius: 4px; | ||
|
||
-webkit-transition: top 0.5s ease-out,opacity 0.5s ease-out; | ||
-moz-transition: top 0.5s ease-out,opacity 0.5s ease-out; | ||
-o-transition: top 0.5s ease-out,opacity 0.5s ease-out; | ||
transition: top 0.5s ease-out,opacity 0.5s ease-out; | ||
|
||
visibility:hidden; | ||
} | ||
|
||
.cg-notify-message a { | ||
font-weight:bold; | ||
color:inherit; | ||
} | ||
|
||
.cg-notify-message a:hover { | ||
color:inherit; | ||
} | ||
|
||
.cg-notify-close { | ||
-webkit-appearance: none; | ||
padding: 0; | ||
cursor: pointer; | ||
background: 0 0; | ||
border: 0; | ||
font-size: 21px; | ||
font-weight: 700; | ||
line-height: 1; | ||
color: #000; | ||
text-shadow: 0 1px 0 #fff; | ||
filter: alpha(opacity=20); | ||
opacity: .2; | ||
|
||
position: absolute; | ||
top: 0px; | ||
right: 3px; | ||
line-height: 15px; | ||
} | ||
|
||
.cg-notify-close:hover, .cg-notify-close:focus { | ||
color: #000; | ||
text-decoration: none; | ||
cursor: pointer; | ||
filter: alpha(opacity=50); | ||
opacity: .5; | ||
} | ||
|
||
.cg-notify-sr-only { | ||
position: absolute; | ||
width: 1px; | ||
height: 1px; | ||
padding: 0; | ||
margin: -1px; | ||
overflow: hidden; | ||
clip: rect(0,0,0,0); | ||
border: 0; | ||
} |
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,3 +1,16 @@ | ||
<div class="cg-notify-message"> | ||
{{$message}} | ||
<div class="cg-notify-message" ng-class="$classes"> | ||
|
||
<div ng-show="!$messageTemplate"> | ||
{{$message}} | ||
</div> | ||
|
||
<div ng-show="$messageTemplate" class="cg-notify-message-template"> | ||
|
||
</div> | ||
|
||
<button type="button" class="cg-notify-close" ng-click="$close()"> | ||
<span aria-hidden="true">×</span> | ||
<span class="cg-notify-sr-only">Close</span> | ||
</button> | ||
|
||
</div> |
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 |
---|---|---|
|
@@ -4,12 +4,12 @@ | |
"dist/angular-notify.js", | ||
"dist/angular-notify.css" | ||
], | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"homepage": "https://github.com/cgross/angular-notify", | ||
"authors": [ | ||
"Chris Gross <[email protected]>" | ||
], | ||
"description": "A minimalistic notification service for Angular apps.", | ||
"description": "A minimalistic notification service for Angular.", | ||
"keywords": [ | ||
"angular", | ||
"notify", | ||
|
@@ -31,6 +31,6 @@ | |
"demo" | ||
], | ||
"dependencies": { | ||
"angular": "~1.2.16" | ||
"angular": "~1.2" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,38 +1,38 @@ | ||
|
||
angular.module('app', ['cgNotify']); | ||
|
||
angular.module('app').controller('DemoCtrl',function($scope,notify){ | ||
|
||
$scope.msg1 = $scope.msg2 = $scope.msg3 = "Sample Message"; | ||
|
||
$scope.demo1 = function(){ | ||
notify($scope.msg1); | ||
}; | ||
|
||
$scope.demo2 = function(){ | ||
notify({ | ||
message:$scope.msg2, | ||
template:'gmail-template.html', | ||
position:'center' | ||
}); | ||
}; | ||
$scope.msg = 'Hello! This is a sample message!'; | ||
$scope.template = ''; | ||
|
||
$scope.demo3 = function(){ | ||
$scope.buttons = [ | ||
{ name:'Hello', callback: function(){ alert('Hello'); }}, | ||
{ name:'Bonjour', callback: function(){ alert('Bonjour'); }}, | ||
{ name:'Hola', callback: function(){ alert('Hola'); }} | ||
]; | ||
$scope.demo = function(){ | ||
notify({ | ||
message:$scope.msg3, | ||
template:'another-template.html', | ||
position:'center', | ||
scope:$scope | ||
}); | ||
message: $scope.msg, | ||
classes: $scope.classes, | ||
templateUrl: $scope.template | ||
}); | ||
}; | ||
|
||
$scope.closeAll = function(){ | ||
notify.closeAll(); | ||
}; | ||
|
||
$scope.demoMessageTemplate = function(){ | ||
|
||
var messageTemplate = '<span>This is an example using a dynamically rendered Angular template for the message text. '+ | ||
'I can have <a href="" ng-click="clickedLink()">hyperlinks</a> with ng-click or any valid Angular enhanced html.</span>'; | ||
|
||
notify({ | ||
messageTemplate: messageTemplate, | ||
classes: $scope.classes, | ||
scope:$scope, | ||
templateUrl: $scope.template | ||
}); | ||
|
||
}; | ||
|
||
$scope.clickedLink = function(){ | ||
notify('You clicked a link!'); | ||
}; | ||
|
||
}); |
Oops, something went wrong.