Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
d22e1c43
Commit
d22e1c43
authored
Jul 23, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tabs to editor panels
parent
cc5da00b
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
34 deletions
+70
-34
common/css/bootstrap.dark.min.css
+2
-2
common/css/main.css
+7
-0
common/lib/angular-strap.min.js
+4
-4
js/controllers.js
+5
-0
partials/dasheditor.html
+15
-12
partials/paneleditor.html
+13
-8
partials/querySelect.html
+14
-0
partials/roweditor.html
+10
-8
No files found.
common/css/bootstrap.dark.min.css
View file @
d22e1c43
...
...
@@ -3172,9 +3172,9 @@ table th[class*="span"],
font-size
:
20px
;
font-weight
:
bold
;
line-height
:
21px
;
color
:
#
000000
;
color
:
#
FFF
;
text-shadow
:
0
1px
0
#ffffff
;
opacity
:
0.
2
;
opacity
:
0.
3
;
filter
:
alpha
(
opacity
=
20
);
}
...
...
common/css/main.css
View file @
d22e1c43
...
...
@@ -6,6 +6,13 @@
color
:
#000
;
}
.editor-title
{
margin-right
:
10px
;
font-size
:
1.7em
;
font-weight
:
bold
;
text-transform
:
capitalize
;
}
.spy
{
position
:
absolute
;
right
:
0px
;
...
...
common/lib/angular-strap.min.js
View file @
d22e1c43
/**
* AngularStrap - Twitter Bootstrap directives for AngularJS
* @version v0.
6.3 - 2013-01-25
* @version v0.
7.5 - 2013-07-21
* @link http://mgcrea.github.com/angular-strap
* @author Olivier Louvignes
* @author Olivier Louvignes
<olivier@mg-crea.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
angular
.
module
(
"$strap.config"
,[]).
value
(
"$strap.config"
,{}),
angular
.
module
(
"$strap.filters"
,[
"$strap.config"
]),
angular
.
module
(
"$strap.directives"
,[
"$strap.config"
]),
angular
.
module
(
"$strap"
,[
"$strap.filters"
,
"$strap.directives"
,
"$strap.config"
]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsAlert"
,[
"$parse"
,
"$timeout"
,
"$compile"
,
function
(
e
,
t
,
n
){
"use strict"
;
return
{
restrict
:
"A"
,
link
:
function
(
r
,
i
,
s
){
r
.
$watch
(
s
.
bsAlert
,
function
(
e
,
s
){
if
(
typeof
e
==
"undefined"
){
typeof
s
!=
"undefined"
&&
i
.
remove
();
return
}
i
.
html
((
e
.
title
?
"<strong>"
+
e
.
title
+
"</strong> "
:
""
)
+
e
.
content
||
""
),
t
(
function
(){
n
(
i
.
contents
())(
r
)});
if
(
e
.
type
||
s
.
type
)
s
.
type
&&
i
.
removeClass
(
"alert-"
+
s
.
type
),
e
.
type
&&
i
.
addClass
(
"alert-"
+
e
.
type
);
e
.
close
!==!
1
&&
i
.
prepend
(
'<button type="button" class="close" data-dismiss="alert">×</button>'
)},
!
0
),
!
s
.
bsAlert
&&
s
.
close
!==
"0"
&&
i
.
prepend
(
'<button type="button" class="close" data-dismiss="alert">×</button>'
),
i
.
addClass
(
"alert"
).
alert
()}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsButton"
,[
"$parse"
,
"$timeout"
,
function
(
e
,
t
){
"use strict"
;
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
n
,
r
,
i
,
s
){
s
&&
(
r
.
parent
(
'[data-toggle="buttons-checkbox"], [data-toggle="buttons-radio"]'
).
length
||
r
.
attr
(
"data-toggle"
,
"button"
),
!
n
.
$eval
(
i
.
ngModel
)
||
r
.
addClass
(
"active"
),
n
.
$watch
(
i
.
ngModel
,
function
(
e
,
t
){
var
n
=!!
e
,
r
=!!
t
;
n
!==
r
&&
$
.
fn
.
button
.
Constructor
.
prototype
.
toggle
.
call
(
o
)})),
r
.
hasClass
(
"btn"
)
||
r
.
on
(
"click.button.data-api"
,
function
(
e
){
r
.
button
(
"toggle"
)}),
r
.
button
();
var
o
=
r
.
data
(
"button"
);
o
.
toggle
=
function
(){
if
(
!
s
)
return
$
.
fn
.
button
.
Constructor
.
prototype
.
toggle
.
call
(
this
);
var
t
=
r
.
parent
(
'[data-toggle="buttons-radio"]'
);
t
.
length
?(
r
.
siblings
(
"[ng-model]"
).
each
(
function
(
t
,
r
){
e
(
$
(
r
).
attr
(
"ng-model"
)).
assign
(
n
,
!
1
)}),
n
.
$digest
(),
s
.
$modelValue
||
(
s
.
$setViewValue
(
!
s
.
$modelValue
),
n
.
$digest
())):
n
.
$apply
(
function
(){
s
.
$setViewValue
(
!
s
.
$modelValue
)})}}}}]).
directive
(
"bsButtonsCheckbox"
,[
"$parse"
,
function
(
e
){
"use strict"
;
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
compile
:
function
(
t
,
n
,
r
){
t
.
attr
(
"data-toggle"
,
"buttons-checkbox"
).
find
(
"a, button"
).
each
(
function
(
e
,
t
){
$
(
t
).
attr
(
"bs-button"
,
""
)})}}}]).
directive
(
"bsButtonsRadio"
,[
"$parse"
,
function
(
e
){
"use strict"
;
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
compile
:
function
(
t
,
n
,
r
){
return
t
.
attr
(
"data-toggle"
,
"buttons-radio"
),
n
.
ngModel
||
t
.
find
(
"a, button"
).
each
(
function
(
e
,
t
){
$
(
t
).
attr
(
"bs-button"
,
""
)}),
function
(
t
,
n
,
r
,
i
){
i
&&
(
n
.
find
(
"[value]"
).
button
().
filter
(
'[value="'
+
t
.
$eval
(
r
.
ngModel
)
+
'"]'
).
addClass
(
"active"
),
n
.
on
(
"click.button.data-api"
,
function
(
e
){
t
.
$apply
(
function
(){
i
.
$setViewValue
(
$
(
e
.
target
).
closest
(
"button"
).
attr
(
"value"
))})}),
t
.
$watch
(
r
.
ngModel
,
function
(
e
,
i
){
if
(
e
!==
i
){
var
s
=
n
.
find
(
'[value="'
+
t
.
$eval
(
r
.
ngModel
)
+
'"]'
);
$
.
fn
.
button
.
Constructor
.
prototype
.
toggle
.
call
(
s
.
data
(
"button"
))}}))}}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsButtonSelect"
,[
"$parse"
,
"$timeout"
,
function
(
e
,
t
){
"use strict"
;
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
n
,
r
,
i
,
s
){
var
o
=
e
(
i
.
bsButtonSelect
),
u
=
o
.
assign
;
s
&&
(
r
.
text
(
n
.
$eval
(
i
.
ngModel
)),
n
.
$watch
(
i
.
ngModel
,
function
(
e
,
t
){
r
.
text
(
e
)}));
var
a
,
f
,
l
,
c
;
r
.
on
(
"click"
,
function
(){
a
=
o
(
n
),
f
=
s
?
n
.
$eval
(
i
.
ngModel
):
r
.
text
(),
l
=
a
.
indexOf
(
f
),
c
=
l
>
a
.
length
-
2
?
a
[
0
]:
a
[
l
+
1
],
n
.
$apply
(
function
(){
r
.
text
(
c
),
s
&&
s
.
$setViewValue
(
c
)})})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsDatepicker"
,[
"$timeout"
,
function
(
e
){
"use strict"
;
var
t
=
"ontouchstart"
in
window
&&!
window
.
navigator
.
userAgent
.
match
(
/PhantomJS/i
),
n
=
{
"/"
:
"[
\\
/]"
,
"-"
:
"[-]"
,
"."
:
"[.]"
,
dd
:
"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))"
,
d
:
"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))"
,
mm
:
"(?:[0]?[1-9]|[1][012])"
,
m
:
"(?:[0]?[1-9]|[1][012])"
,
yyyy
:
"(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])"
,
yy
:
"(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])"
};
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
r
,
i
,
s
,
o
){
var
u
=
function
(
e
,
t
){
t
||
(
t
=
{});
var
r
=
e
,
i
=
n
;
return
angular
.
forEach
(
i
,
function
(
e
,
t
){
r
=
r
.
split
(
t
).
join
(
e
)}),
new
RegExp
(
"^"
+
r
+
"$"
,[
"i"
])},
a
=
t
?
"yyyy/mm/dd"
:
u
(
s
.
dateFormat
||
"mm/dd/yyyy"
);
o
&&
o
.
$parsers
.
unshift
(
function
(
e
){
return
!
e
||
a
.
test
(
e
)?(
o
.
$setValidity
(
"date"
,
!
0
),
e
):(
o
.
$setValidity
(
"date"
,
!
1
),
undefined
)});
var
f
=
i
.
next
(
'[data-toggle="datepicker"]'
);
f
.
length
&&
f
.
on
(
"click"
,
function
(){
t
?
i
.
trigger
(
"focus"
):
i
.
datepicker
(
"show"
)});
if
(
t
&&
i
.
prop
(
"type"
)
===
"text"
)
i
.
prop
(
"type"
,
"date"
),
i
.
on
(
"change"
,
function
(
e
){
r
.
$apply
(
function
(){
o
.
$setViewValue
(
i
.
val
())})});
else
{
o
&&
i
.
on
(
"changeDate"
,
function
(
e
){
r
.
$apply
(
function
(){
o
.
$setViewValue
(
i
.
val
())})});
var
l
=
i
.
closest
(
".popover"
);
l
&&
l
.
on
(
"hide"
,
function
(
e
){
var
t
=
i
.
data
(
"datepicker"
);
t
&&
(
t
.
picker
.
remove
(),
i
.
data
(
"datepicker"
,
null
))}),
i
.
attr
(
"data-toggle"
,
"datepicker"
),
i
.
datepicker
({
autoclose
:
!
0
})}}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsDropdown"
,[
"$parse"
,
"$compile"
,
function
(
e
,
t
){
"use strict"
;
var
n
=
Array
.
prototype
.
slice
,
r
=
'<ul class="dropdown-menu" role="menu" aria-labelledby="drop1"><li ng-repeat="item in items" ng-class="{divider: !!item.divider,
\'
dropdown-submenu
\'
: !!item.submenu && item.submenu.length}"><a ng-hide="!!item.divider" tabindex="-1" ng-href="{{item.href}}" ng-click="{{item.click}}" target="{{item.target}}" ng-bind-html-unsafe="item.text"></a></li></ul>'
,
i
=
function
(
e
,
n
,
i
){
var
o
,
u
,
a
;
for
(
var
f
=
0
,
l
=
e
.
length
;
f
<
l
;
f
++
)
if
(
o
=
e
[
f
].
submenu
)
a
=
i
.
$new
(),
a
.
items
=
o
,
u
=
t
(
r
)(
a
),
u
=
u
.
appendTo
(
n
.
children
(
"li:nth-child("
+
(
f
+
1
)
+
")"
)),
s
(
o
,
u
,
a
)},
s
=
function
(){
var
e
=
n
.
call
(
arguments
);
setTimeout
(
function
(){
i
.
apply
(
null
,
e
)})};
return
{
restrict
:
"EA"
,
scope
:
!
0
,
link
:
function
(
i
,
o
,
u
){
var
a
=
e
(
u
.
bsDropdown
);
i
.
items
=
a
(
i
);
var
f
=
t
(
r
)(
i
);
s
(
i
.
items
,
f
,
i
),
f
.
insertAfter
(
o
),
o
.
addClass
(
"dropdown-toggle"
).
attr
(
"data-toggle"
,
"dropdown"
)}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsModal"
,[
"$parse"
,
"$compile"
,
"$http"
,
"$timeout"
,
"$q"
,
"$templateCache"
,
function
(
e
,
t
,
n
,
r
,
i
,
s
){
"use strict"
;
return
{
restrict
:
"A"
,
scope
:
!
0
,
link
:
function
(
u
,
a
,
f
,
l
){
var
c
=
e
(
f
.
bsModal
),
h
=
c
.
assign
,
p
=
c
(
u
);
i
.
when
(
s
.
get
(
p
)
||
n
.
get
(
p
,{
cache
:
!
0
})).
then
(
function
(
n
){
angular
.
isObject
(
n
)
&&
(
n
=
n
.
data
);
var
i
=
c
(
u
).
replace
(
".html"
,
""
).
replace
(
/
\/
/g
,
"-"
).
replace
(
/
\.
/g
,
"-"
)
+
"-"
+
u
.
$id
,
s
=
$
(
"<div></div>"
).
attr
(
"id"
,
i
).
attr
(
"tabindex"
,
-
1
).
attr
(
"data-backdrop"
,
a
.
attr
(
"data-backdrop"
)
||!
0
).
attr
(
"data-keyboard"
,
a
.
attr
(
"data-keyboard"
)
||!
0
).
addClass
(
"modal hide fade"
).
html
(
n
);
$
(
"body"
).
append
(
s
),
a
.
attr
(
"href"
,
"#"
+
i
).
attr
(
"data-toggle"
,
"modal"
),
r
(
function
(){
t
(
s
)(
u
)}),
u
.
_modal
=
function
(
e
){
s
.
modal
(
e
)},
u
.
hide
=
function
(){
s
.
modal
(
"hide"
)},
u
.
show
=
function
(){
s
.
modal
(
"show"
)},
u
.
dismiss
=
u
.
hide
})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsNavbar"
,[
"$location"
,
function
(
e
){
"use strict"
;
return
{
restrict
:
"A"
,
link
:
function
(
n
,
r
,
i
,
s
){
n
.
$watch
(
function
(){
return
e
.
path
()},
function
(
e
,
t
){
r
.
find
(
"li[data-match-route]"
).
each
(
function
(
t
,
n
){
var
r
=
angular
.
element
(
n
),
i
=
r
.
data
(
"match-route"
),
s
=
new
RegExp
(
"^"
+
i
+
"$"
,[
"i"
]);
s
.
test
(
e
)?
r
.
addClass
(
"active"
):
r
.
removeClass
(
"active"
)})})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsPopover"
,[
"$parse"
,
"$compile"
,
"$http"
,
"$timeout"
,
"$q"
,
"$templateCache"
,
function
(
e
,
t
,
n
,
r
,
i
,
s
){
"use strict"
;
return
$
(
"body"
).
on
(
"keyup"
,
function
(
e
){
e
.
keyCode
===
27
&&
$
(
".popover.in"
).
each
(
function
(){
var
e
=
$
(
this
);
e
.
popover
(
"hide"
)})}),{
restrict
:
"A"
,
scope
:
!
0
,
link
:
function
(
u
,
a
,
f
,
l
){
var
c
=
e
(
f
.
bsPopover
),
h
=
c
.
assign
,
p
=
c
(
u
),
d
=
{};
angular
.
isObject
(
p
)
&&
(
d
=
p
),
i
.
when
(
d
.
content
||
s
.
get
(
p
)
||
n
.
get
(
p
,{
cache
:
!
0
})).
then
(
function
(
n
){
angular
.
isObject
(
n
)
&&
(
n
=
n
.
data
),
!
f
.
unique
||
a
.
on
(
"show"
,
function
(
e
){
$
(
".popover.in"
).
each
(
function
(){
var
e
=
$
(
this
),
t
=
e
.
data
(
"popover"
);
t
&&!
t
.
$element
.
is
(
a
)
&&
e
.
popover
(
"hide"
)})}),
a
.
popover
(
angular
.
extend
({},
d
,{
content
:
function
(){
return
r
(
function
(){
var
e
=
a
.
data
(
"popover"
),
n
=
e
.
tip
();
t
(
n
)(
u
),
setTimeout
(
function
(){
e
.
refresh
()})}),
n
},
html
:
!
0
}));
var
i
=
a
.
data
(
"popover"
);
i
.
hasContent
=
function
(){
return
this
.
getTitle
()
||
n
},
i
.
refresh
=
function
(){
var
e
=
this
.
tip
(),
t
,
n
,
r
,
i
,
s
,
o
;
s
=
typeof
this
.
options
.
placement
==
"function"
?
this
.
options
.
placement
.
call
(
this
,
e
[
0
],
this
.
$element
[
0
]):
this
.
options
.
placement
,
t
=
/in/
.
test
(
s
),
n
=
this
.
getPosition
(
t
),
r
=
e
[
0
].
offsetWidth
,
i
=
e
[
0
].
offsetHeight
;
switch
(
t
?
s
.
split
(
" "
)[
1
]:
s
){
case
"bottom"
:
o
=
{
top
:
n
.
top
+
n
.
height
+
10
,
left
:
n
.
left
+
n
.
width
/
2
-
r
/
2
};
break
;
case
"top"
:
o
=
{
top
:
n
.
top
-
i
-
10
,
left
:
n
.
left
+
n
.
width
/
2
-
r
/
2
};
break
;
case
"left"
:
o
=
{
top
:
n
.
top
+
n
.
height
/
2
-
i
/
2
,
left
:
n
.
left
-
r
-
10
};
break
;
case
"right"
:
o
=
{
top
:
n
.
top
+
n
.
height
/
2
-
i
/
2
,
left
:
n
.
left
+
n
.
width
+
10
}}
e
.
offset
(
o
)},
i
.
show
=
function
(){
var
e
=
$
.
Event
(
"show"
);
this
.
$element
.
trigger
(
e
);
if
(
e
.
isDefaultPrevented
())
return
;
var
t
=
$
.
fn
.
popover
.
Constructor
.
prototype
.
show
.
apply
(
this
,
arguments
);
return
this
.
$tip
.
data
(
"popover"
,
this
),
t
},
i
.
hide
=
function
(){
var
e
=
$
.
Event
(
"hide"
);
this
.
$element
.
trigger
(
e
);
if
(
e
.
isDefaultPrevented
())
return
;
return
$
.
fn
.
popover
.
Constructor
.
prototype
.
hide
.
apply
(
this
,
arguments
)},
u
.
_popover
=
function
(
e
){
a
.
popover
(
e
)},
u
.
hide
=
function
(){
a
.
popover
(
"hide"
)},
u
.
show
=
function
(){
a
.
popover
(
"show"
)},
u
.
dismiss
=
u
.
hide
})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsTimepicker"
,[
"$timeout"
,
function
(
e
){
"use strict"
;
var
t
=
"((?:(?:[0-1][0-9])|(?:[2][0-3])|(?:[0-9])):(?:[0-5][0-9])(?::[0-5][0-9])?(?:
\\
s?(?:am|AM|pm|PM))?)"
;
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
n
,
r
,
i
,
s
){
s
&&
r
.
on
(
"change"
,
function
(
e
){
n
.
$apply
(
function
(){
s
.
$setViewValue
(
r
.
val
())})});
var
o
=
new
RegExp
(
"^"
+
t
+
"$"
,[
"i"
]);
s
.
$parsers
.
unshift
(
function
(
e
){
return
!
e
||
o
.
test
(
e
)?(
s
.
$setValidity
(
"time"
,
!
0
),
e
):(
s
.
$setValidity
(
"time"
,
!
1
),
undefined
)});
var
u
=
r
.
closest
(
".popover"
);
u
&&
u
.
on
(
"hide"
,
function
(
e
){
var
t
=
r
.
data
(
"timepicker"
);
t
&&
(
t
.
$widget
.
remove
(),
r
.
data
(
"timepicker"
,
null
))}),
r
.
attr
(
"data-toggle"
,
"timepicker"
),
r
.
timepicker
()}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsTooltip"
,[
"$parse"
,
"$compile"
,
function
(
e
,
t
){
"use strict"
;
return
{
restrict
:
"A"
,
scope
:
!
0
,
link
:
function
(
t
,
n
,
r
,
i
){
!
r
.
unique
||
n
.
on
(
"show"
,
function
(
e
){
$
(
".tooltip.in"
).
each
(
function
(){
var
e
=
$
(
this
),
t
=
e
.
data
(
"tooltip"
);
t
&&!
t
.
$element
.
is
(
n
)
&&
e
.
tooltip
(
"hide"
)})}),
n
.
tooltip
({
title
:
t
.
$eval
(
r
.
bsTooltip
),
html
:
!
0
});
var
s
=
n
.
data
(
"tooltip"
);
s
.
show
=
function
(){
var
e
=
$
.
Event
(
"show"
);
this
.
$element
.
trigger
(
e
);
if
(
e
.
isDefaultPrevented
())
return
;
var
t
=
$
.
fn
.
tooltip
.
Constructor
.
prototype
.
show
.
apply
(
this
,
arguments
);
return
this
.
tip
().
data
(
"tooltip"
,
this
),
t
},
s
.
hide
=
function
(){
var
e
=
$
.
Event
(
"hide"
);
this
.
$element
.
trigger
(
e
);
if
(
e
.
isDefaultPrevented
())
return
;
return
$
.
fn
.
tooltip
.
Constructor
.
prototype
.
hide
.
apply
(
this
,
arguments
)},
t
.
_tooltip
=
function
(
e
){
n
.
tooltip
(
e
)},
t
.
hide
=
function
(){
n
.
tooltip
(
"hide"
)},
t
.
show
=
function
(){
n
.
tooltip
(
"show"
)},
t
.
dismiss
=
t
.
hide
}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsTypeahead"
,[
"$parse"
,
function
(
e
){
"use strict"
;
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
n
,
r
,
i
,
s
){
var
o
=
e
(
i
.
bsTypeahead
),
u
=
o
.
assign
,
a
=
o
(
n
);
n
.
$watch
(
i
.
bsTypeahead
,
function
(
e
,
t
){
e
!==
t
&&
(
a
=
e
)}),
r
.
attr
(
"data-provide"
,
"typeahead"
),
r
.
typeahead
({
source
:
function
(
e
){
return
angular
.
isFunction
(
a
)?
a
.
apply
(
null
,
arguments
):
a
},
minLength
:
i
.
minLength
||
1
,
items
:
i
.
items
,
updater
:
function
(
e
){
return
s
&&
n
.
$apply
(
function
(){
s
.
$setViewValue
(
e
)}),
e
}});
var
f
=
r
.
data
(
"typeahead"
);
f
.
lookup
=
function
(
e
){
var
t
;
return
this
.
query
=
this
.
$element
.
val
()
||
""
,
this
.
query
.
length
<
this
.
options
.
minLength
?
this
.
shown
?
this
.
hide
():
this
:(
t
=
$
.
isFunction
(
this
.
source
)?
this
.
source
(
this
.
query
,
$
.
proxy
(
this
.
process
,
this
)):
this
.
source
,
t
?
this
.
process
(
t
):
this
)},
i
.
minLength
===
"0"
&&
setTimeout
(
function
(){
r
.
on
(
"focus"
,
function
(){
setTimeout
(
r
.
typeahead
.
bind
(
r
,
"lookup"
),
200
)})})}}}]);
\ No newline at end of file
angular
.
module
(
"$strap.config"
,[]).
value
(
"$strapConfig"
,{}),
angular
.
module
(
"$strap.filters"
,[
"$strap.config"
]),
angular
.
module
(
"$strap.directives"
,[
"$strap.config"
]),
angular
.
module
(
"$strap"
,[
"$strap.filters"
,
"$strap.directives"
,
"$strap.config"
]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsAlert"
,[
"$parse"
,
"$timeout"
,
"$compile"
,
function
(
t
,
e
,
n
){
return
{
restrict
:
"A"
,
link
:
function
(
a
,
i
,
o
){
var
r
=
t
(
o
.
bsAlert
),
s
=
(
r
.
assign
,
r
(
a
)),
l
=
function
(
t
){
e
(
function
(){
i
.
alert
(
"close"
)},
1
*
t
)};
o
.
bsAlert
?
a
.
$watch
(
o
.
bsAlert
,
function
(
t
,
e
){
s
=
t
,
i
.
html
((
t
.
title
?
"<strong>"
+
t
.
title
+
"</strong> "
:
""
)
+
t
.
content
||
""
),
t
.
closed
&&
i
.
hide
(),
n
(
i
.
contents
())(
a
),(
t
.
type
||
e
.
type
)
&&
(
e
.
type
&&
i
.
removeClass
(
"alert-"
+
e
.
type
),
t
.
type
&&
i
.
addClass
(
"alert-"
+
t
.
type
)),
angular
.
isDefined
(
t
.
closeAfter
)?
l
(
t
.
closeAfter
):
o
.
closeAfter
&&
l
(
o
.
closeAfter
),(
angular
.
isUndefined
(
o
.
closeButton
)
||
"0"
!==
o
.
closeButton
&&
"false"
!==
o
.
closeButton
)
&&
i
.
prepend
(
'<button type="button" class="close" data-dismiss="alert">×</button>'
)},
!
0
):((
angular
.
isUndefined
(
o
.
closeButton
)
||
"0"
!==
o
.
closeButton
&&
"false"
!==
o
.
closeButton
)
&&
i
.
prepend
(
'<button type="button" class="close" data-dismiss="alert">×</button>'
),
o
.
closeAfter
&&
l
(
o
.
closeAfter
)),
i
.
addClass
(
"alert"
).
alert
(),
i
.
hasClass
(
"fade"
)
&&
(
i
.
removeClass
(
"in"
),
setTimeout
(
function
(){
i
.
addClass
(
"in"
)}));
var
u
=
o
.
ngRepeat
&&
o
.
ngRepeat
.
split
(
" in "
).
pop
();
i
.
on
(
"close"
,
function
(
t
){
var
e
;
u
?(
t
.
preventDefault
(),
i
.
removeClass
(
"in"
),
e
=
function
(){
i
.
trigger
(
"closed"
),
a
.
$parent
&&
a
.
$parent
.
$apply
(
function
(){
for
(
var
t
=
u
.
split
(
"."
),
e
=
a
.
$parent
,
n
=
0
;
t
.
length
>
n
;
++
n
)
e
&&
(
e
=
e
[
t
[
n
]]);
e
&&
e
.
splice
(
a
.
$index
,
1
)})},
$
.
support
.
transition
&&
i
.
hasClass
(
"fade"
)?
i
.
on
(
$
.
support
.
transition
.
end
,
e
):
e
()):
s
&&
(
t
.
preventDefault
(),
i
.
removeClass
(
"in"
),
e
=
function
(){
i
.
trigger
(
"closed"
),
a
.
$apply
(
function
(){
s
.
closed
=!
0
})},
$
.
support
.
transition
&&
i
.
hasClass
(
"fade"
)?
i
.
on
(
$
.
support
.
transition
.
end
,
e
):
e
())})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsButton"
,[
"$parse"
,
"$timeout"
,
function
(
t
){
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
e
,
n
,
a
,
i
){
if
(
i
){
n
.
parent
(
'[data-toggle="buttons-checkbox"], [data-toggle="buttons-radio"]'
).
length
||
n
.
attr
(
"data-toggle"
,
"button"
);
var
o
=!!
e
.
$eval
(
a
.
ngModel
);
o
&&
n
.
addClass
(
"active"
),
e
.
$watch
(
a
.
ngModel
,
function
(
t
,
e
){
var
a
=!!
t
,
i
=!!
e
;
a
!==
i
?
$
.
fn
.
button
.
Constructor
.
prototype
.
toggle
.
call
(
r
):
a
&&!
o
&&
n
.
addClass
(
"active"
)})}
n
.
hasClass
(
"btn"
)
||
n
.
on
(
"click.button.data-api"
,
function
(){
n
.
button
(
"toggle"
)}),
n
.
button
();
var
r
=
n
.
data
(
"button"
);
r
.
toggle
=
function
(){
if
(
!
i
)
return
$
.
fn
.
button
.
Constructor
.
prototype
.
toggle
.
call
(
this
);
var
a
=
n
.
parent
(
'[data-toggle="buttons-radio"]'
);
a
.
length
?(
n
.
siblings
(
"[ng-model]"
).
each
(
function
(
n
,
a
){
t
(
$
(
a
).
attr
(
"ng-model"
)).
assign
(
e
,
!
1
)}),
e
.
$digest
(),
i
.
$modelValue
||
(
i
.
$setViewValue
(
!
i
.
$modelValue
),
e
.
$digest
())):
e
.
$apply
(
function
(){
i
.
$setViewValue
(
!
i
.
$modelValue
)})}}}}]).
directive
(
"bsButtonsCheckbox"
,[
"$parse"
,
function
(){
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
compile
:
function
(
t
){
t
.
attr
(
"data-toggle"
,
"buttons-checkbox"
).
find
(
"a, button"
).
each
(
function
(
t
,
e
){
$
(
e
).
attr
(
"bs-button"
,
""
)})}}}]).
directive
(
"bsButtonsRadio"
,[
"$timeout"
,
function
(
t
){
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
compile
:
function
(
e
,
n
){
return
e
.
attr
(
"data-toggle"
,
"buttons-radio"
),
n
.
ngModel
||
e
.
find
(
"a, button"
).
each
(
function
(
t
,
e
){
$
(
e
).
attr
(
"bs-button"
,
""
)}),
function
(
e
,
n
,
a
,
i
){
i
&&
(
t
(
function
(){
n
.
find
(
"[value]"
).
button
().
filter
(
'[value="'
+
i
.
$viewValue
+
'"]'
).
addClass
(
"active"
)}),
n
.
on
(
"click.button.data-api"
,
function
(
t
){
e
.
$apply
(
function
(){
i
.
$setViewValue
(
$
(
t
.
target
).
closest
(
"button"
).
attr
(
"value"
))})}),
e
.
$watch
(
a
.
ngModel
,
function
(
t
,
i
){
if
(
t
!==
i
){
var
o
=
n
.
find
(
'[value="'
+
e
.
$eval
(
a
.
ngModel
)
+
'"]'
);
o
.
length
&&
o
.
button
(
"toggle"
)}}))}}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsButtonSelect"
,[
"$parse"
,
"$timeout"
,
function
(
t
){
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
e
,
n
,
a
,
i
){
var
o
=
t
(
a
.
bsButtonSelect
);
o
.
assign
,
i
&&
(
n
.
text
(
e
.
$eval
(
a
.
ngModel
)),
e
.
$watch
(
a
.
ngModel
,
function
(
t
){
n
.
text
(
t
)}));
var
r
,
s
,
l
,
u
;
n
.
bind
(
"click"
,
function
(){
r
=
o
(
e
),
s
=
i
?
e
.
$eval
(
a
.
ngModel
):
n
.
text
(),
l
=
r
.
indexOf
(
s
),
u
=
l
>
r
.
length
-
2
?
r
[
0
]:
r
[
l
+
1
],
e
.
$apply
(
function
(){
n
.
text
(
u
),
i
&&
i
.
$setViewValue
(
u
)})})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsDatepicker"
,[
"$timeout"
,
"$strapConfig"
,
function
(
t
,
e
){
var
n
=
/
(
iP
(
a|o
)
d|iPhone
)
/g
.
test
(
navigator
.
userAgent
),
a
=
function
a
(
t
){
return
t
=
t
||
"en"
,{
"/"
:
"[
\\
/]"
,
"-"
:
"[-]"
,
"."
:
"[.]"
,
" "
:
"[
\\
s]"
,
dd
:
"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))"
,
d
:
"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))"
,
mm
:
"(?:[0]?[1-9]|[1][012])"
,
m
:
"(?:[0]?[1-9]|[1][012])"
,
DD
:
"(?:"
+
$
.
fn
.
datepicker
.
dates
[
t
].
days
.
join
(
"|"
)
+
")"
,
D
:
"(?:"
+
$
.
fn
.
datepicker
.
dates
[
t
].
daysShort
.
join
(
"|"
)
+
")"
,
MM
:
"(?:"
+
$
.
fn
.
datepicker
.
dates
[
t
].
months
.
join
(
"|"
)
+
")"
,
M
:
"(?:"
+
$
.
fn
.
datepicker
.
dates
[
t
].
monthsShort
.
join
(
"|"
)
+
")"
,
yyyy
:
"(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])"
,
yy
:
"(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])"
}},
i
=
function
i
(
t
,
e
){
var
n
,
i
=
t
,
o
=
a
(
e
);
return
n
=
0
,
angular
.
forEach
(
o
,
function
(
t
,
e
){
i
=
i
.
split
(
e
).
join
(
"${"
+
n
+
"}"
),
n
++
}),
n
=
0
,
angular
.
forEach
(
o
,
function
(
t
){
i
=
i
.
split
(
"${"
+
n
+
"}"
).
join
(
t
),
n
++
}),
RegExp
(
"^"
+
i
+
"$"
,[
"i"
])};
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
t
,
a
,
o
,
r
){
var
s
=
angular
.
extend
({
autoclose
:
!
0
},
e
.
datepicker
||
{}),
l
=
o
.
dateType
||
s
.
type
||
"date"
;
angular
.
forEach
([
"format"
,
"weekStart"
,
"calendarWeeks"
,
"startDate"
,
"endDate"
,
"daysOfWeekDisabled"
,
"autoclose"
,
"startView"
,
"minViewMode"
,
"todayBtn"
,
"todayHighlight"
,
"keyboardNavigation"
,
"language"
,
"forceParse"
],
function
(
t
){
angular
.
isDefined
(
o
[
t
])
&&
(
s
[
t
]
=
o
[
t
])});
var
u
=
s
.
language
||
"en"
,
c
=
o
.
dateFormat
||
s
.
format
||
$
.
fn
.
datepicker
.
dates
[
u
]
&&
$
.
fn
.
datepicker
.
dates
[
u
].
format
||
"mm/dd/yyyy"
,
d
=
n
?
"yyyy-mm-dd"
:
c
,
p
=
i
(
d
,
u
);
r
&&
(
r
.
$formatters
.
unshift
(
function
(
t
){
return
"date"
===
l
&&
angular
.
isString
(
t
)
&&
t
?
$
.
fn
.
datepicker
.
DPGlobal
.
parseDate
(
t
,
$
.
fn
.
datepicker
.
DPGlobal
.
parseFormat
(
c
),
u
):
t
}),
r
.
$parsers
.
unshift
(
function
(
t
){
return
t
?
"date"
===
l
&&
angular
.
isDate
(
t
)?(
r
.
$setValidity
(
"date"
,
!
0
),
t
):
angular
.
isString
(
t
)
&&
p
.
test
(
t
)?(
r
.
$setValidity
(
"date"
,
!
0
),
n
?
new
Date
(
t
):
"string"
===
l
?
t
:
$
.
fn
.
datepicker
.
DPGlobal
.
parseDate
(
t
,
$
.
fn
.
datepicker
.
DPGlobal
.
parseFormat
(
d
),
u
)):(
r
.
$setValidity
(
"date"
,
!
1
),
void
0
):(
r
.
$setValidity
(
"date"
,
!
0
),
null
)}),
r
.
$render
=
function
(){
if
(
n
){
var
t
=
r
.
$viewValue
?
$
.
fn
.
datepicker
.
DPGlobal
.
formatDate
(
r
.
$viewValue
,
$
.
fn
.
datepicker
.
DPGlobal
.
parseFormat
(
d
),
u
):
""
;
return
a
.
val
(
t
),
t
}
return
r
.
$viewValue
||
a
.
val
(
""
),
a
.
datepicker
(
"update"
,
r
.
$viewValue
)}),
n
?
a
.
prop
(
"type"
,
"date"
).
css
(
"-webkit-appearance"
,
"textfield"
):(
r
&&
a
.
on
(
"changeDate"
,
function
(
e
){
t
.
$apply
(
function
(){
r
.
$setViewValue
(
"string"
===
l
?
a
.
val
():
e
.
date
)})}),
a
.
datepicker
(
angular
.
extend
(
s
,{
format
:
d
,
language
:
u
})),
t
.
$on
(
"$destroy"
,
function
(){
var
t
=
a
.
data
(
"datepicker"
);
t
&&
(
t
.
picker
.
remove
(),
a
.
data
(
"datepicker"
,
null
))}),
o
.
$observe
(
"startDate"
,
function
(
t
){
a
.
datepicker
(
"setStartDate"
,
t
)}),
o
.
$observe
(
"endDate"
,
function
(
t
){
a
.
datepicker
(
"setEndDate"
,
t
)}));
var
f
=
a
.
siblings
(
'[data-toggle="datepicker"]'
);
f
.
length
&&
f
.
on
(
"click"
,
function
(){
a
.
prop
(
"disabled"
)
||
a
.
trigger
(
"focus"
)})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsDropdown"
,[
"$parse"
,
"$compile"
,
"$timeout"
,
function
(
t
,
e
,
n
){
var
a
=
function
(
t
,
e
){
return
e
||
(
e
=
[
'<ul class="dropdown-menu" role="menu" aria-labelledby="drop1">'
,
"</ul>"
]),
angular
.
forEach
(
t
,
function
(
t
,
n
){
if
(
t
.
divider
)
return
e
.
splice
(
n
+
1
,
0
,
'<li class="divider"></li>'
);
var
i
=
"<li"
+
(
t
.
submenu
&&
t
.
submenu
.
length
?
' class="dropdown-submenu"'
:
""
)
+
">"
+
'<a tabindex="-1" ng-href="'
+
(
t
.
href
||
""
)
+
'"'
+
(
t
.
click
?
'" ng-click="'
+
t
.
click
+
'"'
:
""
)
+
(
t
.
target
?
'" target="'
+
t
.
target
+
'"'
:
""
)
+
(
t
.
method
?
'" data-method="'
+
t
.
method
+
'"'
:
""
)
+
">"
+
(
t
.
text
||
""
)
+
"</a>"
;
t
.
submenu
&&
t
.
submenu
.
length
&&
(
i
+=
a
(
t
.
submenu
).
join
(
"
\
n"
)),
i
+=
"</li>"
,
e
.
splice
(
n
+
1
,
0
,
i
)}),
e
};
return
{
restrict
:
"EA"
,
scope
:
!
0
,
link
:
function
(
i
,
o
,
r
){
var
s
=
t
(
r
.
bsDropdown
),
l
=
s
(
i
);
n
(
function
(){
!
angular
.
isArray
(
l
);
var
t
=
angular
.
element
(
a
(
l
).
join
(
""
));
t
.
insertAfter
(
o
),
e
(
o
.
next
(
"ul.dropdown-menu"
))(
i
)}),
o
.
addClass
(
"dropdown-toggle"
).
attr
(
"data-toggle"
,
"dropdown"
)}}}]),
angular
.
module
(
"$strap.directives"
).
factory
(
"$modal"
,[
"$rootScope"
,
"$compile"
,
"$http"
,
"$timeout"
,
"$q"
,
"$templateCache"
,
"$strapConfig"
,
function
(
t
,
e
,
n
,
a
,
i
,
o
,
r
){
var
s
=
function
s
(
s
){
function
l
(
s
){
var
l
=
angular
.
extend
({
show
:
!
0
},
r
.
modal
,
s
),
u
=
l
.
scope
?
l
.
scope
:
t
.
$new
(),
c
=
l
.
template
;
return
i
.
when
(
o
.
get
(
c
)
||
n
.
get
(
c
,{
cache
:
!
0
}).
then
(
function
(
t
){
return
t
.
data
})).
then
(
function
(
t
){
var
n
=
c
.
replace
(
".html"
,
""
).
replace
(
/
[\/
|
\.
|:
]
/g
,
"-"
)
+
"-"
+
u
.
$id
,
i
=
$
(
'<div class="modal hide" tabindex="-1"></div>'
).
attr
(
"id"
,
n
).
addClass
(
"fade"
).
html
(
t
);
return
l
.
modalClass
&&
i
.
addClass
(
l
.
modalClass
),
$
(
"body"
).
append
(
i
),
a
(
function
(){
e
(
i
)(
u
)}),
u
.
$modal
=
function
(
t
){
i
.
modal
(
t
)},
angular
.
forEach
([
"show"
,
"hide"
],
function
(
t
){
u
[
t
]
=
function
(){
i
.
modal
(
t
)}}),
u
.
dismiss
=
u
.
hide
,
angular
.
forEach
([
"show"
,
"shown"
,
"hide"
,
"hidden"
],
function
(
t
){
i
.
on
(
t
,
function
(
e
){
u
.
$emit
(
"modal-"
+
t
,
e
)})}),
i
.
on
(
"shown"
,
function
(){
$
(
"input[autofocus], textarea[autofocus]"
,
i
).
first
().
trigger
(
"focus"
)}),
i
.
on
(
"hidden"
,
function
(){
l
.
persist
||
u
.
$destroy
()}),
u
.
$on
(
"$destroy"
,
function
(){
i
.
remove
()}),
i
.
modal
(
l
),
i
})}
return
new
l
(
s
)};
return
s
}]).
directive
(
"bsModal"
,[
"$q"
,
"$modal"
,
function
(
t
,
e
){
return
{
restrict
:
"A"
,
scope
:
!
0
,
link
:
function
(
n
,
a
,
i
){
var
o
=
{
template
:
n
.
$eval
(
i
.
bsModal
),
persist
:
!
0
,
show
:
!
1
,
scope
:
n
};
angular
.
forEach
([
"modalClass"
,
"backdrop"
,
"keyboard"
],
function
(
t
){
angular
.
isDefined
(
i
[
t
])
&&
(
o
[
t
]
=
i
[
t
])}),
t
.
when
(
e
(
o
)).
then
(
function
(
t
){
a
.
attr
(
"data-target"
,
"#"
+
t
.
attr
(
"id"
)).
attr
(
"data-toggle"
,
"modal"
)})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsNavbar"
,[
"$location"
,
function
(
t
){
return
{
restrict
:
"A"
,
link
:
function
(
e
,
n
){
e
.
$watch
(
function
(){
return
t
.
path
()},
function
(
t
){
$
(
"li[data-match-route]"
,
n
).
each
(
function
(
e
,
n
){
var
a
=
angular
.
element
(
n
),
i
=
a
.
attr
(
"data-match-route"
),
o
=
RegExp
(
"^"
+
i
+
"$"
,[
"i"
]);
o
.
test
(
t
)?
a
.
addClass
(
"active"
).
find
(
".collapse.in"
).
collapse
(
"hide"
):
a
.
removeClass
(
"active"
)})})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsPopover"
,[
"$parse"
,
"$compile"
,
"$http"
,
"$timeout"
,
"$q"
,
"$templateCache"
,
function
(
t
,
e
,
n
,
a
,
i
,
o
){
return
$
(
"body"
).
on
(
"keyup"
,
function
(
t
){
27
===
t
.
keyCode
&&
$
(
".popover.in"
).
each
(
function
(){
$
(
this
).
popover
(
"hide"
)})}),{
restrict
:
"A"
,
scope
:
!
0
,
link
:
function
(
r
,
s
,
l
){
var
u
=
t
(
l
.
bsPopover
),
c
=
(
u
.
assign
,
u
(
r
)),
d
=
{};
angular
.
isObject
(
c
)
&&
(
d
=
c
),
i
.
when
(
d
.
content
||
o
.
get
(
c
)
||
n
.
get
(
c
,{
cache
:
!
0
})).
then
(
function
(
t
){
angular
.
isObject
(
t
)
&&
(
t
=
t
.
data
),
l
.
unique
&&
s
.
on
(
"show"
,
function
(){
$
(
".popover.in"
).
each
(
function
(){
var
t
=
$
(
this
),
e
=
t
.
data
(
"popover"
);
e
&&!
e
.
$element
.
is
(
s
)
&&
t
.
popover
(
"hide"
)})}),
l
.
hide
&&
r
.
$watch
(
l
.
hide
,
function
(
t
,
e
){
t
?
n
.
hide
():
t
!==
e
&&
n
.
show
()}),
l
.
show
&&
r
.
$watch
(
l
.
show
,
function
(
t
,
e
){
t
?
a
(
function
(){
n
.
show
()}):
t
!==
e
&&
n
.
hide
()}),
s
.
popover
(
angular
.
extend
({},
d
,{
content
:
t
,
html
:
!
0
}));
var
n
=
s
.
data
(
"popover"
);
n
.
hasContent
=
function
(){
return
this
.
getTitle
()
||
t
},
n
.
getPosition
=
function
(){
var
t
=
$
.
fn
.
popover
.
Constructor
.
prototype
.
getPosition
.
apply
(
this
,
arguments
);
return
e
(
this
.
$tip
)(
r
),
r
.
$digest
(),
this
.
$tip
.
data
(
"popover"
,
this
),
t
},
r
.
$popover
=
function
(
t
){
n
(
t
)},
angular
.
forEach
([
"show"
,
"hide"
],
function
(
t
){
r
[
t
]
=
function
(){
n
[
t
]()}}),
r
.
dismiss
=
r
.
hide
,
angular
.
forEach
([
"show"
,
"shown"
,
"hide"
,
"hidden"
],
function
(
t
){
s
.
on
(
t
,
function
(
e
){
r
.
$emit
(
"popover-"
+
t
,
e
)})})})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsSelect"
,[
"$timeout"
,
function
(
t
){
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
e
,
n
,
a
,
i
){
var
o
=
e
.
$eval
(
a
.
bsSelect
)
||
{};
t
(
function
(){
n
.
selectpicker
(
o
),
n
.
next
().
removeClass
(
"ng-scope"
)}),
i
&&
e
.
$watch
(
a
.
ngModel
,
function
(
t
,
e
){
angular
.
equals
(
t
,
e
)
||
n
.
selectpicker
(
"refresh"
)})}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsTabs"
,[
"$parse"
,
"$compile"
,
"$timeout"
,
function
(
t
,
e
,
n
){
var
a
=
'<div class="tabs"><ul class="nav nav-tabs"><li ng-repeat="pane in panes" ng-class="{active:pane.active}"><a data-target="#{{pane.id}}" data-index="{{$index}}" data-toggle="tab">{{pane.title}}</a></li></ul><div class="tab-content" ng-transclude></div>'
;
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
priority
:
0
,
scope
:
!
0
,
template
:
a
,
replace
:
!
0
,
transclude
:
!
0
,
compile
:
function
(){
return
function
(
e
,
a
,
i
,
o
){
var
r
=
t
(
i
.
bsTabs
);
r
.
assign
,
r
(
e
),
e
.
panes
=
[];
var
s
,
l
,
u
,
c
=
a
.
find
(
"ul.nav-tabs"
),
d
=
a
.
find
(
"div.tab-content"
),
p
=
0
;
n
(
function
(){
d
.
find
(
"[data-title], [data-tab]"
).
each
(
function
(
t
){
var
n
=
angular
.
element
(
this
);
s
=
"tab-"
+
e
.
$id
+
"-"
+
t
,
l
=
n
.
data
(
"title"
)
||
n
.
data
(
"tab"
),
u
=!
u
&&
n
.
hasClass
(
"active"
),
n
.
attr
(
"id"
,
s
).
addClass
(
"tab-pane"
),
i
.
fade
&&
n
.
addClass
(
"fade"
),
e
.
panes
.
push
({
id
:
s
,
title
:
l
,
content
:
this
.
innerHTML
,
active
:
u
})}),
e
.
panes
.
length
&&!
u
&&
(
d
.
find
(
".tab-pane:first-child"
).
addClass
(
"active"
+
(
i
.
fade
?
" in"
:
""
)),
e
.
panes
[
0
].
active
=!
0
)}),
o
&&
(
a
.
on
(
"show"
,
function
(
t
){
var
n
=
$
(
t
.
target
);
e
.
$apply
(
function
(){
o
.
$setViewValue
(
n
.
data
(
"index"
))})}),
e
.
$watch
(
i
.
ngModel
,
function
(
t
){
angular
.
isUndefined
(
t
)
||
(
p
=
t
,
setTimeout
(
function
(){
var
e
=
$
(
c
[
0
].
querySelectorAll
(
"li"
)[
1
*
t
]);
e
.
hasClass
(
"active"
)
||
e
.
children
(
"a"
).
tab
(
"show"
)}))}))}}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsTimepicker"
,[
"$timeout"
,
"$strapConfig"
,
function
(
t
,
e
){
var
n
=
"((?:(?:[0-1][0-9])|(?:[2][0-3])|(?:[0-9])):(?:[0-5][0-9])(?::[0-5][0-9])?(?:
\\
s?(?:am|AM|pm|PM))?)"
;
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
a
,
i
,
o
,
r
){
if
(
r
){
i
.
on
(
"changeTime.timepicker"
,
function
(){
t
(
function
(){
r
.
$setViewValue
(
i
.
val
())})});
var
s
=
RegExp
(
"^"
+
n
+
"$"
,[
"i"
]);
r
.
$parsers
.
unshift
(
function
(
t
){
return
!
t
||
s
.
test
(
t
)?(
r
.
$setValidity
(
"time"
,
!
0
),
t
):(
r
.
$setValidity
(
"time"
,
!
1
),
void
0
)})}
i
.
attr
(
"data-toggle"
,
"timepicker"
),
i
.
parent
().
addClass
(
"bootstrap-timepicker"
),
i
.
timepicker
(
e
.
timepicker
||
{});
var
l
=
i
.
data
(
"timepicker"
),
u
=
i
.
siblings
(
'[data-toggle="timepicker"]'
);
u
.
length
&&
u
.
on
(
"click"
,
$
.
proxy
(
l
.
showWidget
,
l
))}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsTooltip"
,[
"$parse"
,
"$compile"
,
function
(
t
){
return
{
restrict
:
"A"
,
scope
:
!
0
,
link
:
function
(
e
,
n
,
a
){
var
i
=
t
(
a
.
bsTooltip
),
o
=
(
i
.
assign
,
i
(
e
));
e
.
$watch
(
a
.
bsTooltip
,
function
(
t
,
e
){
t
!==
e
&&
(
o
=
t
)}),
a
.
unique
&&
n
.
on
(
"show"
,
function
(){
$
(
".tooltip.in"
).
each
(
function
(){
var
t
=
$
(
this
),
e
=
t
.
data
(
"tooltip"
);
e
&&!
e
.
$element
.
is
(
n
)
&&
t
.
tooltip
(
"hide"
)})}),
n
.
tooltip
({
title
:
function
(){
return
angular
.
isFunction
(
o
)?
o
.
apply
(
null
,
arguments
):
o
},
html
:
!
0
});
var
r
=
n
.
data
(
"tooltip"
);
r
.
show
=
function
(){
var
t
=
$
.
fn
.
tooltip
.
Constructor
.
prototype
.
show
.
apply
(
this
,
arguments
);
return
this
.
tip
().
data
(
"tooltip"
,
this
),
t
},
e
.
_tooltip
=
function
(
t
){
n
.
tooltip
(
t
)},
e
.
hide
=
function
(){
n
.
tooltip
(
"hide"
)},
e
.
show
=
function
(){
n
.
tooltip
(
"show"
)},
e
.
dismiss
=
e
.
hide
}}}]),
angular
.
module
(
"$strap.directives"
).
directive
(
"bsTypeahead"
,[
"$parse"
,
function
(
t
){
return
{
restrict
:
"A"
,
require
:
"?ngModel"
,
link
:
function
(
e
,
n
,
a
,
i
){
var
o
=
t
(
a
.
bsTypeahead
),
r
=
(
o
.
assign
,
o
(
e
));
e
.
$watch
(
a
.
bsTypeahead
,
function
(
t
,
e
){
t
!==
e
&&
(
r
=
t
)}),
n
.
attr
(
"data-provide"
,
"typeahead"
),
n
.
typeahead
({
source
:
function
(){
return
angular
.
isFunction
(
r
)?
r
.
apply
(
null
,
arguments
):
r
},
minLength
:
a
.
minLength
||
1
,
items
:
a
.
items
,
updater
:
function
(
t
){
return
i
&&
e
.
$apply
(
function
(){
i
.
$setViewValue
(
t
)}),
e
.
$emit
(
"typeahead-updated"
,
t
),
t
}});
var
s
=
n
.
data
(
"typeahead"
);
s
.
lookup
=
function
(){
var
t
;
return
this
.
query
=
this
.
$element
.
val
()
||
""
,
this
.
query
.
length
<
this
.
options
.
minLength
?
this
.
shown
?
this
.
hide
():
this
:(
t
=
$
.
isFunction
(
this
.
source
)?
this
.
source
(
this
.
query
,
$
.
proxy
(
this
.
process
,
this
)):
this
.
source
,
t
?
this
.
process
(
t
):
this
)},
a
.
matchAll
&&
(
s
.
matcher
=
function
(){
return
!
0
}),
"0"
===
a
.
minLength
&&
setTimeout
(
function
(){
n
.
on
(
"focus"
,
function
(){
0
===
n
.
val
().
length
&&
setTimeout
(
n
.
typeahead
.
bind
(
n
,
"lookup"
),
200
)})})}}}]);
\ No newline at end of file
js/controllers.js
View file @
d22e1c43
...
...
@@ -13,6 +13,11 @@ angular.module('kibana.controllers', [])
last
:
null
};
// For
$scope
.
editor
=
{
index
:
0
};
$scope
.
init
=
function
()
{
$scope
.
config
=
config
;
...
...
partials/dasheditor.html
View file @
d22e1c43
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h3>
{{dashboard.current.title}}
<small>
editor
</small></h3>
</div>
<div
class=
"modal-body"
>
<h4>
Dashboard Control
</h4>
<div
class=
"row-fluid"
>
<div
class=
"span8"
>
<div
class=
"pull-right editor-title"
>
Dashboard settings
</div>
<div
ng-model=
"editor.index"
bs-tabs
>
<div
ng-repeat=
"tab in ['General','Index','Rows']"
data-title=
"{{tab}}"
>
</div>
</div>
<div
class=
"row-fluid"
ng-show=
"editor.index == 0"
>
<div
class=
"span4"
>
<label
class=
"small"
>
Title
</label><input
type=
"text"
class=
"input-large"
ng-model=
'dashboard.current.title'
></input>
</div>
<div
class=
"span1"
>
<label
class=
"small"
>
Editable
</label><input
type=
"checkbox"
ng-model=
"dashboard.current.editable"
ng-checked=
"dashboard.current.editable"
/>
</div>
</div>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
ng-show=
"editor.index == 1"
>
<h4>
Index Settings
</h4>
<div
ng-show=
"dashboard.current.index.interval != 'none'"
class=
"row-fluid"
>
<div
class=
"span12"
>
...
...
@@ -46,9 +49,8 @@
</div>
</div>
</div>
<
hr/
>
<
div
class=
"row-fluid"
ng-show=
"editor.index == 2"
>
<h4>
Rows
</h4>
<div
class=
"row-fluid"
>
<form>
<div
class=
"span5"
>
<label
class=
"small"
>
Title
</label>
...
...
@@ -68,7 +70,7 @@
</div>
</form>
</div>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
ng-show=
"editor.index == 2"
>
<div
class=
"span12"
>
<table
class=
"table table-condensed table-striped"
>
<thead>
...
...
@@ -87,5 +89,5 @@
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-success"
ng-click=
"dismiss();reset_panel();dashboard.refresh()"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-success"
ng-click=
"
editor.index=0;
dismiss();reset_panel();dashboard.refresh()"
>
Close
</button>
</div>
\ No newline at end of file
partials/paneleditor.html
View file @
d22e1c43
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h3>
{{panel.title}} Editor
</h3>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<div
class=
"pull-right editor-title"
>
{{panel.type}} settings
</div>
<h4>
General
<small>
panel settings
</small></h4>
<div
ng-model=
"editor.index"
bs-tabs
>
<div
ng-repeat=
"tab in ['General','Panel']"
data-title=
"{{tab}}"
>
</div>
</div>
<div
ng-show=
"editor.index == 0"
>
<h4>
{{panel.title}} General
<small>
panel settings
</small></h4>
<div
ng-include
src=
"'partials/panelgeneral.html'"
></div>
</div>
<div
ng-show=
"editor.index == 1"
>
<h4
style=
"text-transform: capitalize;"
>
{{panel.type}}
<small>
panel settings.
<strong
ng-show=
"!_.isUndefined(panel.status)"
>
({{panel.status}})
</strong></small></h4>
<div
ng-include
src=
"edit_path(panel.type)"
>
No additional settings are available for this type of panel.
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<!-- close_edit() is provided here to allow for a scope to perform action on dismiss -->
<button
type=
"button"
class=
"btn btn-success"
ng-click=
"close_edit();dismiss()"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-success"
ng-click=
"
editor.index=0;
close_edit();dismiss()"
>
Close
</button>
</div>
\ No newline at end of file
partials/querySelect.html
0 → 100644
View file @
d22e1c43
<style>
.querySelect
.query
{
margin-right
:
5px
;
}
</style>
<h4>
Queries
</h4>
<div
class=
"span2"
style=
"margin-left:0px"
>
<select
class=
"input-small"
ng-change=
"set_refresh(true);"
ng-model=
"panel.queries.mode"
ng-options=
"f for f in ['all','pinned','selected']"
></select>
</div>
<div
class=
"span9 querySelect"
ng-show=
"panel.queries.mode == 'selected'"
>
<span
ng-repeat=
"id in querySrv.ids"
class=
"query badge"
>
<i
ng-click=
"panel.queries.ids = _.toggleInOut(panel.queries.ids,id);set_refresh(true);"
ng-class=
"{'icon-check': _.contains(panel.queries.ids,id),'icon-check-empty': !_.contains(panel.queries.ids,id)}"
></i>
<i
class=
"icon-circle"
ng-style=
"{color: querySrv.list[id].color}"
></i><span>
{{querySrv.list[id].alias || querySrv.list[id].query}}
</span>
</span>
</div>
partials/roweditor.html
View file @
d22e1c43
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h3>
{{row.title}}
<small>
row editor
</small></h3>
</div>
<div
class=
"modal-body"
>
<h4>
Row Control
</h4>
<div
class=
"row-fluid"
>
<div
class=
"pull-right editor-title"
>
Row settings
</div>
<div
ng-model=
"editor.index"
bs-tabs
>
<div
ng-repeat=
"tab in ['General','Panels']"
data-title=
"{{tab}}"
>
</div>
</div>
<div
class=
"row-fluid"
ng-show=
"editor.index == 0"
>
<div
class=
"span4"
>
<label
class=
"small"
>
Title
</label><input
type=
"text"
class=
"input-medium"
ng-model=
'row.title'
></input>
</div>
...
...
@@ -18,7 +20,7 @@
<label
class=
"small"
>
Collapsable
</label><input
type=
"checkbox"
ng-model=
"row.collapsable"
ng-checked=
"row.collapsable"
/>
</div>
</div>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
ng-show=
"editor.index == 1"
>
<h4>
New Panel
</h4>
<form
class=
"input-append"
>
<select
class=
"input-medium input-append"
ng-model=
"panel.type"
ng-options=
"f for f in config.modules|stringSort"
></select>
...
...
@@ -30,7 +32,7 @@
<div
add-panel=
"{{panel.type}}"
></div>
</div>
</div>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
ng-show=
"editor.index == 1"
>
<div
class=
"span12"
>
<h4>
Panels
</h4>
<table
class=
"table table-condensed table-striped"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment