upgraded docs, fixed cursor show when clickToHide:false, bumped to 0.3.2

This commit is contained in:
Jaime Pillora
2014-06-29 01:02:42 +10:00
parent d5a49073ec
commit 2f88823b00
16 changed files with 296 additions and 127 deletions
+10 -7
View File
@@ -19,21 +19,22 @@ window.BuildController = ($scope,$timeout) ->
}
]
$(".build-tool-loading").hide()
$(".build-tool-toggle").show()
App.buildTool = $scope
$scope.styles = []
$scope.addStyle = (code, premade) ->
$scope.styles.push { active: true, code, premade:premade }
$scope.settings = {
minify: false
default: $scope.styles[0]
default: null
}
$scope.styles = []
$scope.addStyle = (code, premade) ->
style = { active: true, code, premade:premade }
$scope.styles.push style
$scope.settings.default = style unless $scope.settings.default
$scope.loadStyle = ->
style = $scope.premadeStyle
return unless style
@@ -59,7 +60,7 @@ window.BuildController = ($scope,$timeout) ->
#load bootstrap
$scope.premadeStyle = $scope.premadeStyles[0]
$scope.loadStyle
$scope.loadStyle()
#angular has loaded
$scope.toggle = ->
@@ -79,6 +80,8 @@ window.BuildController = ($scope,$timeout) ->
$scope.styles.splice i,1
getStyleName = (style) ->
unless style?.code
return null
m = style.code.match /\$\.notify\.addStyle\('(["\w-]+)'/
unless m
m = style.code.match /\$\.notify\.addStyle\("(['\w-]+)"/
+29 -1
View File
@@ -34,4 +34,32 @@ App.codeRunner = ->
$(document).on('click', '.prettyprint.runnable', runSnippet)
$(".prettyprint.auto-run").each(runSnippet)
$(".prettyprint.auto-add").each(addCSS)
$(".prettyprint.auto-add").each(addCSS)
#show gswg ad
$.notify.addStyle 'gswg',
html: """<div>
<div class="content clearfix">
<div class="cover"></div>
<div class="text">
<div>Read my book:</div>
<div class="title">Getting Started with Grunt: The JavaScript Task Runner</div>
<div>Get the first chapter for free!</div>
<div>
<a target="_blank" href="http://gswg.io">
<button data-notify-text></button>
</a>
<button>No thanks</button>
</div>
</div>
</div>
</div>
"""
$(document).on 'click', '.notifyjs-gswg-base button', ->
$(this).trigger('notify-hide')
$.notify("http://gswg.io", {position:'b r', style: 'gswg', autoHide: false, clickToHide: false})
+27 -1
View File
@@ -15,6 +15,9 @@ b
font-weight: bold
i
font-style: italic !important
input:focus, button
outline none
input[type="radio"],
label[for]
cursor: pointer
@@ -143,7 +146,30 @@ pre.prettyprint
font-family: 'Droid Sans Mono', Courier
height: 215px
.notifyjs-gswg-base
font-family Helvetica, Arial
opacity 0.85
width 325px
background #e48632
padding 15px
border-radius 10px
.content
.cover
float left
background url('http://gswg.io/img/cover2.jpg')
background-size cover
width 105px
height 130px
.text
float left
width 200px
padding-left 15px
padding-top 10px
color white
.title
font-weight bold
button
margin-bottom 2px
//chris coyers clearfix
.clearfix:after
+1 -4
View File
@@ -1,9 +1,6 @@
!!! 5
doctype html
html(lang='en')
dev = env == 'dev'
min = dev ? '' : '.min'
head
meta(charset='utf-8')
title Notify.js