svn sync
git-svn-id: https://svn.coded.pt/svn/SIPRP@1893 bb69d46d-e84e-40c8-a05a-06db0d633741lxbfYeaa
@ -1,16 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<div class="container">
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading">
|
||||
<span class="glyphicon glyphicon-info-sign"> Confirmação</span>
|
||||
</div>
|
||||
<div class="panel-body"><tiles:insertAttribute name="message"/></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
</div>
|
||||
@ -1,16 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<div class="container">
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">
|
||||
<span class="glyphicon glyphicon-exclamation-sign"> Erro</span>
|
||||
</div>
|
||||
<div class="panel-body"><tiles:insertAttribute name="message"/></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
</div>
|
||||
@ -1,191 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Safemode - <tiles:insertAttribute name="title"/></title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/jquery-1.11.0.min.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/h5validation.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/jquery.validate.min.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/additional-methods.min.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/datepicker/datepicker.js"></script>
|
||||
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/cxf-js/cxf-utils.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/cxf-js/LegislacaoWSImpl2Service.js"></script>
|
||||
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/knockout/knockout-3.0.0.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/knockout/knockout.mapping-v2.4.1.js"></script>
|
||||
|
||||
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.0/moment.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/scripts/bootstrap/css/bootstrap.css" >
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/scripts/datepicker/datepicker.css" >
|
||||
<style type="text/css">
|
||||
.nav-link:hover
|
||||
{
|
||||
background-color: white;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<tiles:insertAttribute name="validator"/>
|
||||
<!-- Javascript -->
|
||||
<script type='text/javascript' src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script>
|
||||
<script type='text/javascript' src="${pageContext.request.contextPath}/static/scripts/css3-mediaqueries.js"></script>
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script type='text/javascript' src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<script type='text/javascript' src="http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div style="overflow: hidden;">
|
||||
<div style="background-color: white">
|
||||
<header class="masthead header" style="height: 125px">
|
||||
<div class="container">
|
||||
<tiles:insertAttribute name="header" />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Begin Navbar -->
|
||||
<div id="nav">
|
||||
<div class="navbar navbar-default navbar-static">
|
||||
<div class="container">
|
||||
<ul class="nav navbar-nav col-md-6">
|
||||
<tiles:insertAttribute name="navbar" />
|
||||
</ul>
|
||||
<div class="nav navbar-nav col-md-3" style="padding-left: 22px; padding-right: 0px">
|
||||
<tiles:insertAttribute name="quick-search" />
|
||||
</div>
|
||||
<c:if test="${user != null}">
|
||||
<div class="col-md-2" style="padding-left: 0px; padding-right: 0px;">
|
||||
<div style="font-size: 10pt; color: white; display: table-cell; height: 52px; vertical-align: middle;">
|
||||
Bem-vindo(a) <a class="nav-link" title="Clique para ir para a sua área de utilizador" href="${pageContext.request.contextPath}/pages/personal/listUser.do"><c:out value="${user.user_name}"/></a>.
|
||||
<a class="nav-link" title="Clique para fazer logout da sessão" href="${pageContext.request.contextPath}/j_spring_security_logout">Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="padding-top: 6px; padding-bottom: 6px; padding-left: 0px; padding-right: 0px;">
|
||||
<button class="btn btn-primary" style="float: right; height: 40px; margin-left: 5px;" id="fav" type="button" data-bind="click: favoritosClick">
|
||||
<span class="glyphicon glyphicon-star"></span>
|
||||
</button>
|
||||
<button class="btn btn-primary" style="float: right; height: 40px;" id="top" type="button" data-bind="click: toptenClick">
|
||||
<span class="glyphicon glyphicon-arrow-up"></span>
|
||||
</button>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.navbar -->
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var buttons = {
|
||||
favoritos: ko.observable(false),
|
||||
topten: ko.observable(false),
|
||||
favoritosClick: function( )
|
||||
{
|
||||
if( ( this.favoritos() === false ) && ( this.topten() === false ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-9");
|
||||
jQuery("#favoritos").removeClass().addClass("col-sm-3");
|
||||
jQuery("#fav").addClass("active");
|
||||
this.favoritos(true);
|
||||
}
|
||||
else if( ( this.favoritos() === false ) && ( this.topten() === true ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-6");
|
||||
jQuery("#favoritos").removeClass().addClass("col-sm-3");
|
||||
jQuery("#fav").addClass("active");
|
||||
this.favoritos(true);
|
||||
}
|
||||
else if( ( this.favoritos() === true ) && ( this.topten() === false ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-12");
|
||||
jQuery("#favoritos").removeClass().addClass("hidden");
|
||||
jQuery("#fav").removeClass("active");
|
||||
this.favoritos(false);
|
||||
}
|
||||
else if( ( this.favoritos() === true ) && ( this.topten() === true ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-9");
|
||||
jQuery("#favoritos").removeClass().addClass("hidden");
|
||||
jQuery("#fav").removeClass("active");
|
||||
this.favoritos(false);
|
||||
}
|
||||
},
|
||||
toptenClick: function( )
|
||||
{
|
||||
if( ( this.topten() === false ) && ( this.favoritos() === false ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-9");
|
||||
jQuery("#topten").removeClass().addClass("col-sm-3");
|
||||
jQuery("#top").addClass("active");
|
||||
this.topten(true);
|
||||
}
|
||||
else if( ( this.topten() === false ) && ( this.favoritos() === true ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-6");
|
||||
jQuery("#topten").removeClass().addClass("col-sm-3");
|
||||
jQuery("#top").addClass("active");
|
||||
this.topten(true);
|
||||
}
|
||||
else if( ( this.topten() === true ) && ( this.favoritos() === false ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-12");
|
||||
jQuery("#topten").removeClass().addClass("hidden");
|
||||
jQuery("#top").removeClass("active");
|
||||
this.topten(false);
|
||||
}
|
||||
else if( ( this.topten() === true ) && ( this.favoritos() === true ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-9");
|
||||
jQuery("#topten").removeClass().addClass("hidden");
|
||||
jQuery("#top").removeClass("active");
|
||||
this.topten(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ko.applyBindings( buttons, jQuery("#nav")[0] );
|
||||
</script>
|
||||
|
||||
<!-- Begin Body -->
|
||||
<div class="container">
|
||||
<tiles:insertAttribute name="content"/>
|
||||
</div>
|
||||
<hr />
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<p>Copyright 2013 Safemode. Todos os direitos
|
||||
reservados.</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-md-10"
|
||||
style="width: initial; padding-right: 0;">
|
||||
<p>Desenvolvido por</p>
|
||||
</div>
|
||||
<div class="col-md-2"
|
||||
style="padding-left: 5px; margin-top: -12px;">
|
||||
<a href="http://www.evolute.pt/" target="_blank">
|
||||
<img alt="evolute" height="30" width="132" src="/safemode/static/styles/logo_w400.jpg">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,176 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Safemode - <tiles:insertAttribute name="title"/></title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/jquery-1.11.0.min.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/datepicker/datepicker.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/angular.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/angular-ui-utils.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/ui-utils-ieshiv.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/ui-bootstrap-tpls-0.10.0.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/bootstrap-angular.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/cxf-js/cxf-utils.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/cxf-js/LegislacaoWSImpl2Service.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/knockout/knockout-3.0.0.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/knockout/knockout.mapping-v2.4.1.js"></script>
|
||||
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.0/moment.min.js"></script>
|
||||
<tiles:insertAttribute name="validator"/>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/scripts/bootstrap/css/bootstrap.css" >
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/scripts/datepicker/datepicker.css" >
|
||||
<style type="text/css">
|
||||
.nav-link:hover
|
||||
{
|
||||
background-color: white;
|
||||
}
|
||||
</style>
|
||||
<!-- Javascript -->
|
||||
<script type='text/javascript' src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script>
|
||||
<script type='text/javascript' src="${pageContext.request.contextPath}/static/scripts/css3-mediaqueries.js"></script>
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script type='text/javascript' src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<script type='text/javascript' src="http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div style="background-color: white">
|
||||
<header class="masthead header" style="height: 125px">
|
||||
<div class="container">
|
||||
<tiles:insertAttribute name="header" />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Begin Navbar -->
|
||||
<div id="nav">
|
||||
<div class="navbar navbar-default navbar-static">
|
||||
<div class="container">
|
||||
<ul class="nav navbar-nav col-md-6">
|
||||
<tiles:insertAttribute name="navbar" />
|
||||
</ul>
|
||||
<div class="nav navbar-nav col-md-3" style="padding-left: 22px; padding-right: 0px">
|
||||
<tiles:insertAttribute name="quick-search" />
|
||||
</div>
|
||||
<c:if test="${user != null}">
|
||||
<div class="col-md-2" style="padding-left: 0px; padding-right: 0px;">
|
||||
<div style="font-size: 10pt; color: white; display: table-cell; height: 52px; vertical-align: middle;">
|
||||
Bem-vindo(a) <a class="nav-link" title="Clique para ir para a sua área de utilizador" href="${pageContext.request.contextPath}/pages/personal/listUser.do"><c:out value="${user.user_name}"/></a>.
|
||||
<a class="nav-link" title="Clique para fazer logout da sessão" href="${pageContext.request.contextPath}/j_spring_security_logout">Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="padding-top: 6px; padding-bottom: 6px; padding-left: 0px; padding-right: 0px;">
|
||||
<button class="btn btn-primary" style="float: right; height: 40px; margin-left: 5px;" id="fav" type="button" data-bind="click: favoritosClick">
|
||||
<span class="glyphicon glyphicon-star"></span>
|
||||
</button>
|
||||
<button class="btn btn-primary" style="float: right; height: 40px;" id="top" type="button" data-bind="click: toptenClick">
|
||||
<span class="glyphicon glyphicon-arrow-up"></span>
|
||||
</button>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.navbar -->
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var buttons = {
|
||||
favoritos: ko.observable(false),
|
||||
topten: ko.observable(false),
|
||||
favoritosClick: function( )
|
||||
{
|
||||
if( ( this.favoritos() === false ) && ( this.topten() === false ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-9");
|
||||
jQuery("#favoritos").removeClass().addClass("col-sm-3");
|
||||
this.favoritos(true);
|
||||
}
|
||||
else if( ( this.favoritos() === false ) && ( this.topten() === true ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-6");
|
||||
jQuery("#favoritos").removeClass().addClass("col-sm-3");
|
||||
this.favoritos(true);
|
||||
}
|
||||
else if( ( this.favoritos() === true ) && ( this.topten() === false ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-12");
|
||||
jQuery("#favoritos").removeClass().addClass("hidden");
|
||||
this.favoritos(false);
|
||||
}
|
||||
else if( ( this.favoritos() === true ) && ( this.topten() === true ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-9");
|
||||
jQuery("#favoritos").removeClass().addClass("hidden");
|
||||
this.favoritos(false);
|
||||
}
|
||||
},
|
||||
toptenClick: function( )
|
||||
{
|
||||
if( ( this.topten() === false ) && ( this.favoritos() === false ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-9");
|
||||
jQuery("#topten").removeClass().addClass("col-sm-3");
|
||||
this.topten(true);
|
||||
}
|
||||
else if( ( this.topten() === false ) && ( this.favoritos() === true ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-6");
|
||||
jQuery("#topten").removeClass().addClass("col-sm-3");
|
||||
this.topten(true);
|
||||
}
|
||||
else if( ( this.topten() === true ) && ( this.favoritos() === false ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-12");
|
||||
jQuery("#topten").removeClass().addClass("hidden");
|
||||
this.topten(false);
|
||||
}
|
||||
else if( ( this.topten() === true ) && ( this.favoritos() === true ) )
|
||||
{
|
||||
jQuery("#main_content").removeClass().addClass("col-sm-9");
|
||||
jQuery("#topten").removeClass().addClass("hidden");
|
||||
this.topten(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ko.applyBindings( buttons, jQuery("#nav")[0] );
|
||||
</script>
|
||||
|
||||
<!-- Begin Body -->
|
||||
<div class="container">
|
||||
<tiles:insertAttribute name="content"/>
|
||||
</div>
|
||||
<hr />
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<p>Copyright 2013 Safemode. Todos os direitos
|
||||
reservados.</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-md-10"
|
||||
style="width: initial; padding-right: 0;">
|
||||
<p>Desenvolvido por</p>
|
||||
</div>
|
||||
<div class="col-md-2"
|
||||
style="padding-left: 5px; margin-top: -12px;">
|
||||
<a href="http://www.evolute.pt/" target="_blank">
|
||||
<img alt="evolute" height="30" width="132" src="/safemode/static/styles/logo_w400.jpg">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,73 +0,0 @@
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Safemode - <tiles:insertAttribute name="title"/></title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/jquery-1.11.0.min.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/h5validation.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/jquery.validate.min.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/additional-methods.min.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/bootstrap/js/bootstrap.min.js"></script>
|
||||
|
||||
<tiles:insertAttribute name="validator"/>
|
||||
<!-- Javascript -->
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/scripts/bootstrap/css/bootstrap.css" >
|
||||
|
||||
<script type='text/javascript' src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script>
|
||||
<script type='text/javascript' src="${pageContext.request.contextPath}/static/scripts/css3-mediaqueries.js"></script>
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script type='text/javascript' src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<script type='text/javascript' src="http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div style="background-color: white">
|
||||
<header class="masthead header" style="height: 125px">
|
||||
<div class="container">
|
||||
<tiles:insertAttribute name="header" />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Begin Body -->
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<tiles:insertAttribute name="content" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<p>Copyright 2013 Safemode. Todos os direitos
|
||||
reservados.</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-md-10"
|
||||
style="width: initial; padding-right: 0;">
|
||||
<p>Desenvolvido por</p>
|
||||
</div>
|
||||
<div class="col-md-2"
|
||||
style="padding-left: 5px; margin-top: -12px;">
|
||||
<a href="http://www.evolute.pt/" target="_blank">
|
||||
<img alt="evolute" height="30" width="132" src="/safemode/static/styles/logo_w400.jpg">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,77 +0,0 @@
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Safemode - <tiles:insertAttribute name="title"/></title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/jquery-1.10.2.min.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/datepicker/datepicker.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/angular.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/angular-ui-utils.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/ui-utils-ieshiv.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/ui-bootstrap-tpls-0.10.0.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/bootstrap-angular.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/cxf-js/cxf-utils.js"></script>
|
||||
|
||||
<tiles:insertAttribute name="validator"/>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/scripts/bootstrap/css/bootstrap.css" >
|
||||
<!-- Javascript -->
|
||||
|
||||
<script type='text/javascript' src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script>
|
||||
<script type='text/javascript' src="${pageContext.request.contextPath}/static/scripts/css3-mediaqueries.js"></script>
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script type='text/javascript' src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<script type='text/javascript' src="http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div style="background-color: white">
|
||||
<header class="masthead header" style="height: 125px">
|
||||
<div class="container">
|
||||
<tiles:insertAttribute name="header" />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Begin Body -->
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<tiles:insertAttribute name="content" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<p>Copyright 2013 Safemode. Todos os direitos
|
||||
reservados.</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-md-10"
|
||||
style="width: initial; padding-right: 0;">
|
||||
<p>Desenvolvido por</p>
|
||||
</div>
|
||||
<div class="col-md-2"
|
||||
style="padding-left: 5px; margin-top: -12px;">
|
||||
<a href="http://www.evolute.pt/" target="_blank">
|
||||
<img alt="evolute" height="30" width="132" src="/safemode/static/styles/logo_w400.jpg">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,7 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<p>O email de recuperação de palavra passe foi enviado, por favor,
|
||||
verifique a sua conta de correio.</p>
|
||||
<a href="${addr}">Voltar</a>
|
||||
@ -1,2 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<style></style>
|
||||
@ -1,5 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<p>Ocorreu um erro ao fazer o download do ficheiro.</p>
|
||||
@ -1,6 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<p>Ocorreu um erro ao instalar a base de dados, por favor volte a tentar novamente.</p>
|
||||
<a href="${addr}">Voltar</a>
|
||||
@ -1,9 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<p>
|
||||
Ocorreu um erro ao enviar o email de recuperação da palavra passe, por favor
|
||||
volte a tentar novamente.
|
||||
</p>
|
||||
<a href="${pageContext.request.contextPath}/pages/home/homepage.do">Voltar</a>
|
||||
@ -1,6 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<p>Ocorreu um erro ao fazer o upload do ficheiro pdf.</p>
|
||||
<a href="${pageContext.request.contextPath}/pages/home/homepage.do">Voltar</a>
|
||||
@ -1,13 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
|
||||
<div class="row" style="margin-top: 12px;">
|
||||
<div class="col-md-7">
|
||||
<a class="brand" href="${pageContext.request.contextPath}/pages/home/homepage.do">
|
||||
<img alt="safemode" src="/safemode/static/styles/safemode.png">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<p class="safemode-lead text-right">Gestão de legislação</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,11 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
|
||||
<div class="row" style="margin-top: 12px;">
|
||||
<div class="col-md-7">
|
||||
<img alt="safemode" src="/safemode/static/styles/safemode.png">
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<p class="safemode-lead text-right">Gestão de legislação</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,9 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<tiles:insertAttribute name="main-content"/>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,147 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<div class="row" >
|
||||
<div class="col-sm-12" id="main_content">
|
||||
<tiles:insertAttribute name="main-content"/>
|
||||
</div>
|
||||
<div class="hidden" id="topten" style="min-height: 230px; padding: 5px;">
|
||||
<div class="panel navbar-default" style="background-color: #53616a;">
|
||||
<div class="panel-heading" style="color: #eeeeee; border-bottom: 1px solid; margin-bottom: 15px;">
|
||||
<h3 class="panel-title">Top 10</h3>
|
||||
</div>
|
||||
<div class="table" style="padding: 5px;">
|
||||
<div data-bind="foreach: items" style="overflow-y: auto">
|
||||
<p style="color: #eeeeee;">
|
||||
<span data-bind="text: $index() + 1"></span>.
|
||||
<a class="nav-link" data-bind="attr: { href: '/safemode/pages/legislacao/listagemDiploma.do?id='+_id }">
|
||||
<span data-bind="text: _tipo">
|
||||
N/A
|
||||
</span>
|
||||
Nº
|
||||
<span data-bind="text: _numero">
|
||||
N/A
|
||||
</span>
|
||||
de
|
||||
<span data-bind="text: moment(_dataPublicacao).format('YYYY-MM-DD') ">
|
||||
N/A
|
||||
</span>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hidden" id="favoritos" style="min-height: 230px; padding: 5px;">
|
||||
<div class="panel navbar-default" style="background-color: #53616a;">
|
||||
<div class="panel-heading" style="color: #eeeeee; border-bottom: 1px solid; margin-bottom: 15px;">
|
||||
<h3 class="panel-title">Diplomas Favoritos</h3>
|
||||
</div>
|
||||
<div class="table" style="padding: 5px;">
|
||||
<div data-bind="foreach: items, event: { scroll: scrolled }" style="overflow-y: auto">
|
||||
<p>
|
||||
<a class="nav-link" data-bind="attr: { href: '/safemode/pages/legislacao/listagemDiploma.do?id='+_id }">
|
||||
<span data-bind="text: _tipo">
|
||||
N/A
|
||||
</span>
|
||||
Nº
|
||||
<span data-bind="text: _numero">
|
||||
N/A
|
||||
</span>
|
||||
de
|
||||
<span data-bind="text: moment(_dataPublicacao).format('YYYY-MM-DD') ">
|
||||
N/A
|
||||
</span>
|
||||
</a>
|
||||
<button class="btn" style="color: #d9534f; padding: 4px; float: right; background-color: transparent;" type="button" data-bind="click: $root.clickAction">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
</button>
|
||||
<span data-bind="text: ">N/A</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
var webservice1, favoritos, topten;
|
||||
|
||||
webservice1 = new ws_safemode_pt__LegislacaoWS2();
|
||||
webservice1.url = "/safemode/safemode-ws/legislacao";
|
||||
|
||||
favoritos = {
|
||||
items: ko.observableArray([]),
|
||||
scrolled: function(data, event) {
|
||||
var elem;
|
||||
elem = event.target;
|
||||
if (elem.scrollTop > (elem.scrollHeight - elem.offsetHeight - 20)) {
|
||||
getItems();
|
||||
}
|
||||
},
|
||||
pendingRequest: ko.observable(false),
|
||||
max: ko.observable(false),
|
||||
clickAction: function( item )
|
||||
{
|
||||
console.log(item);
|
||||
webservice1.mudaEstadoFavorito( function( x, y )
|
||||
{
|
||||
favoritos.items.remove(item);
|
||||
}, function( x, y )
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, item._id, true );
|
||||
}
|
||||
};
|
||||
|
||||
function getItems() {
|
||||
if (!favoritos.pendingRequest()) {
|
||||
if (favoritos.max() === false) {
|
||||
webservice1.pesquisaFavoritos(function(result) {
|
||||
if (result._return._data.length !== 0) {
|
||||
ko.utils.arrayForEach(result._return._data, function(entry) {
|
||||
favoritos.items.push(entry);
|
||||
});
|
||||
} else {
|
||||
favoritos.max(true);
|
||||
}
|
||||
favoritos.pendingRequest(false);
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
favoritos.pendingRequest(false);
|
||||
}, favoritos.items().length, 20);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ko.applyBindings(favoritos, jQuery("#favoritos")[0]);
|
||||
|
||||
getItems();
|
||||
|
||||
topten = { items: ko.observableArray([]) };
|
||||
|
||||
webservice1.pesquisaTopTen(function(result) {
|
||||
ko.utils.arrayForEach(result._return._data, function(entry)
|
||||
{
|
||||
topten.items.push(entry);
|
||||
});
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
});
|
||||
|
||||
ko.applyBindings(topten, jQuery("#topten")[0]);
|
||||
|
||||
</script>
|
||||
@ -1,3 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<p>A fazer a instalação inicial...</p>
|
||||
<p>Por favor aguarde...</p>
|
||||
@ -1,54 +0,0 @@
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<div class="container container-login">
|
||||
<div class="row clearfix">
|
||||
<div class="col-md-2 column"> </div>
|
||||
<div class="col-md-8 column">
|
||||
<div class="panel panel-dark">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Login</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" name="login-form" id="login-form" method="post" action="${pageContext.request.contextPath}/j_spring_security_check" autocomplete="on">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label" for="username">Nome:</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control col-sm-10" id="username"
|
||||
name="username" placeholder="Nome do Utilizador" />
|
||||
<div class="input-group-addon" id="info"
|
||||
data-toggle="tooltip" title="Insira o nome do utilizador com que quer entrar.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-sm-3 control-label">Palavra-passe:</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" id="password"
|
||||
name="password" placeholder="Palavra-passe do Utilizador" />
|
||||
<div class="input-group-addon" id="info"
|
||||
data-toggle="tooltip" title="Insira a palavra-passe do utilizador com que quer entrar.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-2">
|
||||
<button type="submit" id="enter" class="btn btn-primary">Entrar</button>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<a href="${addr}" id="recover" class="btn btn-primary">Recuperar palavra-passe</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 column"> </div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,2 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<script type='text/javascript' src='${pageContext.request.contextPath}/static/scripts/safemode/login-validation.js'></script>
|
||||
@ -1,3 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<script type='text/javascript' src='${pageContext.request.contextPath}/static/scripts/safemode/cxf-utils.js'></script>
|
||||
<script type='text/javascript' src='${pageContext.request.contextPath}/static/scripts/safemode/UtilizadorWSImplService.js'></script>
|
||||
@ -1,125 +0,0 @@
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<div class="container container-login" data-ng-app="recoverPasswordTokenApp" data-ng-controller="recoverPasswordTokenCtrl">
|
||||
<div class="row clearfix">
|
||||
<div class="col-md-1 column"> </div>
|
||||
<div class="col-md-10 column">
|
||||
<div class="panel panel-dark">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Recuperar palavra-passe</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" novalidate="novalidate" name="form" id="form" autocomplete="off">
|
||||
<div class="form-group" data-ng-class="{'has-error': form.username.$invalid}">
|
||||
<label class="col-sm-3 control-label" for="username">Nome <span style="color: red;">*</span> </label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="text" data-ng-model="recoverInfoToken.username" class="form-control col-sm-10" id="username" name="username" required="required" placeholder="Nome do utilizador" />
|
||||
<div class="input-group-addon" title="Insira o seu nome de utilizador.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" data-ng-class="{'has-error': form.token.$invalid}">
|
||||
<label for="token" class="col-sm-3 control-label">Token <span style="color: red;">*</span> </label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="text" data-ng-model="recoverInfoToken.token" class="form-control" id="token" name="token" required="required" placeholder="Token do utilizador" />
|
||||
<div class="input-group-addon" title="Insira o token que recebeu por email.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" data-ng-class="{'has-error': form.password.$invalid}">
|
||||
<label for="password" class="col-sm-3 control-label">Palavra-passe <span style="color: red;">*</span> </label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="password" data-ng-model="recoverInfoToken.password" class="form-control" id="password" name="password" required="required" placeholder="A nova palavra-passe do utilizador" />
|
||||
<div class="input-group-addon" title="Insira a nova palavra passe do utilizador.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" data-ng-class="{'has-error': form.passwordRepeat.$invalid}">
|
||||
<label for="passwordRepeat" class="col-sm-3 control-label">Repita a palavra-passe <span style="color: red;">*</span> </label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="password" data-ng-model="recoverInfoToken.passwordRepeat" class="form-control" id="passwordRepeat" name="passwordRepeat" required="required" placeholder="Repita a nova palavra-passe do utilizador" />
|
||||
<div class="input-group-addon" title="Repita a nova palavra-passe do utilizador inserida acima.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-2">
|
||||
<button type="button" data-ng-click="change()" data-ng-disabled="form.$invalid || form.$pristine" class="btn btn-primary">Alterar</button>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<a href="${pageContext.request.contextPath}/pages/init/index.do" class="btn btn-primary">Cancelar</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 column"> </div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
$.noConflict();
|
||||
|
||||
var app = angular.module('recoverPasswordTokenApp', []);
|
||||
|
||||
app.controller('recoverPasswordTokenCtrl', ['$scope', function($scope) {
|
||||
|
||||
$scope.recoverInfoToken = {
|
||||
username: undefined,
|
||||
token: undefined,
|
||||
password: undefined,
|
||||
passwordRepeat: undefined
|
||||
};
|
||||
|
||||
$scope.change = function( )
|
||||
{
|
||||
if( $scope.recoverInfoToken.password !== $scope.recoverInfoToken.passwordRepeat )
|
||||
{
|
||||
alert("As passwords inseridas não são iguais!");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery("body").css("cursor", "wait");
|
||||
var wsClient = new ws_safemode_pt__UtilizadoresWS_impl_ws_safemode_pt__UtilizadorWSImplPort( );
|
||||
wsClient.recoverPassword(function(x, y)
|
||||
{
|
||||
if( x._return === true )
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
alert("Password alterada com sucesso!");
|
||||
window.location = "/safemode/pages/init/index.do";
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
alert("Ocorreu um erro ao alterar a password.");
|
||||
}
|
||||
}, function(x, y)
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.recoverInfoToken.username, $scope.recoverInfoToken.token, $scope.recoverInfoToken.password, $scope.recoverInfoToken.passwordRepeat );
|
||||
}
|
||||
};
|
||||
|
||||
}]);
|
||||
|
||||
</script>
|
||||
</div>
|
||||
@ -1,3 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<script type='text/javascript' src='${pageContext.request.contextPath}/static/scripts/safemode/cxf-utils.js'></script>
|
||||
<script type='text/javascript' src='${pageContext.request.contextPath}/static/scripts/safemode/UtilizadorWSImplService.js'></script>
|
||||
@ -1,113 +0,0 @@
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<div class="container container-login" data-ng-app="recoverPasswordApp" data-ng-controller="recoverPasswordCtrl">
|
||||
<div class="row clearfix">
|
||||
<div class="col-md-2 column"> </div>
|
||||
<div class="col-md-8 column">
|
||||
<div class="panel panel-dark">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Recuperar palavra-passe</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" novalidate="novalidate" name="form" id="form" autocomplete="off">
|
||||
<div class="form-group" data-ng-class="{'has-error': form.username.$invalid}">
|
||||
<label class="col-sm-3 control-label" for="username">Nome <span style="color: red;">*</span> </label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="text" data-ng-model="recoverInfo.username" class="form-control col-sm-10" id="username" name="username" required="required" placeholder="Nome do Utilizador" />
|
||||
<div class="input-group-addon" title="Insira o seu nome de utilizador.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" data-ng-class="{'has-error': form.email.$invalid}">
|
||||
<label for="email" class="col-sm-3 control-label">Email <span style="color: red;">*</span> </label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="email" data-ng-model="recoverInfo.email" class="form-control" id="email" name="email" required="required" placeholder="Email do Utilizador" />
|
||||
<div class="input-group-addon" title="Insira o email correspondente ao nome de utilizador.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-2">
|
||||
<button type="button" data-ng-click="send()" data-ng-disabled="form.$invalid || form.$pristine" class="btn btn-primary">Enviar</button>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<a href="${pageContext.request.contextPath}/pages/init/index.do" class="btn btn-primary">Cancelar</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 column"> </div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
$.noConflict();
|
||||
|
||||
var app = angular.module('recoverPasswordApp', []);
|
||||
|
||||
app.controller('recoverPasswordCtrl', ['$scope', function($scope) {
|
||||
|
||||
$scope.recoverInfo = {
|
||||
username: undefined,
|
||||
email: undefined
|
||||
};
|
||||
|
||||
$scope.send = function( )
|
||||
{
|
||||
jQuery("body").css("cursor", "wait");
|
||||
var wsClient = new ws_safemode_pt__UtilizadoresWS_impl_ws_safemode_pt__UtilizadorWSImplPort( );
|
||||
wsClient.verificarEmail(function(x, y)
|
||||
{
|
||||
if(x._return === true)
|
||||
{
|
||||
wsClient.sendEmail(function(x, y)
|
||||
{
|
||||
if( x._return === 1 )
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
alert("Foi enviado um email com a informação para a recuperação da palavra-passe\nPor favor verifique a sua caixa de email.");
|
||||
window.location = "/safemode/pages/init/index.do";
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
alert("Ocorreu um erro ao enviar o email.");
|
||||
}
|
||||
}, function(x, y)
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.recoverInfo.username );
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
alert("O email inserido não corresponde ao nome do utilizador indicado.");
|
||||
}
|
||||
}, function(x, y)
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.recoverInfo.username, $scope.recoverInfo.email );
|
||||
};
|
||||
|
||||
}]);
|
||||
|
||||
</script>
|
||||
</div>
|
||||
@ -1,6 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<p>Upload do ficheiro pdf feito com sucesso.</p>
|
||||
<a href="${pageContext.request.contextPath}/pages/home/homepage.do">Voltar</a>
|
||||
@ -1,54 +0,0 @@
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
||||
<div class="container container-login">
|
||||
<div class="row clearfix">
|
||||
<div class="col-md-2 column"> </div>
|
||||
<div class="col-md-8 column">
|
||||
<div class="panel panel-dark">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Login</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" name="login-form" id="login-form" method="post" action="${pageContext.request.contextPath}/j_spring_security_check" autocomplete="on">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label" for="username">Nome:</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control col-sm-10" id="username"
|
||||
name="username" placeholder="Nome do Utilizador" />
|
||||
<div class="input-group-addon" id="info"
|
||||
data-toggle="tooltip" title="Insira o nome do utilizador com que quer entrar.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-sm-3 control-label">Palavra-passe:</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" id="password"
|
||||
name="password" placeholder="Palavra-passe do Utilizador" />
|
||||
<div class="input-group-addon" id="info"
|
||||
data-toggle="tooltip" title="Insira a palavra-passe do utilizador com que quer entrar.">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-2">
|
||||
<button type="submit" id="enter" class="btn btn-primary">Entrar</button>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<a href="${addr}" id="recover" class="btn btn-primary">Recuperar palavra-passe</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 column"> </div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,617 +0,0 @@
|
||||
/*!
|
||||
* jQuery Validation Plugin 1.11.1
|
||||
*
|
||||
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
|
||||
* http://docs.jquery.com/Plugins/Validation
|
||||
*
|
||||
* Copyright 2013 Jörn Zaefferer
|
||||
* Released under the MIT license:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
function stripHtml(value) {
|
||||
// remove html tags and space chars
|
||||
return value.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' ')
|
||||
// remove punctuation
|
||||
.replace(/[.(),;:!?%#$'"_+=\/\-]*/g,'');
|
||||
}
|
||||
jQuery.validator.addMethod("maxWords", function(value, element, params) {
|
||||
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params;
|
||||
}, jQuery.validator.format("Please enter {0} words or less."));
|
||||
|
||||
jQuery.validator.addMethod("minWords", function(value, element, params) {
|
||||
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
|
||||
}, jQuery.validator.format("Please enter at least {0} words."));
|
||||
|
||||
jQuery.validator.addMethod("rangeWords", function(value, element, params) {
|
||||
var valueStripped = stripHtml(value);
|
||||
var regex = /\b\w+\b/g;
|
||||
return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1];
|
||||
}, jQuery.validator.format("Please enter between {0} and {1} words."));
|
||||
|
||||
}());
|
||||
|
||||
jQuery.validator.addMethod("letterswithbasicpunc", function(value, element) {
|
||||
return this.optional(element) || /^[a-z\-.,()'"\s]+$/i.test(value);
|
||||
}, "Letters or punctuation only please");
|
||||
|
||||
jQuery.validator.addMethod("alphanumeric", function(value, element) {
|
||||
return this.optional(element) || /^\w+$/i.test(value);
|
||||
}, "Letters, numbers, and underscores only please");
|
||||
|
||||
jQuery.validator.addMethod("lettersonly", function(value, element) {
|
||||
return this.optional(element) || /^[a-z]+$/i.test(value);
|
||||
}, "Letters only please");
|
||||
|
||||
jQuery.validator.addMethod("nowhitespace", function(value, element) {
|
||||
return this.optional(element) || /^\S+$/i.test(value);
|
||||
}, "No white space please");
|
||||
|
||||
jQuery.validator.addMethod("ziprange", function(value, element) {
|
||||
return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value);
|
||||
}, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");
|
||||
|
||||
jQuery.validator.addMethod("zipcodeUS", function(value, element) {
|
||||
return this.optional(element) || /\d{5}-\d{4}$|^\d{5}$/.test(value);
|
||||
}, "The specified US ZIP Code is invalid");
|
||||
|
||||
jQuery.validator.addMethod("integer", function(value, element) {
|
||||
return this.optional(element) || /^-?\d+$/.test(value);
|
||||
}, "A positive or negative non-decimal number please");
|
||||
|
||||
/**
|
||||
* Return true, if the value is a valid vehicle identification number (VIN).
|
||||
*
|
||||
* Works with all kind of text inputs.
|
||||
*
|
||||
* @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" />
|
||||
* @desc Declares a required input element whose value must be a valid vehicle identification number.
|
||||
*
|
||||
* @name jQuery.validator.methods.vinUS
|
||||
* @type Boolean
|
||||
* @cat Plugins/Validate/Methods
|
||||
*/
|
||||
jQuery.validator.addMethod("vinUS", function(v) {
|
||||
if (v.length !== 17) {
|
||||
return false;
|
||||
}
|
||||
var i, n, d, f, cd, cdv;
|
||||
var LL = ["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"];
|
||||
var VL = [1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9];
|
||||
var FL = [8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];
|
||||
var rs = 0;
|
||||
for(i = 0; i < 17; i++){
|
||||
f = FL[i];
|
||||
d = v.slice(i,i+1);
|
||||
if (i === 8) {
|
||||
cdv = d;
|
||||
}
|
||||
if (!isNaN(d)) {
|
||||
d *= f;
|
||||
} else {
|
||||
for (n = 0; n < LL.length; n++) {
|
||||
if (d.toUpperCase() === LL[n]) {
|
||||
d = VL[n];
|
||||
d *= f;
|
||||
if (isNaN(cdv) && n === 8) {
|
||||
cdv = LL[n];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
rs += d;
|
||||
}
|
||||
cd = rs % 11;
|
||||
if (cd === 10) {
|
||||
cd = "X";
|
||||
}
|
||||
if (cd === cdv) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}, "The specified vehicle identification number (VIN) is invalid.");
|
||||
|
||||
/**
|
||||
* Return true, if the value is a valid date, also making this formal check dd/mm/yyyy.
|
||||
*
|
||||
* @example jQuery.validator.methods.date("01/01/1900")
|
||||
* @result true
|
||||
*
|
||||
* @example jQuery.validator.methods.date("01/13/1990")
|
||||
* @result false
|
||||
*
|
||||
* @example jQuery.validator.methods.date("01.01.1900")
|
||||
* @result false
|
||||
*
|
||||
* @example <input name="pippo" class="{dateITA:true}" />
|
||||
* @desc Declares an optional input element whose value must be a valid date.
|
||||
*
|
||||
* @name jQuery.validator.methods.dateITA
|
||||
* @type Boolean
|
||||
* @cat Plugins/Validate/Methods
|
||||
*/
|
||||
jQuery.validator.addMethod("dateITA", function(value, element) {
|
||||
var check = false;
|
||||
var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
|
||||
if( re.test(value)) {
|
||||
var adata = value.split('/');
|
||||
var gg = parseInt(adata[0],10);
|
||||
var mm = parseInt(adata[1],10);
|
||||
var aaaa = parseInt(adata[2],10);
|
||||
var xdata = new Date(aaaa,mm-1,gg);
|
||||
if ( ( xdata.getFullYear() === aaaa ) && ( xdata.getMonth() === mm - 1 ) && ( xdata.getDate() === gg ) ){
|
||||
check = true;
|
||||
} else {
|
||||
check = false;
|
||||
}
|
||||
} else {
|
||||
check = false;
|
||||
}
|
||||
return this.optional(element) || check;
|
||||
}, "Please enter a correct date");
|
||||
|
||||
/**
|
||||
* IBAN is the international bank account number.
|
||||
* It has a country - specific format, that is checked here too
|
||||
*/
|
||||
jQuery.validator.addMethod("iban", function(value, element) {
|
||||
// some quick simple tests to prevent needless work
|
||||
if (this.optional(element)) {
|
||||
return true;
|
||||
}
|
||||
if (!(/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(value))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// check the country code and find the country specific format
|
||||
var iban = value.replace(/ /g,'').toUpperCase(); // remove spaces and to upper case
|
||||
var countrycode = iban.substring(0,2);
|
||||
var bbancountrypatterns = {
|
||||
'AL': "\\d{8}[\\dA-Z]{16}",
|
||||
'AD': "\\d{8}[\\dA-Z]{12}",
|
||||
'AT': "\\d{16}",
|
||||
'AZ': "[\\dA-Z]{4}\\d{20}",
|
||||
'BE': "\\d{12}",
|
||||
'BH': "[A-Z]{4}[\\dA-Z]{14}",
|
||||
'BA': "\\d{16}",
|
||||
'BR': "\\d{23}[A-Z][\\dA-Z]",
|
||||
'BG': "[A-Z]{4}\\d{6}[\\dA-Z]{8}",
|
||||
'CR': "\\d{17}",
|
||||
'HR': "\\d{17}",
|
||||
'CY': "\\d{8}[\\dA-Z]{16}",
|
||||
'CZ': "\\d{20}",
|
||||
'DK': "\\d{14}",
|
||||
'DO': "[A-Z]{4}\\d{20}",
|
||||
'EE': "\\d{16}",
|
||||
'FO': "\\d{14}",
|
||||
'FI': "\\d{14}",
|
||||
'FR': "\\d{10}[\\dA-Z]{11}\\d{2}",
|
||||
'GE': "[\\dA-Z]{2}\\d{16}",
|
||||
'DE': "\\d{18}",
|
||||
'GI': "[A-Z]{4}[\\dA-Z]{15}",
|
||||
'GR': "\\d{7}[\\dA-Z]{16}",
|
||||
'GL': "\\d{14}",
|
||||
'GT': "[\\dA-Z]{4}[\\dA-Z]{20}",
|
||||
'HU': "\\d{24}",
|
||||
'IS': "\\d{22}",
|
||||
'IE': "[\\dA-Z]{4}\\d{14}",
|
||||
'IL': "\\d{19}",
|
||||
'IT': "[A-Z]\\d{10}[\\dA-Z]{12}",
|
||||
'KZ': "\\d{3}[\\dA-Z]{13}",
|
||||
'KW': "[A-Z]{4}[\\dA-Z]{22}",
|
||||
'LV': "[A-Z]{4}[\\dA-Z]{13}",
|
||||
'LB': "\\d{4}[\\dA-Z]{20}",
|
||||
'LI': "\\d{5}[\\dA-Z]{12}",
|
||||
'LT': "\\d{16}",
|
||||
'LU': "\\d{3}[\\dA-Z]{13}",
|
||||
'MK': "\\d{3}[\\dA-Z]{10}\\d{2}",
|
||||
'MT': "[A-Z]{4}\\d{5}[\\dA-Z]{18}",
|
||||
'MR': "\\d{23}",
|
||||
'MU': "[A-Z]{4}\\d{19}[A-Z]{3}",
|
||||
'MC': "\\d{10}[\\dA-Z]{11}\\d{2}",
|
||||
'MD': "[\\dA-Z]{2}\\d{18}",
|
||||
'ME': "\\d{18}",
|
||||
'NL': "[A-Z]{4}\\d{10}",
|
||||
'NO': "\\d{11}",
|
||||
'PK': "[\\dA-Z]{4}\\d{16}",
|
||||
'PS': "[\\dA-Z]{4}\\d{21}",
|
||||
'PL': "\\d{24}",
|
||||
'PT': "\\d{21}",
|
||||
'RO': "[A-Z]{4}[\\dA-Z]{16}",
|
||||
'SM': "[A-Z]\\d{10}[\\dA-Z]{12}",
|
||||
'SA': "\\d{2}[\\dA-Z]{18}",
|
||||
'RS': "\\d{18}",
|
||||
'SK': "\\d{20}",
|
||||
'SI': "\\d{15}",
|
||||
'ES': "\\d{20}",
|
||||
'SE': "\\d{20}",
|
||||
'CH': "\\d{5}[\\dA-Z]{12}",
|
||||
'TN': "\\d{20}",
|
||||
'TR': "\\d{5}[\\dA-Z]{17}",
|
||||
'AE': "\\d{3}\\d{16}",
|
||||
'GB': "[A-Z]{4}\\d{14}",
|
||||
'VG': "[\\dA-Z]{4}\\d{16}"
|
||||
};
|
||||
var bbanpattern = bbancountrypatterns[countrycode];
|
||||
// As new countries will start using IBAN in the
|
||||
// future, we only check if the countrycode is known.
|
||||
// This prevents false negatives, while almost all
|
||||
// false positives introduced by this, will be caught
|
||||
// by the checksum validation below anyway.
|
||||
// Strict checking should return FALSE for unknown
|
||||
// countries.
|
||||
if (typeof bbanpattern !== 'undefined') {
|
||||
var ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", "");
|
||||
if (!(ibanregexp.test(iban))) {
|
||||
return false; // invalid country specific format
|
||||
}
|
||||
}
|
||||
|
||||
// now check the checksum, first convert to digits
|
||||
var ibancheck = iban.substring(4,iban.length) + iban.substring(0,4);
|
||||
var ibancheckdigits = "";
|
||||
var leadingZeroes = true;
|
||||
var charAt;
|
||||
for (var i =0; i<ibancheck.length; i++) {
|
||||
charAt = ibancheck.charAt(i);
|
||||
if (charAt !== "0") {
|
||||
leadingZeroes = false;
|
||||
}
|
||||
if (!leadingZeroes) {
|
||||
ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt);
|
||||
}
|
||||
}
|
||||
|
||||
// calculate the result of: ibancheckdigits % 97
|
||||
var cRest = '';
|
||||
var cOperator = '';
|
||||
for (var p=0; p<ibancheckdigits.length; p++) {
|
||||
var cChar = ibancheckdigits.charAt(p);
|
||||
cOperator = '' + cRest + '' + cChar;
|
||||
cRest = cOperator % 97;
|
||||
}
|
||||
return cRest === 1;
|
||||
}, "Please specify a valid IBAN");
|
||||
|
||||
jQuery.validator.addMethod("dateNL", function(value, element) {
|
||||
return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value);
|
||||
}, "Please enter a correct date");
|
||||
|
||||
/**
|
||||
* Dutch phone numbers have 10 digits (or 11 and start with +31).
|
||||
*/
|
||||
jQuery.validator.addMethod("phoneNL", function(value, element) {
|
||||
return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
|
||||
}, "Please specify a valid phone number.");
|
||||
|
||||
jQuery.validator.addMethod("mobileNL", function(value, element) {
|
||||
return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
|
||||
}, "Please specify a valid mobile number");
|
||||
|
||||
jQuery.validator.addMethod("postalcodeNL", function(value, element) {
|
||||
return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value);
|
||||
}, "Please specify a valid postal code");
|
||||
|
||||
/*
|
||||
* Dutch bank account numbers (not 'giro' numbers) have 9 digits
|
||||
* and pass the '11 check'.
|
||||
* We accept the notation with spaces, as that is common.
|
||||
* acceptable: 123456789 or 12 34 56 789
|
||||
*/
|
||||
jQuery.validator.addMethod("bankaccountNL", function(value, element) {
|
||||
if (this.optional(element)) {
|
||||
return true;
|
||||
}
|
||||
if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) {
|
||||
return false;
|
||||
}
|
||||
// now '11 check'
|
||||
var account = value.replace(/ /g,''); // remove spaces
|
||||
var sum = 0;
|
||||
var len = account.length;
|
||||
for (var pos=0; pos<len; pos++) {
|
||||
var factor = len - pos;
|
||||
var digit = account.substring(pos, pos+1);
|
||||
sum = sum + factor * digit;
|
||||
}
|
||||
return sum % 11 === 0;
|
||||
}, "Please specify a valid bank account number");
|
||||
|
||||
/**
|
||||
* Dutch giro account numbers (not bank numbers) have max 7 digits
|
||||
*/
|
||||
jQuery.validator.addMethod("giroaccountNL", function(value, element) {
|
||||
return this.optional(element) || /^[0-9]{1,7}$/.test(value);
|
||||
}, "Please specify a valid giro account number");
|
||||
|
||||
jQuery.validator.addMethod("bankorgiroaccountNL", function(value, element) {
|
||||
return this.optional(element) ||
|
||||
($.validator.methods["bankaccountNL"].call(this, value, element)) ||
|
||||
($.validator.methods["giroaccountNL"].call(this, value, element));
|
||||
}, "Please specify a valid bank or giro account number");
|
||||
|
||||
|
||||
jQuery.validator.addMethod("time", function(value, element) {
|
||||
return this.optional(element) || /^([01]\d|2[0-3])(:[0-5]\d){1,2}$/.test(value);
|
||||
}, "Please enter a valid time, between 00:00 and 23:59");
|
||||
jQuery.validator.addMethod("time12h", function(value, element) {
|
||||
return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value);
|
||||
}, "Please enter a valid time in 12-hour am/pm format");
|
||||
|
||||
/**
|
||||
* matches US phone number format
|
||||
*
|
||||
* where the area code may not start with 1 and the prefix may not start with 1
|
||||
* allows '-' or ' ' as a separator and allows parens around area code
|
||||
* some people may want to put a '1' in front of their number
|
||||
*
|
||||
* 1(212)-999-2345 or
|
||||
* 212 999 2344 or
|
||||
* 212-999-0983
|
||||
*
|
||||
* but not
|
||||
* 111-123-5434
|
||||
* and not
|
||||
* 212 123 4567
|
||||
*/
|
||||
jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
|
||||
phone_number = phone_number.replace(/\s+/g, "");
|
||||
return this.optional(element) || phone_number.length > 9 &&
|
||||
phone_number.match(/^(\+?1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
|
||||
}, "Please specify a valid phone number");
|
||||
|
||||
jQuery.validator.addMethod('phoneUK', function(phone_number, element) {
|
||||
phone_number = phone_number.replace(/\(|\)|\s+|-/g,'');
|
||||
return this.optional(element) || phone_number.length > 9 &&
|
||||
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/);
|
||||
}, 'Please specify a valid phone number');
|
||||
|
||||
jQuery.validator.addMethod('mobileUK', function(phone_number, element) {
|
||||
phone_number = phone_number.replace(/\(|\)|\s+|-/g,'');
|
||||
return this.optional(element) || phone_number.length > 9 &&
|
||||
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[45789]\d{2}|624)\s?\d{3}\s?\d{3})$/);
|
||||
}, 'Please specify a valid mobile number');
|
||||
|
||||
//Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers
|
||||
jQuery.validator.addMethod('phonesUK', function(phone_number, element) {
|
||||
phone_number = phone_number.replace(/\(|\)|\s+|-/g,'');
|
||||
return this.optional(element) || phone_number.length > 9 &&
|
||||
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[45789]\d{8}|624\d{6})))$/);
|
||||
}, 'Please specify a valid uk phone number');
|
||||
// On the above three UK functions, do the following server side processing:
|
||||
// Compare original input with this RegEx pattern:
|
||||
// ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
|
||||
// Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0'
|
||||
// Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
|
||||
// A number of very detailed GB telephone number RegEx patterns can also be found at:
|
||||
// http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
|
||||
|
||||
// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK)
|
||||
jQuery.validator.addMethod('postcodeUK', function(value, element) {
|
||||
return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value);
|
||||
}, 'Please specify a valid UK postcode');
|
||||
|
||||
// TODO check if value starts with <, otherwise don't try stripping anything
|
||||
jQuery.validator.addMethod("strippedminlength", function(value, element, param) {
|
||||
return jQuery(value).text().length >= param;
|
||||
}, jQuery.validator.format("Please enter at least {0} characters"));
|
||||
|
||||
// same as email, but TLD is optional
|
||||
jQuery.validator.addMethod("email2", function(value, element, param) {
|
||||
return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);
|
||||
}, jQuery.validator.messages.email);
|
||||
|
||||
// same as url, but TLD is optional
|
||||
jQuery.validator.addMethod("url2", function(value, element, param) {
|
||||
return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
|
||||
}, jQuery.validator.messages.url);
|
||||
|
||||
// NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
|
||||
// Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
|
||||
jQuery.validator.addMethod("creditcardtypes", function(value, element, param) {
|
||||
if (/[^0-9\-]+/.test(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
value = value.replace(/\D/g, "");
|
||||
|
||||
var validTypes = 0x0000;
|
||||
|
||||
if (param.mastercard) {
|
||||
validTypes |= 0x0001;
|
||||
}
|
||||
if (param.visa) {
|
||||
validTypes |= 0x0002;
|
||||
}
|
||||
if (param.amex) {
|
||||
validTypes |= 0x0004;
|
||||
}
|
||||
if (param.dinersclub) {
|
||||
validTypes |= 0x0008;
|
||||
}
|
||||
if (param.enroute) {
|
||||
validTypes |= 0x0010;
|
||||
}
|
||||
if (param.discover) {
|
||||
validTypes |= 0x0020;
|
||||
}
|
||||
if (param.jcb) {
|
||||
validTypes |= 0x0040;
|
||||
}
|
||||
if (param.unknown) {
|
||||
validTypes |= 0x0080;
|
||||
}
|
||||
if (param.all) {
|
||||
validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
|
||||
}
|
||||
if (validTypes & 0x0001 && /^(5[12345])/.test(value)) { //mastercard
|
||||
return value.length === 16;
|
||||
}
|
||||
if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa
|
||||
return value.length === 16;
|
||||
}
|
||||
if (validTypes & 0x0004 && /^(3[47])/.test(value)) { //amex
|
||||
return value.length === 15;
|
||||
}
|
||||
if (validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test(value)) { //dinersclub
|
||||
return value.length === 14;
|
||||
}
|
||||
if (validTypes & 0x0010 && /^(2(014|149))/.test(value)) { //enroute
|
||||
return value.length === 15;
|
||||
}
|
||||
if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover
|
||||
return value.length === 16;
|
||||
}
|
||||
if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb
|
||||
return value.length === 16;
|
||||
}
|
||||
if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb
|
||||
return value.length === 15;
|
||||
}
|
||||
if (validTypes & 0x0080) { //unknown
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}, "Please enter a valid credit card number.");
|
||||
|
||||
jQuery.validator.addMethod("ipv4", function(value, element, param) {
|
||||
return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value);
|
||||
}, "Please enter a valid IP v4 address.");
|
||||
|
||||
jQuery.validator.addMethod("ipv6", function(value, element, param) {
|
||||
return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value);
|
||||
}, "Please enter a valid IP v6 address.");
|
||||
|
||||
/**
|
||||
* Return true if the field value matches the given format RegExp
|
||||
*
|
||||
* @example jQuery.validator.methods.pattern("AR1004",element,/^AR\d{4}$/)
|
||||
* @result true
|
||||
*
|
||||
* @example jQuery.validator.methods.pattern("BR1004",element,/^AR\d{4}$/)
|
||||
* @result false
|
||||
*
|
||||
* @name jQuery.validator.methods.pattern
|
||||
* @type Boolean
|
||||
* @cat Plugins/Validate/Methods
|
||||
*/
|
||||
jQuery.validator.addMethod("pattern", function(value, element, param) {
|
||||
if (this.optional(element)) {
|
||||
return true;
|
||||
}
|
||||
if (typeof param === 'string') {
|
||||
param = new RegExp('^(?:' + param + ')$');
|
||||
}
|
||||
return param.test(value);
|
||||
}, "Invalid format.");
|
||||
|
||||
|
||||
/*
|
||||
* Lets you say "at least X inputs that match selector Y must be filled."
|
||||
*
|
||||
* The end result is that neither of these inputs:
|
||||
*
|
||||
* <input class="productinfo" name="partnumber">
|
||||
* <input class="productinfo" name="description">
|
||||
*
|
||||
* ...will validate unless at least one of them is filled.
|
||||
*
|
||||
* partnumber: {require_from_group: [1,".productinfo"]},
|
||||
* description: {require_from_group: [1,".productinfo"]}
|
||||
*
|
||||
*/
|
||||
jQuery.validator.addMethod("require_from_group", function(value, element, options) {
|
||||
var validator = this;
|
||||
var selector = options[1];
|
||||
var validOrNot = $(selector, element.form).filter(function() {
|
||||
return validator.elementValue(this);
|
||||
}).length >= options[0];
|
||||
|
||||
if(!$(element).data('being_validated')) {
|
||||
var fields = $(selector, element.form);
|
||||
fields.data('being_validated', true);
|
||||
fields.valid();
|
||||
fields.data('being_validated', false);
|
||||
}
|
||||
return validOrNot;
|
||||
}, jQuery.format("Please fill at least {0} of these fields."));
|
||||
|
||||
/*
|
||||
* Lets you say "either at least X inputs that match selector Y must be filled,
|
||||
* OR they must all be skipped (left blank)."
|
||||
*
|
||||
* The end result, is that none of these inputs:
|
||||
*
|
||||
* <input class="productinfo" name="partnumber">
|
||||
* <input class="productinfo" name="description">
|
||||
* <input class="productinfo" name="color">
|
||||
*
|
||||
* ...will validate unless either at least two of them are filled,
|
||||
* OR none of them are.
|
||||
*
|
||||
* partnumber: {skip_or_fill_minimum: [2,".productinfo"]},
|
||||
* description: {skip_or_fill_minimum: [2,".productinfo"]},
|
||||
* color: {skip_or_fill_minimum: [2,".productinfo"]}
|
||||
*
|
||||
*/
|
||||
jQuery.validator.addMethod("skip_or_fill_minimum", function(value, element, options) {
|
||||
var validator = this,
|
||||
numberRequired = options[0],
|
||||
selector = options[1];
|
||||
var numberFilled = $(selector, element.form).filter(function() {
|
||||
return validator.elementValue(this);
|
||||
}).length;
|
||||
var valid = numberFilled >= numberRequired || numberFilled === 0;
|
||||
|
||||
if(!$(element).data('being_validated')) {
|
||||
var fields = $(selector, element.form);
|
||||
fields.data('being_validated', true);
|
||||
fields.valid();
|
||||
fields.data('being_validated', false);
|
||||
}
|
||||
return valid;
|
||||
}, jQuery.format("Please either skip these fields or fill at least {0} of them."));
|
||||
|
||||
// Accept a value from a file input based on a required mimetype
|
||||
jQuery.validator.addMethod("accept", function(value, element, param) {
|
||||
// Split mime on commas in case we have multiple types we can accept
|
||||
var typeParam = typeof param === "string" ? param.replace(/\s/g, '').replace(/,/g, '|') : "image/*",
|
||||
optionalValue = this.optional(element),
|
||||
i, file;
|
||||
|
||||
// Element is optional
|
||||
if (optionalValue) {
|
||||
return optionalValue;
|
||||
}
|
||||
|
||||
if ($(element).attr("type") === "file") {
|
||||
// If we are using a wildcard, make it regex friendly
|
||||
typeParam = typeParam.replace(/\*/g, ".*");
|
||||
|
||||
// Check if the element has a FileList before checking each file
|
||||
if (element.files && element.files.length) {
|
||||
for (i = 0; i < element.files.length; i++) {
|
||||
file = element.files[i];
|
||||
|
||||
// Grab the mimetype from the loaded file, verify it matches
|
||||
if (!file.type.match(new RegExp( ".?(" + typeParam + ")$", "i"))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Either return true because we've validated each file, or because the
|
||||
// browser does not support element.files and the FileList feature
|
||||
return true;
|
||||
}, jQuery.format("Please enter a value with a valid mimetype."));
|
||||
|
||||
// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept
|
||||
jQuery.validator.addMethod("extension", function(value, element, param) {
|
||||
param = typeof param === "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif";
|
||||
return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
|
||||
}, jQuery.format("Please enter a value with a valid extension."));
|
||||
@ -1,433 +0,0 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: alert.js v3.0.3
|
||||
* http://getbootstrap.com/javascript/#alerts
|
||||
* ========================================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// ALERT CLASS DEFINITION
|
||||
// ======================
|
||||
|
||||
var dismiss = '[data-dismiss="alert"]'
|
||||
var Alert = function (el) {
|
||||
$(el).on('click', dismiss, this.close)
|
||||
}
|
||||
|
||||
Alert.prototype.close = function (e) {
|
||||
var $this = $(this)
|
||||
var selector = $this.attr('data-target')
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||
}
|
||||
|
||||
var $parent = $(selector)
|
||||
|
||||
if (e) e.preventDefault()
|
||||
|
||||
if (!$parent.length) {
|
||||
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
||||
}
|
||||
|
||||
$parent.trigger(e = $.Event('close.bs.alert'))
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent.removeClass('in')
|
||||
|
||||
function removeElement() {
|
||||
$parent.trigger('closed.bs.alert').remove()
|
||||
}
|
||||
|
||||
$.support.transition && $parent.hasClass('fade') ?
|
||||
$parent
|
||||
.one($.support.transition.end, removeElement)
|
||||
.emulateTransitionEnd(150) :
|
||||
removeElement()
|
||||
}
|
||||
|
||||
|
||||
// ALERT PLUGIN DEFINITION
|
||||
// =======================
|
||||
|
||||
var old = $.fn.alert
|
||||
|
||||
$.fn.alert = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.alert')
|
||||
|
||||
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.alert.Constructor = Alert
|
||||
|
||||
|
||||
// ALERT NO CONFLICT
|
||||
// =================
|
||||
|
||||
$.fn.alert.noConflict = function () {
|
||||
$.fn.alert = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// ALERT DATA-API
|
||||
// ==============
|
||||
|
||||
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
||||
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: dropdown.js v3.0.3
|
||||
* http://getbootstrap.com/javascript/#dropdowns
|
||||
* ========================================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// DROPDOWN CLASS DEFINITION
|
||||
// =========================
|
||||
|
||||
var backdrop = '.dropdown-backdrop'
|
||||
var toggle = '[data-toggle=dropdown]'
|
||||
var Dropdown = function (element) {
|
||||
$(element).on('click.bs.dropdown', this.toggle)
|
||||
}
|
||||
|
||||
Dropdown.prototype.toggle = function (e) {
|
||||
var $this = $(this)
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
var $parent = getParent($this)
|
||||
var isActive = $parent.hasClass('open')
|
||||
|
||||
clearMenus()
|
||||
|
||||
if (!isActive) {
|
||||
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
||||
// if mobile we use a backdrop because click events don't delegate
|
||||
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
||||
}
|
||||
|
||||
$parent.trigger(e = $.Event('show.bs.dropdown'))
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent
|
||||
.toggleClass('open')
|
||||
.trigger('shown.bs.dropdown')
|
||||
|
||||
$this.focus()
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
Dropdown.prototype.keydown = function (e) {
|
||||
if (!/(38|40|27)/.test(e.keyCode)) return
|
||||
|
||||
var $this = $(this)
|
||||
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
var $parent = getParent($this)
|
||||
var isActive = $parent.hasClass('open')
|
||||
|
||||
if (!isActive || (isActive && e.keyCode == 27)) {
|
||||
if (e.which == 27) $parent.find(toggle).focus()
|
||||
return $this.click()
|
||||
}
|
||||
|
||||
var $items = $('[role=menu] li:not(.divider):visible a', $parent)
|
||||
|
||||
if (!$items.length) return
|
||||
|
||||
var index = $items.index($items.filter(':focus'))
|
||||
|
||||
if (e.keyCode == 38 && index > 0) index-- // up
|
||||
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
||||
if (!~index) index=0
|
||||
|
||||
$items.eq(index).focus()
|
||||
}
|
||||
|
||||
function clearMenus() {
|
||||
$(backdrop).remove()
|
||||
$(toggle).each(function (e) {
|
||||
var $parent = getParent($(this))
|
||||
if (!$parent.hasClass('open')) return
|
||||
$parent.trigger(e = $.Event('hide.bs.dropdown'))
|
||||
if (e.isDefaultPrevented()) return
|
||||
$parent.removeClass('open').trigger('hidden.bs.dropdown')
|
||||
})
|
||||
}
|
||||
|
||||
function getParent($this) {
|
||||
var selector = $this.attr('data-target')
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
var $parent = selector && $(selector)
|
||||
|
||||
return $parent && $parent.length ? $parent : $this.parent()
|
||||
}
|
||||
|
||||
|
||||
// DROPDOWN PLUGIN DEFINITION
|
||||
// ==========================
|
||||
|
||||
var old = $.fn.dropdown
|
||||
|
||||
$.fn.dropdown = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.dropdown')
|
||||
|
||||
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.dropdown.Constructor = Dropdown
|
||||
|
||||
|
||||
// DROPDOWN NO CONFLICT
|
||||
// ====================
|
||||
|
||||
$.fn.dropdown.noConflict = function () {
|
||||
$.fn.dropdown = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
||||
// ===================================
|
||||
|
||||
$(document)
|
||||
.on('click.bs.dropdown.data-api', clearMenus)
|
||||
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||
.on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: collapse.js v3.0.3
|
||||
* http://getbootstrap.com/javascript/#collapse
|
||||
* ========================================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// COLLAPSE PUBLIC CLASS DEFINITION
|
||||
// ================================
|
||||
|
||||
var Collapse = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
||||
this.transitioning = null
|
||||
|
||||
if (this.options.parent) this.$parent = $(this.options.parent)
|
||||
if (this.options.toggle) this.toggle()
|
||||
}
|
||||
|
||||
Collapse.DEFAULTS = {
|
||||
toggle: true
|
||||
}
|
||||
|
||||
Collapse.prototype.dimension = function () {
|
||||
var hasWidth = this.$element.hasClass('width')
|
||||
return hasWidth ? 'width' : 'height'
|
||||
}
|
||||
|
||||
Collapse.prototype.show = function () {
|
||||
if (this.transitioning || this.$element.hasClass('in')) return
|
||||
|
||||
var startEvent = $.Event('show.bs.collapse')
|
||||
this.$element.trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
||||
|
||||
if (actives && actives.length) {
|
||||
var hasData = actives.data('bs.collapse')
|
||||
if (hasData && hasData.transitioning) return
|
||||
actives.collapse('hide')
|
||||
hasData || actives.data('bs.collapse', null)
|
||||
}
|
||||
|
||||
var dimension = this.dimension()
|
||||
|
||||
this.$element
|
||||
.removeClass('collapse')
|
||||
.addClass('collapsing')
|
||||
[dimension](0)
|
||||
|
||||
this.transitioning = 1
|
||||
|
||||
var complete = function () {
|
||||
this.$element
|
||||
.removeClass('collapsing')
|
||||
.addClass('in')
|
||||
[dimension]('auto')
|
||||
this.transitioning = 0
|
||||
this.$element.trigger('shown.bs.collapse')
|
||||
}
|
||||
|
||||
if (!$.support.transition) return complete.call(this)
|
||||
|
||||
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
||||
|
||||
this.$element
|
||||
.one($.support.transition.end, $.proxy(complete, this))
|
||||
.emulateTransitionEnd(350)
|
||||
[dimension](this.$element[0][scrollSize])
|
||||
}
|
||||
|
||||
Collapse.prototype.hide = function () {
|
||||
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||
|
||||
var startEvent = $.Event('hide.bs.collapse')
|
||||
this.$element.trigger(startEvent)
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
var dimension = this.dimension()
|
||||
|
||||
this.$element
|
||||
[dimension](this.$element[dimension]())
|
||||
[0].offsetHeight
|
||||
|
||||
this.$element
|
||||
.addClass('collapsing')
|
||||
.removeClass('collapse')
|
||||
.removeClass('in')
|
||||
|
||||
this.transitioning = 1
|
||||
|
||||
var complete = function () {
|
||||
this.transitioning = 0
|
||||
this.$element
|
||||
.trigger('hidden.bs.collapse')
|
||||
.removeClass('collapsing')
|
||||
.addClass('collapse')
|
||||
}
|
||||
|
||||
if (!$.support.transition) return complete.call(this)
|
||||
|
||||
this.$element
|
||||
[dimension](0)
|
||||
.one($.support.transition.end, $.proxy(complete, this))
|
||||
.emulateTransitionEnd(350)
|
||||
}
|
||||
|
||||
Collapse.prototype.toggle = function () {
|
||||
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
|
||||
// COLLAPSE PLUGIN DEFINITION
|
||||
// ==========================
|
||||
|
||||
var old = $.fn.collapse
|
||||
|
||||
$.fn.collapse = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.collapse')
|
||||
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
|
||||
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.collapse.Constructor = Collapse
|
||||
|
||||
|
||||
// COLLAPSE NO CONFLICT
|
||||
// ====================
|
||||
|
||||
$.fn.collapse.noConflict = function () {
|
||||
$.fn.collapse = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// COLLAPSE DATA-API
|
||||
// =================
|
||||
|
||||
$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
||||
var $this = $(this), href
|
||||
var target = $this.attr('data-target')
|
||||
|| e.preventDefault()
|
||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||
var $target = $(target)
|
||||
var data = $target.data('bs.collapse')
|
||||
var option = data ? 'toggle' : $this.data()
|
||||
var parent = $this.attr('data-parent')
|
||||
var $parent = parent && $(parent)
|
||||
|
||||
if (!data || !data.transitioning) {
|
||||
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
||||
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||
}
|
||||
|
||||
$target.collapse(option)
|
||||
})
|
||||
|
||||
}(jQuery);
|
||||
|
Before Width: | Height: | Size: 61 KiB |
@ -1,779 +0,0 @@
|
||||
if(typeof Object.create!=="function"){
|
||||
Object.create=function(o){
|
||||
function F(){
|
||||
};
|
||||
F.prototype=o;
|
||||
return new F();
|
||||
};
|
||||
}
|
||||
var ua={toString:function(){
|
||||
return navigator.userAgent;
|
||||
},test:function(s){
|
||||
return this.toString().toLowerCase().indexOf(s.toLowerCase())>-1;
|
||||
}};
|
||||
ua.version=(ua.toString().toLowerCase().match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];
|
||||
ua.webkit=ua.test("webkit");
|
||||
ua.gecko=ua.test("gecko")&&!ua.webkit;
|
||||
ua.opera=ua.test("opera");
|
||||
ua.ie=ua.test("msie")&&!ua.opera;
|
||||
ua.ie6=ua.ie&&document.compatMode&&typeof document.documentElement.style.maxHeight==="undefined";
|
||||
ua.ie7=ua.ie&&document.documentElement&&typeof document.documentElement.style.maxHeight!=="undefined"&&typeof XDomainRequest==="undefined";
|
||||
ua.ie8=ua.ie&&typeof XDomainRequest!=="undefined";
|
||||
var domReady=function(){
|
||||
var _1=[];
|
||||
var _2=function(){
|
||||
if(!arguments.callee.done){
|
||||
arguments.callee.done=true;
|
||||
for(var i=0;i<_1.length;i++){
|
||||
_1[i]();
|
||||
}
|
||||
}
|
||||
};
|
||||
if(document.addEventListener){
|
||||
document.addEventListener("DOMContentLoaded",_2,false);
|
||||
}
|
||||
if(ua.ie){
|
||||
(function(){
|
||||
try{
|
||||
document.documentElement.doScroll("left");
|
||||
}
|
||||
catch(e){
|
||||
setTimeout(arguments.callee,50);
|
||||
return;
|
||||
}
|
||||
_2();
|
||||
})();
|
||||
document.onreadystatechange=function(){
|
||||
if(document.readyState==="complete"){
|
||||
document.onreadystatechange=null;
|
||||
_2();
|
||||
}
|
||||
};
|
||||
}
|
||||
if(ua.webkit&&document.readyState){
|
||||
(function(){
|
||||
if(document.readyState!=="loading"){
|
||||
_2();
|
||||
}else{
|
||||
setTimeout(arguments.callee,10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
window.onload=_2;
|
||||
return function(fn){
|
||||
if(typeof fn==="function"){
|
||||
_1[_1.length]=fn;
|
||||
}
|
||||
return fn;
|
||||
};
|
||||
}();
|
||||
var cssHelper=function(){
|
||||
var _3={BLOCKS:/[^\s{][^{]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;)/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g};
|
||||
var _4,_5=false;
|
||||
var _6=[];
|
||||
var _7=function(fn){
|
||||
if(typeof fn==="function"){
|
||||
_6[_6.length]=fn;
|
||||
}
|
||||
};
|
||||
var _8=function(){
|
||||
for(var i=0;i<_6.length;i++){
|
||||
_6[i](_4);
|
||||
}
|
||||
};
|
||||
var _9={};
|
||||
var _a=function(n,v){
|
||||
if(_9[n]){
|
||||
var _b=_9[n].listeners;
|
||||
if(_b){
|
||||
for(var i=0;i<_b.length;i++){
|
||||
_b[i](v);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var _c=function(_d,_e,_f){
|
||||
if(ua.ie&&!window.XMLHttpRequest){
|
||||
window.XMLHttpRequest=function(){
|
||||
return new ActiveXObject("Microsoft.XMLHTTP");
|
||||
};
|
||||
}
|
||||
if(!XMLHttpRequest){
|
||||
return "";
|
||||
}
|
||||
var r=new XMLHttpRequest();
|
||||
try{
|
||||
r.open("get",_d,true);
|
||||
r.setRequestHeader("X_REQUESTED_WITH","XMLHttpRequest");
|
||||
}
|
||||
catch(e){
|
||||
_f();
|
||||
return;
|
||||
}
|
||||
var _10=false;
|
||||
setTimeout(function(){
|
||||
_10=true;
|
||||
},5000);
|
||||
document.documentElement.style.cursor="progress";
|
||||
r.onreadystatechange=function(){
|
||||
if(r.readyState===4&&!_10){
|
||||
if(!r.status&&location.protocol==="file:"||(r.status>=200&&r.status<300)||r.status===304||navigator.userAgent.indexOf("Safari")>-1&&typeof r.status==="undefined"){
|
||||
_e(r.responseText);
|
||||
}else{
|
||||
_f();
|
||||
}
|
||||
document.documentElement.style.cursor="";
|
||||
r=null;
|
||||
}
|
||||
};
|
||||
r.send("");
|
||||
};
|
||||
var _11=function(_12){
|
||||
_12=_12.replace(_3.REDUNDANT_COMPONENTS,"");
|
||||
_12=_12.replace(_3.REDUNDANT_WHITESPACE,"$1");
|
||||
_12=_12.replace(_3.MORE_WHITESPACE," ");
|
||||
_12=_12.replace(_3.FINAL_SEMICOLONS,"}");
|
||||
return _12;
|
||||
};
|
||||
var _13={mediaQueryList:function(s){
|
||||
var o={};
|
||||
var idx=s.indexOf("{");
|
||||
var lt=s.substring(0,idx);
|
||||
s=s.substring(idx+1,s.length-1);
|
||||
var mqs=[],rs=[];
|
||||
var qts=lt.toLowerCase().substring(7).split(",");
|
||||
for(var i=0;i<qts.length;i++){
|
||||
mqs[mqs.length]=_13.mediaQuery(qts[i],o);
|
||||
}
|
||||
var rts=s.match(_3.BLOCKS_INSIDE);
|
||||
if(rts!==null){
|
||||
for(i=0;i<rts.length;i++){
|
||||
rs[rs.length]=_13.rule(rts[i],o);
|
||||
}
|
||||
}
|
||||
o.getMediaQueries=function(){
|
||||
return mqs;
|
||||
};
|
||||
o.getRules=function(){
|
||||
return rs;
|
||||
};
|
||||
o.getListText=function(){
|
||||
return lt;
|
||||
};
|
||||
o.getCssText=function(){
|
||||
return s;
|
||||
};
|
||||
return o;
|
||||
},mediaQuery:function(s,mql){
|
||||
s=s||"";
|
||||
var not=false,_14;
|
||||
var exp=[];
|
||||
var _15=true;
|
||||
var _16=s.match(_3.NOT_WHITESPACE);
|
||||
for(var i=0;i<_16.length;i++){
|
||||
var _17=_16[i];
|
||||
if(!_14&&(_17==="not"||_17==="only")){
|
||||
if(_17==="not"){
|
||||
not=true;
|
||||
}
|
||||
}else{
|
||||
if(!_14){
|
||||
_14=_17;
|
||||
}else{
|
||||
if(_17.charAt(0)==="("){
|
||||
var _18=_17.substring(1,_17.length-1).split(":");
|
||||
exp[exp.length]={mediaFeature:_18[0],value:_18[1]||null};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {getList:function(){
|
||||
return mql||null;
|
||||
},getValid:function(){
|
||||
return _15;
|
||||
},getNot:function(){
|
||||
return not;
|
||||
},getMediaType:function(){
|
||||
return _14;
|
||||
},getExpressions:function(){
|
||||
return exp;
|
||||
}};
|
||||
},rule:function(s,mql){
|
||||
var o={};
|
||||
var idx=s.indexOf("{");
|
||||
var st=s.substring(0,idx);
|
||||
var ss=st.split(",");
|
||||
var ds=[];
|
||||
var dts=s.substring(idx+1,s.length-1).split(";");
|
||||
for(var i=0;i<dts.length;i++){
|
||||
ds[ds.length]=_13.declaration(dts[i],o);
|
||||
}
|
||||
o.getMediaQueryList=function(){
|
||||
return mql||null;
|
||||
};
|
||||
o.getSelectors=function(){
|
||||
return ss;
|
||||
};
|
||||
o.getSelectorText=function(){
|
||||
return st;
|
||||
};
|
||||
o.getDeclarations=function(){
|
||||
return ds;
|
||||
};
|
||||
o.getPropertyValue=function(n){
|
||||
for(var i=0;i<ds.length;i++){
|
||||
if(ds[i].getProperty()===n){
|
||||
return ds[i].getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
return o;
|
||||
},declaration:function(s,r){
|
||||
var idx=s.indexOf(":");
|
||||
var p=s.substring(0,idx);
|
||||
var v=s.substring(idx+1);
|
||||
return {getRule:function(){
|
||||
return r||null;
|
||||
},getProperty:function(){
|
||||
return p;
|
||||
},getValue:function(){
|
||||
return v;
|
||||
}};
|
||||
}};
|
||||
var _19=function(el){
|
||||
if(typeof el.cssHelperText!=="string"){
|
||||
return;
|
||||
}
|
||||
var o={mediaQueryLists:[],rules:[],selectors:{},declarations:[],properties:{}};
|
||||
var _1a=o.mediaQueryLists;
|
||||
var ors=o.rules;
|
||||
var _1b=el.cssHelperText.match(_3.BLOCKS);
|
||||
if(_1b!==null){
|
||||
for(var i=0;i<_1b.length;i++){
|
||||
if(_1b[i].substring(0,7)==="@media "){
|
||||
_1a[_1a.length]=_13.mediaQueryList(_1b[i]);
|
||||
ors=o.rules=ors.concat(_1a[_1a.length-1].getRules());
|
||||
}else{
|
||||
ors[ors.length]=_13.rule(_1b[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
var oss=o.selectors;
|
||||
var _1c=function(r){
|
||||
var ss=r.getSelectors();
|
||||
for(var i=0;i<ss.length;i++){
|
||||
var n=ss[i];
|
||||
if(!oss[n]){
|
||||
oss[n]=[];
|
||||
}
|
||||
oss[n][oss[n].length]=r;
|
||||
}
|
||||
};
|
||||
for(i=0;i<ors.length;i++){
|
||||
_1c(ors[i]);
|
||||
}
|
||||
var ods=o.declarations;
|
||||
for(i=0;i<ors.length;i++){
|
||||
ods=o.declarations=ods.concat(ors[i].getDeclarations());
|
||||
}
|
||||
var ops=o.properties;
|
||||
for(i=0;i<ods.length;i++){
|
||||
var n=ods[i].getProperty();
|
||||
if(!ops[n]){
|
||||
ops[n]=[];
|
||||
}
|
||||
ops[n][ops[n].length]=ods[i];
|
||||
}
|
||||
el.cssHelperParsed=o;
|
||||
_4[_4.length]=el;
|
||||
return o;
|
||||
};
|
||||
var _1d=function(el,s){
|
||||
el.cssHelperText=_11(s||el.innerHTML);
|
||||
return _19(el);
|
||||
};
|
||||
var _1e=function(){
|
||||
_5=true;
|
||||
_4=[];
|
||||
var _1f=[];
|
||||
var _20=function(){
|
||||
for(var i=0;i<_1f.length;i++){
|
||||
_19(_1f[i]);
|
||||
}
|
||||
var _21=document.getElementsByTagName("style");
|
||||
for(i=0;i<_21.length;i++){
|
||||
_1d(_21[i]);
|
||||
}
|
||||
_5=false;
|
||||
_8();
|
||||
};
|
||||
var _22=document.getElementsByTagName("link");
|
||||
for(var i=0;i<_22.length;i++){
|
||||
var _23=_22[i];
|
||||
if(_23.getAttribute("rel").indexOf("style")>-1&&_23.href&&_23.href.length!==0&&!_23.disabled){
|
||||
_1f[_1f.length]=_23;
|
||||
}
|
||||
}
|
||||
if(_1f.length>0){
|
||||
var c=0;
|
||||
var _24=function(){
|
||||
c++;
|
||||
if(c===_1f.length){
|
||||
_20();
|
||||
}
|
||||
};
|
||||
var _25=function(_26){
|
||||
var _27=_26.href;
|
||||
_c(_27,function(_28){
|
||||
_28=_11(_28).replace(_3.RELATIVE_URLS,"url("+_27.substring(0,_27.lastIndexOf("/"))+"/$1)");
|
||||
_26.cssHelperText=_28;
|
||||
_24();
|
||||
},_24);
|
||||
};
|
||||
for(i=0;i<_1f.length;i++){
|
||||
_25(_1f[i]);
|
||||
}
|
||||
}else{
|
||||
_20();
|
||||
}
|
||||
};
|
||||
var _29={mediaQueryLists:"array",rules:"array",selectors:"object",declarations:"array",properties:"object"};
|
||||
var _2a={mediaQueryLists:null,rules:null,selectors:null,declarations:null,properties:null};
|
||||
var _2b=function(_2c,v){
|
||||
if(_2a[_2c]!==null){
|
||||
if(_29[_2c]==="array"){
|
||||
return (_2a[_2c]=_2a[_2c].concat(v));
|
||||
}else{
|
||||
var c=_2a[_2c];
|
||||
for(var n in v){
|
||||
if(v.hasOwnProperty(n)){
|
||||
if(!c[n]){
|
||||
c[n]=v[n];
|
||||
}else{
|
||||
c[n]=c[n].concat(v[n]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return c;
|
||||
}
|
||||
}
|
||||
};
|
||||
var _2d=function(_2e){
|
||||
_2a[_2e]=(_29[_2e]==="array")?[]:{};
|
||||
for(var i=0;i<_4.length;i++){
|
||||
_2b(_2e,_4[i].cssHelperParsed[_2e]);
|
||||
}
|
||||
return _2a[_2e];
|
||||
};
|
||||
domReady(function(){
|
||||
var els=document.body.getElementsByTagName("*");
|
||||
for(var i=0;i<els.length;i++){
|
||||
els[i].checkedByCssHelper=true;
|
||||
}
|
||||
if(document.implementation.hasFeature("MutationEvents","2.0")||window.MutationEvent){
|
||||
document.body.addEventListener("DOMNodeInserted",function(e){
|
||||
var el=e.target;
|
||||
if(el.nodeType===1){
|
||||
_a("DOMElementInserted",el);
|
||||
el.checkedByCssHelper=true;
|
||||
}
|
||||
},false);
|
||||
}else{
|
||||
setInterval(function(){
|
||||
var els=document.body.getElementsByTagName("*");
|
||||
for(var i=0;i<els.length;i++){
|
||||
if(!els[i].checkedByCssHelper){
|
||||
_a("DOMElementInserted",els[i]);
|
||||
els[i].checkedByCssHelper=true;
|
||||
}
|
||||
}
|
||||
},1000);
|
||||
}
|
||||
});
|
||||
var _2f=function(d){
|
||||
if(typeof window.innerWidth!="undefined"){
|
||||
return window["inner"+d];
|
||||
}else{
|
||||
if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){
|
||||
return document.documentElement["client"+d];
|
||||
}
|
||||
}
|
||||
};
|
||||
return {addStyle:function(s,_30){
|
||||
var el=document.createElement("style");
|
||||
el.setAttribute("type","text/css");
|
||||
document.getElementsByTagName("head")[0].appendChild(el);
|
||||
if(el.styleSheet){
|
||||
el.styleSheet.cssText=s;
|
||||
}else{
|
||||
el.appendChild(document.createTextNode(s));
|
||||
}
|
||||
el.addedWithCssHelper=true;
|
||||
if(typeof _30==="undefined"||_30===true){
|
||||
cssHelper.parsed(function(_31){
|
||||
var o=_1d(el,s);
|
||||
for(var n in o){
|
||||
if(o.hasOwnProperty(n)){
|
||||
_2b(n,o[n]);
|
||||
}
|
||||
}
|
||||
_a("newStyleParsed",el);
|
||||
});
|
||||
}else{
|
||||
el.parsingDisallowed=true;
|
||||
}
|
||||
return el;
|
||||
},removeStyle:function(el){
|
||||
return el.parentNode.removeChild(el);
|
||||
},parsed:function(fn){
|
||||
if(_5){
|
||||
_7(fn);
|
||||
}else{
|
||||
if(typeof _4!=="undefined"){
|
||||
if(typeof fn==="function"){
|
||||
fn(_4);
|
||||
}
|
||||
}else{
|
||||
_7(fn);
|
||||
_1e();
|
||||
}
|
||||
}
|
||||
},mediaQueryLists:function(fn){
|
||||
cssHelper.parsed(function(_32){
|
||||
fn(_2a.mediaQueryLists||_2d("mediaQueryLists"));
|
||||
});
|
||||
},rules:function(fn){
|
||||
cssHelper.parsed(function(_33){
|
||||
fn(_2a.rules||_2d("rules"));
|
||||
});
|
||||
},selectors:function(fn){
|
||||
cssHelper.parsed(function(_34){
|
||||
fn(_2a.selectors||_2d("selectors"));
|
||||
});
|
||||
},declarations:function(fn){
|
||||
cssHelper.parsed(function(_35){
|
||||
fn(_2a.declarations||_2d("declarations"));
|
||||
});
|
||||
},properties:function(fn){
|
||||
cssHelper.parsed(function(_36){
|
||||
fn(_2a.properties||_2d("properties"));
|
||||
});
|
||||
},broadcast:_a,addListener:function(n,fn){
|
||||
if(typeof fn==="function"){
|
||||
if(!_9[n]){
|
||||
_9[n]={listeners:[]};
|
||||
}
|
||||
_9[n].listeners[_9[n].listeners.length]=fn;
|
||||
}
|
||||
},removeListener:function(n,fn){
|
||||
if(typeof fn==="function"&&_9[n]){
|
||||
var ls=_9[n].listeners;
|
||||
for(var i=0;i<ls.length;i++){
|
||||
if(ls[i]===fn){
|
||||
ls.splice(i,1);
|
||||
i-=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
},getViewportWidth:function(){
|
||||
return _2f("Width");
|
||||
},getViewportHeight:function(){
|
||||
return _2f("Height");
|
||||
}};
|
||||
}();
|
||||
domReady(function enableCssMediaQueries(){
|
||||
var _37;
|
||||
var _38={LENGTH_UNIT:/[0-9]+(em|ex|px|in|cm|mm|pt|pc)$/,RESOLUTION_UNIT:/[0-9]+(dpi|dpcm)$/,ASPECT_RATIO:/^[0-9]+\/[0-9]+$/,ABSOLUTE_VALUE:/^[0-9]*(\.[0-9]+)*$/};
|
||||
var _39=[];
|
||||
var _3a=function(){
|
||||
var id="css3-mediaqueries-test";
|
||||
var el=document.createElement("div");
|
||||
el.id=id;
|
||||
var _3b=cssHelper.addStyle("@media all and (width) { #"+id+" { width: 1px !important; } }",false);
|
||||
document.body.appendChild(el);
|
||||
var ret=el.offsetWidth===1;
|
||||
_3b.parentNode.removeChild(_3b);
|
||||
el.parentNode.removeChild(el);
|
||||
_3a=function(){
|
||||
return ret;
|
||||
};
|
||||
return ret;
|
||||
};
|
||||
var _3c=function(){
|
||||
_37=document.createElement("div");
|
||||
_37.style.cssText="position:absolute;top:-9999em;left:-9999em;"+"margin:0;border:none;padding:0;width:1em;font-size:1em;";
|
||||
document.body.appendChild(_37);
|
||||
if(_37.offsetWidth!==16){
|
||||
_37.style.fontSize=16/_37.offsetWidth+"em";
|
||||
}
|
||||
_37.style.width="";
|
||||
};
|
||||
var _3d=function(_3e){
|
||||
_37.style.width=_3e;
|
||||
var _3f=_37.offsetWidth;
|
||||
_37.style.width="";
|
||||
return _3f;
|
||||
};
|
||||
var _40=function(_41,_42){
|
||||
var l=_41.length;
|
||||
var min=(_41.substring(0,4)==="min-");
|
||||
var max=(!min&&_41.substring(0,4)==="max-");
|
||||
if(_42!==null){
|
||||
var _43;
|
||||
var _44;
|
||||
if(_38.LENGTH_UNIT.exec(_42)){
|
||||
_43="length";
|
||||
_44=_3d(_42);
|
||||
}else{
|
||||
if(_38.RESOLUTION_UNIT.exec(_42)){
|
||||
_43="resolution";
|
||||
_44=parseInt(_42,10);
|
||||
var _45=_42.substring((_44+"").length);
|
||||
}else{
|
||||
if(_38.ASPECT_RATIO.exec(_42)){
|
||||
_43="aspect-ratio";
|
||||
_44=_42.split("/");
|
||||
}else{
|
||||
if(_38.ABSOLUTE_VALUE){
|
||||
_43="absolute";
|
||||
_44=_42;
|
||||
}else{
|
||||
_43="unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var _46,_47;
|
||||
if("device-width"===_41.substring(l-12,l)){
|
||||
_46=screen.width;
|
||||
if(_42!==null){
|
||||
if(_43==="length"){
|
||||
return ((min&&_46>=_44)||(max&&_46<_44)||(!min&&!max&&_46===_44));
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return _46>0;
|
||||
}
|
||||
}else{
|
||||
if("device-height"===_41.substring(l-13,l)){
|
||||
_47=screen.height;
|
||||
if(_42!==null){
|
||||
if(_43==="length"){
|
||||
return ((min&&_47>=_44)||(max&&_47<_44)||(!min&&!max&&_47===_44));
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return _47>0;
|
||||
}
|
||||
}else{
|
||||
if("width"===_41.substring(l-5,l)){
|
||||
_46=document.documentElement.clientWidth||document.body.clientWidth;
|
||||
if(_42!==null){
|
||||
if(_43==="length"){
|
||||
return ((min&&_46>=_44)||(max&&_46<_44)||(!min&&!max&&_46===_44));
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return _46>0;
|
||||
}
|
||||
}else{
|
||||
if("height"===_41.substring(l-6,l)){
|
||||
_47=document.documentElement.clientHeight||document.body.clientHeight;
|
||||
if(_42!==null){
|
||||
if(_43==="length"){
|
||||
return ((min&&_47>=_44)||(max&&_47<_44)||(!min&&!max&&_47===_44));
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return _47>0;
|
||||
}
|
||||
}else{
|
||||
if("device-aspect-ratio"===_41.substring(l-19,l)){
|
||||
return _43==="aspect-ratio"&&screen.width*_44[1]===screen.height*_44[0];
|
||||
}else{
|
||||
if("color-index"===_41.substring(l-11,l)){
|
||||
var _48=Math.pow(2,screen.colorDepth);
|
||||
if(_42!==null){
|
||||
if(_43==="absolute"){
|
||||
return ((min&&_48>=_44)||(max&&_48<_44)||(!min&&!max&&_48===_44));
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return _48>0;
|
||||
}
|
||||
}else{
|
||||
if("color"===_41.substring(l-5,l)){
|
||||
var _49=screen.colorDepth;
|
||||
if(_42!==null){
|
||||
if(_43==="absolute"){
|
||||
return ((min&&_49>=_44)||(max&&_49<_44)||(!min&&!max&&_49===_44));
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return _49>0;
|
||||
}
|
||||
}else{
|
||||
if("resolution"===_41.substring(l-10,l)){
|
||||
var res;
|
||||
if(_45==="dpcm"){
|
||||
res=_3d("1cm");
|
||||
}else{
|
||||
res=_3d("1in");
|
||||
}
|
||||
if(_42!==null){
|
||||
if(_43==="resolution"){
|
||||
return ((min&&res>=_44)||(max&&res<_44)||(!min&&!max&&res===_44));
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return res>0;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var _4a=function(mq){
|
||||
var _4b=mq.getValid();
|
||||
var _4c=mq.getExpressions();
|
||||
var l=_4c.length;
|
||||
if(l>0){
|
||||
for(var i=0;i<l&&_4b;i++){
|
||||
_4b=_40(_4c[i].mediaFeature,_4c[i].value);
|
||||
}
|
||||
var not=mq.getNot();
|
||||
return (_4b&&!not||not&&!_4b);
|
||||
}
|
||||
};
|
||||
var _4d=function(mql){
|
||||
var mqs=mql.getMediaQueries();
|
||||
var t={};
|
||||
for(var i=0;i<mqs.length;i++){
|
||||
if(_4a(mqs[i])){
|
||||
t[mqs[i].getMediaType()]=true;
|
||||
}
|
||||
}
|
||||
var s=[],c=0;
|
||||
for(var n in t){
|
||||
if(t.hasOwnProperty(n)){
|
||||
if(c>0){
|
||||
s[c++]=",";
|
||||
}
|
||||
s[c++]=n;
|
||||
}
|
||||
}
|
||||
if(s.length>0){
|
||||
_39[_39.length]=cssHelper.addStyle("@media "+s.join("")+"{"+mql.getCssText()+"}",false);
|
||||
}
|
||||
};
|
||||
var _4e=function(_4f){
|
||||
for(var i=0;i<_4f.length;i++){
|
||||
_4d(_4f[i]);
|
||||
}
|
||||
if(ua.ie){
|
||||
document.documentElement.style.display="block";
|
||||
setTimeout(function(){
|
||||
document.documentElement.style.display="";
|
||||
},0);
|
||||
setTimeout(function(){
|
||||
cssHelper.broadcast("cssMediaQueriesTested");
|
||||
},100);
|
||||
}else{
|
||||
cssHelper.broadcast("cssMediaQueriesTested");
|
||||
}
|
||||
};
|
||||
var _50=function(){
|
||||
for(var i=0;i<_39.length;i++){
|
||||
cssHelper.removeStyle(_39[i]);
|
||||
}
|
||||
_39=[];
|
||||
cssHelper.mediaQueryLists(_4e);
|
||||
};
|
||||
var _51=0;
|
||||
var _52=function(){
|
||||
var _53=cssHelper.getViewportWidth();
|
||||
var _54=cssHelper.getViewportHeight();
|
||||
if(ua.ie){
|
||||
var el=document.createElement("div");
|
||||
el.style.position="absolute";
|
||||
el.style.top="-9999em";
|
||||
el.style.overflow="scroll";
|
||||
document.body.appendChild(el);
|
||||
_51=el.offsetWidth-el.clientWidth;
|
||||
document.body.removeChild(el);
|
||||
}
|
||||
var _55;
|
||||
var _56=function(){
|
||||
var vpw=cssHelper.getViewportWidth();
|
||||
var vph=cssHelper.getViewportHeight();
|
||||
if(Math.abs(vpw-_53)>_51||Math.abs(vph-_54)>_51){
|
||||
_53=vpw;
|
||||
_54=vph;
|
||||
clearTimeout(_55);
|
||||
_55=setTimeout(function(){
|
||||
if(!_3a()){
|
||||
_50();
|
||||
}else{
|
||||
cssHelper.broadcast("cssMediaQueriesTested");
|
||||
}
|
||||
},500);
|
||||
}
|
||||
};
|
||||
window.onresize=function(){
|
||||
var x=window.onresize||function(){
|
||||
};
|
||||
return function(){
|
||||
x();
|
||||
_56();
|
||||
};
|
||||
}();
|
||||
};
|
||||
var _57=document.documentElement;
|
||||
_57.style.marginLeft="-32767px";
|
||||
setTimeout(function(){
|
||||
_57.style.marginTop="";
|
||||
},20000);
|
||||
return function(){
|
||||
if(!_3a()){
|
||||
cssHelper.addListener("newStyleParsed",function(el){
|
||||
_4e(el.cssHelperParsed.mediaQueryLists);
|
||||
});
|
||||
cssHelper.addListener("cssMediaQueriesTested",function(){
|
||||
if(ua.ie){
|
||||
_57.style.width="1px";
|
||||
}
|
||||
setTimeout(function(){
|
||||
_57.style.width="";
|
||||
_57.style.marginLeft="";
|
||||
},0);
|
||||
cssHelper.removeListener("cssMediaQueriesTested",arguments.callee);
|
||||
});
|
||||
_3c();
|
||||
_50();
|
||||
}else{
|
||||
_57.style.marginLeft="";
|
||||
}
|
||||
_52();
|
||||
};
|
||||
}());
|
||||
try{
|
||||
document.execCommand("BackgroundImageCache",false,true);
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
|
||||
@ -1,169 +0,0 @@
|
||||
.datepicker {
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 4px;
|
||||
margin-top: 1px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
color: white;
|
||||
}
|
||||
.datepicker:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid #ccc;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
left: 6px;
|
||||
}
|
||||
.datepicker:after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid #ffffff;
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
left: 7px;
|
||||
}
|
||||
.datepicker > div {
|
||||
display: none;
|
||||
}
|
||||
.datepicker table {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
.datepicker td,
|
||||
.datepicker th {
|
||||
text-align: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.datepicker td.day:hover {
|
||||
background: #eeeeee;
|
||||
cursor: pointer;
|
||||
}
|
||||
.datepicker td.day.disabled {
|
||||
color: #eeeeee;
|
||||
}
|
||||
.datepicker td.old,
|
||||
.datepicker td.new {
|
||||
color: #999999;
|
||||
}
|
||||
.datepicker td.active,
|
||||
.datepicker td.active:hover {
|
||||
color: #ffffff;
|
||||
background-color: #006dcc;
|
||||
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
||||
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
|
||||
border-color: #0044cc #0044cc #002a80;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #0044cc;
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.datepicker td.active:hover,
|
||||
.datepicker td.active:hover:hover,
|
||||
.datepicker td.active:focus,
|
||||
.datepicker td.active:hover:focus,
|
||||
.datepicker td.active:active,
|
||||
.datepicker td.active:hover:active,
|
||||
.datepicker td.active.active,
|
||||
.datepicker td.active:hover.active,
|
||||
.datepicker td.active.disabled,
|
||||
.datepicker td.active:hover.disabled,
|
||||
.datepicker td.active[disabled],
|
||||
.datepicker td.active:hover[disabled] {
|
||||
color: #ffffff;
|
||||
background-color: #0044cc;
|
||||
*background-color: #003bb3;
|
||||
}
|
||||
.datepicker td.active:active,
|
||||
.datepicker td.active:hover:active,
|
||||
.datepicker td.active.active,
|
||||
.datepicker td.active:hover.active {
|
||||
background-color: #003399 \9;
|
||||
}
|
||||
.datepicker td span {
|
||||
display: block;
|
||||
width: 47px;
|
||||
height: 54px;
|
||||
line-height: 54px;
|
||||
float: left;
|
||||
margin: 2px;
|
||||
cursor: pointer;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.datepicker td span:hover {
|
||||
background: #eeeeee;
|
||||
}
|
||||
.datepicker td span.active {
|
||||
color: #ffffff;
|
||||
background-color: #006dcc;
|
||||
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
||||
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
|
||||
border-color: #0044cc #0044cc #002a80;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #0044cc;
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.datepicker td span.active:hover,
|
||||
.datepicker td span.active:focus,
|
||||
.datepicker td span.active:active,
|
||||
.datepicker td span.active.active,
|
||||
.datepicker td span.active.disabled,
|
||||
.datepicker td span.active[disabled] {
|
||||
color: #ffffff;
|
||||
background-color: #0044cc;
|
||||
*background-color: #003bb3;
|
||||
}
|
||||
.datepicker td span.active:active,
|
||||
.datepicker td span.active.active {
|
||||
background-color: #003399 \9;
|
||||
}
|
||||
.datepicker td span.old {
|
||||
color: #999999;
|
||||
}
|
||||
.datepicker th.switch {
|
||||
width: 145px;
|
||||
}
|
||||
.datepicker th.next,
|
||||
.datepicker th.prev {
|
||||
font-size: 21px;
|
||||
}
|
||||
.datepicker thead tr:first-child th {
|
||||
cursor: pointer;
|
||||
}
|
||||
.datepicker thead tr:first-child th:hover {
|
||||
background: #eeeeee;
|
||||
}
|
||||
.input-append.date .add-on i,
|
||||
.input-prepend.date .add-on i {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
@ -1,455 +0,0 @@
|
||||
!function( $ ) {
|
||||
|
||||
// Picker object
|
||||
|
||||
var Datepicker = function(element, options){
|
||||
this.element = $(element);
|
||||
this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
|
||||
this.picker = $(DPGlobal.template)
|
||||
.appendTo('body')
|
||||
.on({
|
||||
click: $.proxy(this.click, this)//,
|
||||
//mousedown: $.proxy(this.mousedown, this)
|
||||
});
|
||||
this.isInput = this.element.is('input');
|
||||
this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
|
||||
|
||||
if (this.isInput) {
|
||||
this.element.on({
|
||||
focus: $.proxy(this.show, this),
|
||||
//blur: $.proxy(this.hide, this),
|
||||
keyup: $.proxy(this.update, this)
|
||||
});
|
||||
} else {
|
||||
if (this.component){
|
||||
this.component.on('click', $.proxy(this.show, this));
|
||||
} else {
|
||||
this.element.on('click', $.proxy(this.show, this));
|
||||
}
|
||||
}
|
||||
|
||||
this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0;
|
||||
if (typeof this.minViewMode === 'string') {
|
||||
switch (this.minViewMode) {
|
||||
case 'months':
|
||||
this.minViewMode = 1;
|
||||
break;
|
||||
case 'years':
|
||||
this.minViewMode = 2;
|
||||
break;
|
||||
default:
|
||||
this.minViewMode = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.viewMode = options.viewMode||this.element.data('date-viewmode')||0;
|
||||
if (typeof this.viewMode === 'string') {
|
||||
switch (this.viewMode) {
|
||||
case 'months':
|
||||
this.viewMode = 1;
|
||||
break;
|
||||
case 'years':
|
||||
this.viewMode = 2;
|
||||
break;
|
||||
default:
|
||||
this.viewMode = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.startViewMode = this.viewMode;
|
||||
this.weekStart = options.weekStart||this.element.data('date-weekstart')||0;
|
||||
this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
|
||||
this.onRender = options.onRender;
|
||||
this.fillDow();
|
||||
this.fillMonths();
|
||||
this.update();
|
||||
this.showMode();
|
||||
};
|
||||
|
||||
Datepicker.prototype = {
|
||||
constructor: Datepicker,
|
||||
|
||||
show: function(e) {
|
||||
this.picker.show();
|
||||
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
|
||||
this.place();
|
||||
$(window).on('resize', $.proxy(this.place, this));
|
||||
if (e ) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
if (!this.isInput) {
|
||||
}
|
||||
var that = this;
|
||||
$(document).on('mousedown', function(ev){
|
||||
if ($(ev.target).closest('.datepicker').length == 0) {
|
||||
that.hide();
|
||||
}
|
||||
});
|
||||
this.element.trigger({
|
||||
type: 'show',
|
||||
date: this.date
|
||||
});
|
||||
},
|
||||
|
||||
hide: function(){
|
||||
this.picker.hide();
|
||||
$(window).off('resize', this.place);
|
||||
this.viewMode = this.startViewMode;
|
||||
this.showMode();
|
||||
if (!this.isInput) {
|
||||
$(document).off('mousedown', this.hide);
|
||||
}
|
||||
//this.set();
|
||||
this.element.trigger({
|
||||
type: 'hide',
|
||||
date: this.date
|
||||
});
|
||||
},
|
||||
|
||||
set: function() {
|
||||
var formated = DPGlobal.formatDate(this.date, this.format);
|
||||
if (!this.isInput) {
|
||||
if (this.component){
|
||||
this.element.find('input').prop('value', formated);
|
||||
}
|
||||
this.element.data('date', formated);
|
||||
} else {
|
||||
this.element.prop('value', formated);
|
||||
}
|
||||
},
|
||||
|
||||
setValue: function(newDate) {
|
||||
if (typeof newDate === 'string') {
|
||||
this.date = DPGlobal.parseDate(newDate, this.format);
|
||||
} else {
|
||||
this.date = new Date(newDate);
|
||||
}
|
||||
this.set();
|
||||
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
||||
this.fill();
|
||||
},
|
||||
|
||||
place: function(){
|
||||
var offset = this.component ? this.component.offset() : this.element.offset();
|
||||
this.picker.css({
|
||||
top: offset.top + this.height,
|
||||
left: offset.left
|
||||
});
|
||||
},
|
||||
|
||||
update: function(newDate){
|
||||
this.date = DPGlobal.parseDate(
|
||||
typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')),
|
||||
this.format
|
||||
);
|
||||
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
||||
this.fill();
|
||||
},
|
||||
|
||||
fillDow: function(){
|
||||
var dowCnt = this.weekStart;
|
||||
var html = '<tr>';
|
||||
while (dowCnt < this.weekStart + 7) {
|
||||
html += '<th class="dow">'+DPGlobal.dates.days[(dowCnt++)%7]+'</th>';
|
||||
}
|
||||
html += '</tr>';
|
||||
this.picker.find('.datepicker-days thead').append(html);
|
||||
},
|
||||
|
||||
fillMonths: function(){
|
||||
var html = '';
|
||||
var i = 0
|
||||
while (i < 12) {
|
||||
html += '<span class="month">'+DPGlobal.dates.monthsShort[i++]+'</span>';
|
||||
}
|
||||
this.picker.find('.datepicker-months td').append(html);
|
||||
},
|
||||
|
||||
fill: function() {
|
||||
var d = new Date(this.viewDate),
|
||||
year = d.getFullYear(),
|
||||
month = d.getMonth(),
|
||||
currentDate = this.date.valueOf();
|
||||
this.picker.find('.datepicker-days th:eq(1)')
|
||||
.text(DPGlobal.dates.months[month]+' '+year);
|
||||
var prevMonth = new Date(year, month-1, 28,0,0,0,0),
|
||||
day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
|
||||
prevMonth.setDate(day);
|
||||
prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
|
||||
var nextMonth = new Date(prevMonth);
|
||||
nextMonth.setDate(nextMonth.getDate() + 42);
|
||||
nextMonth = nextMonth.valueOf();
|
||||
var html = [];
|
||||
var clsName,
|
||||
prevY,
|
||||
prevM;
|
||||
while(prevMonth.valueOf() < nextMonth) {
|
||||
if (prevMonth.getDay() === this.weekStart) {
|
||||
html.push('<tr>');
|
||||
}
|
||||
clsName = this.onRender(prevMonth);
|
||||
prevY = prevMonth.getFullYear();
|
||||
prevM = prevMonth.getMonth();
|
||||
if ((prevM < month && prevY === year) || prevY < year) {
|
||||
clsName += ' old';
|
||||
} else if ((prevM > month && prevY === year) || prevY > year) {
|
||||
clsName += ' new';
|
||||
}
|
||||
if (prevMonth.valueOf() === currentDate) {
|
||||
clsName += ' active';
|
||||
}
|
||||
html.push('<td class="day '+clsName+'">'+prevMonth.getDate() + '</td>');
|
||||
if (prevMonth.getDay() === this.weekEnd) {
|
||||
html.push('</tr>');
|
||||
}
|
||||
prevMonth.setDate(prevMonth.getDate()+1);
|
||||
}
|
||||
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
|
||||
var currentYear = this.date.getFullYear();
|
||||
|
||||
var months = this.picker.find('.datepicker-months')
|
||||
.find('th:eq(1)')
|
||||
.text(year)
|
||||
.end()
|
||||
.find('span').removeClass('active');
|
||||
if (currentYear === year) {
|
||||
months.eq(this.date.getMonth()).addClass('active');
|
||||
}
|
||||
|
||||
html = '';
|
||||
year = parseInt(year/10, 10) * 10;
|
||||
var yearCont = this.picker.find('.datepicker-years')
|
||||
.find('th:eq(1)')
|
||||
.text(year + '-' + (year + 9))
|
||||
.end()
|
||||
.find('td');
|
||||
year -= 1;
|
||||
for (var i = -1; i < 11; i++) {
|
||||
html += '<span class="year'+(i === -1 || i === 10 ? ' old' : '')+(currentYear === year ? ' active' : '')+'">'+year+'</span>';
|
||||
year += 1;
|
||||
}
|
||||
yearCont.html(html);
|
||||
},
|
||||
|
||||
click: function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
var target = $(e.target).closest('span, td, th');
|
||||
if (target.length === 1) {
|
||||
switch(target[0].nodeName.toLowerCase()) {
|
||||
case 'th':
|
||||
switch(target[0].className) {
|
||||
case 'switch':
|
||||
this.showMode(1);
|
||||
break;
|
||||
case 'prev':
|
||||
case 'next':
|
||||
this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
|
||||
this.viewDate,
|
||||
this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
|
||||
DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1)
|
||||
);
|
||||
this.fill();
|
||||
this.set();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'span':
|
||||
if (target.is('.month')) {
|
||||
var month = target.parent().find('span').index(target);
|
||||
this.viewDate.setMonth(month);
|
||||
} else {
|
||||
var year = parseInt(target.text(), 10)||0;
|
||||
this.viewDate.setFullYear(year);
|
||||
}
|
||||
if (this.viewMode !== 0) {
|
||||
this.date = new Date(this.viewDate);
|
||||
this.element.trigger({
|
||||
type: 'changeDate',
|
||||
date: this.date,
|
||||
viewMode: DPGlobal.modes[this.viewMode].clsName
|
||||
});
|
||||
}
|
||||
this.showMode(-1);
|
||||
this.fill();
|
||||
this.set();
|
||||
break;
|
||||
case 'td':
|
||||
if (target.is('.day') && !target.is('.disabled')){
|
||||
var day = parseInt(target.text(), 10)||1;
|
||||
var month = this.viewDate.getMonth();
|
||||
if (target.is('.old')) {
|
||||
month -= 1;
|
||||
} else if (target.is('.new')) {
|
||||
month += 1;
|
||||
}
|
||||
var year = this.viewDate.getFullYear();
|
||||
this.date = new Date(year, month, day,0,0,0,0);
|
||||
this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0);
|
||||
this.fill();
|
||||
this.set();
|
||||
this.element.trigger({
|
||||
type: 'changeDate',
|
||||
date: this.date,
|
||||
viewMode: DPGlobal.modes[this.viewMode].clsName
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mousedown: function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
showMode: function(dir) {
|
||||
if (dir) {
|
||||
this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
|
||||
}
|
||||
this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.datepicker = function ( option, val ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('datepicker'),
|
||||
options = typeof option === 'object' && option;
|
||||
if (!data) {
|
||||
$this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
|
||||
}
|
||||
if (typeof option === 'string') data[option](val);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.datepicker.defaults = {
|
||||
onRender: function(date) {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
$.fn.datepicker.Constructor = Datepicker;
|
||||
|
||||
var DPGlobal = {
|
||||
modes: [
|
||||
{
|
||||
clsName: 'days',
|
||||
navFnc: 'Month',
|
||||
navStep: 1
|
||||
},
|
||||
{
|
||||
clsName: 'months',
|
||||
navFnc: 'FullYear',
|
||||
navStep: 1
|
||||
},
|
||||
{
|
||||
clsName: 'years',
|
||||
navFnc: 'FullYear',
|
||||
navStep: 10
|
||||
}],
|
||||
dates:{
|
||||
days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"],
|
||||
daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab", "Dom"],
|
||||
daysMin: ["Do", "Se", "Te", "Qa", "Qu", "Se", "Sa", "Do"],
|
||||
months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
|
||||
monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"]
|
||||
},
|
||||
isLeapYear: function (year) {
|
||||
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
|
||||
},
|
||||
getDaysInMonth: function (year, month) {
|
||||
return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
|
||||
},
|
||||
parseFormat: function(format){
|
||||
var separator = format.match(/[.\/\-\s].*?/),
|
||||
parts = format.split(/\W+/);
|
||||
if (!separator || !parts || parts.length === 0){
|
||||
throw new Error("Formato de fata inválido.");
|
||||
}
|
||||
return {separator: separator, parts: parts};
|
||||
},
|
||||
parseDate: function(date, format) {
|
||||
var parts = date.split(format.separator),
|
||||
date = new Date(),
|
||||
val;
|
||||
date.setHours(0);
|
||||
date.setMinutes(0);
|
||||
date.setSeconds(0);
|
||||
date.setMilliseconds(0);
|
||||
if (parts.length === format.parts.length) {
|
||||
var year = date.getFullYear(), day = date.getDate(), month = date.getMonth();
|
||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
val = parseInt(parts[i], 10)||1;
|
||||
switch(format.parts[i]) {
|
||||
case 'dd':
|
||||
case 'd':
|
||||
day = val;
|
||||
date.setDate(val);
|
||||
break;
|
||||
case 'mm':
|
||||
case 'm':
|
||||
month = val - 1;
|
||||
date.setMonth(val - 1);
|
||||
break;
|
||||
case 'yy':
|
||||
year = 2000 + val;
|
||||
date.setFullYear(2000 + val);
|
||||
break;
|
||||
case 'yyyy':
|
||||
year = val;
|
||||
date.setFullYear(val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
date = new Date(year, month, day, 0 ,0 ,0);
|
||||
}
|
||||
return date;
|
||||
},
|
||||
formatDate: function(date, format){
|
||||
var val = {
|
||||
d: date.getDate(),
|
||||
m: date.getMonth() + 1,
|
||||
yy: date.getFullYear().toString().substring(2),
|
||||
yyyy: date.getFullYear()
|
||||
};
|
||||
val.dd = (val.d < 10 ? '0' : '') + val.d;
|
||||
val.mm = (val.m < 10 ? '0' : '') + val.m;
|
||||
var date = [];
|
||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
date.push(val[format.parts[i]]);
|
||||
}
|
||||
return date.join(format.separator);
|
||||
},
|
||||
headTemplate: '<thead>'+
|
||||
'<tr>'+
|
||||
'<th class="prev">‹</th>'+
|
||||
'<th colspan="5" class="switch"></th>'+
|
||||
'<th class="next">›</th>'+
|
||||
'</tr>'+
|
||||
'</thead>',
|
||||
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
|
||||
};
|
||||
DPGlobal.template = '<div class="datepicker dropdown-menu">'+
|
||||
'<div class="datepicker-days">'+
|
||||
'<table class=" table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
'<tbody></tbody>'+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-months">'+
|
||||
'<table class="table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
DPGlobal.contTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-years">'+
|
||||
'<table class="table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
DPGlobal.contTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}( window.jQuery );
|
||||
@ -1,278 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
@ -1,7 +0,0 @@
|
||||
Copyright (c) 2006-2013 Martin Wendt (http://wwWendt.de)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 570 B |
@ -1,479 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Tree container
|
||||
*/
|
||||
ul.dynatree-container
|
||||
{
|
||||
font-family: tahoma, arial, helvetica;
|
||||
font-size: 10pt; /* font size should not be too big */
|
||||
white-space: nowrap;
|
||||
padding: 3px;
|
||||
margin: 0; /* issue 201 */
|
||||
background-color: white;
|
||||
border: 1px dotted gray;
|
||||
overflow: auto;
|
||||
height: 100%; /* issue 263 */
|
||||
}
|
||||
|
||||
ul.dynatree-container ul
|
||||
{
|
||||
padding: 0 0 0 16px;
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
ul.dynatree-container li
|
||||
{
|
||||
list-style-image: none;
|
||||
list-style-position: outside;
|
||||
list-style-type: none;
|
||||
-moz-background-clip:border;
|
||||
-moz-background-inline-policy: continuous;
|
||||
-moz-background-origin: padding;
|
||||
background-attachment: scroll;
|
||||
background-color: transparent;
|
||||
background-repeat: repeat-y;
|
||||
background-image: url("vline.gif");
|
||||
background-position: 0 0;
|
||||
/*
|
||||
background-image: url("icons_96x256.gif");
|
||||
background-position: -80px -64px;
|
||||
*/
|
||||
margin: 0;
|
||||
padding: 1px 0 0 0;
|
||||
|
||||
}
|
||||
/* Suppress lines for last child node */
|
||||
ul.dynatree-container li.dynatree-lastsib
|
||||
{
|
||||
background-image: none;
|
||||
}
|
||||
/* Suppress lines if level is fixed expanded (option minExpandLevel) */
|
||||
ul.dynatree-no-connector > li
|
||||
{
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
/* Style, when control is disabled */
|
||||
.ui-dynatree-disabled ul.dynatree-container
|
||||
{
|
||||
opacity: 0.5;
|
||||
/* filter: alpha(opacity=50); /* Yields a css warning */
|
||||
background-color: silver;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Common icon definitions
|
||||
*/
|
||||
span.dynatree-empty,
|
||||
span.dynatree-vline,
|
||||
span.dynatree-connector,
|
||||
span.dynatree-expander,
|
||||
span.dynatree-icon,
|
||||
span.dynatree-checkbox,
|
||||
span.dynatree-radio,
|
||||
span.dynatree-drag-helper-img,
|
||||
#dynatree-drop-marker
|
||||
{
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
/* display: -moz-inline-box; /* @ FF 1+2 removed for issue 221 */
|
||||
/* -moz-box-align: start; /* issue 221 */
|
||||
display: inline-block; /* Required to make a span sizeable */
|
||||
vertical-align: top;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left;
|
||||
background-image: url("icons.gif");
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
/** Used by 'icon' node option: */
|
||||
ul.dynatree-container img
|
||||
{
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-left: 3px;
|
||||
vertical-align: top;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Lines and connectors
|
||||
*/
|
||||
|
||||
span.dynatree-connector
|
||||
{
|
||||
background-position: -16px -64px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Expander icon
|
||||
* Note: IE6 doesn't correctly evaluate multiples class names,
|
||||
* so we create combined class names that can be used in the CSS.
|
||||
*
|
||||
* Prefix: dynatree-exp-
|
||||
* 1st character: 'e': expanded, 'c': collapsed
|
||||
* 2nd character (optional): 'd': lazy (Delayed)
|
||||
* 3rd character (optional): 'l': Last sibling
|
||||
*/
|
||||
|
||||
span.dynatree-expander
|
||||
{
|
||||
background-position: 0px -80px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */
|
||||
{
|
||||
background-position: 0px -96px;
|
||||
}
|
||||
.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */
|
||||
{
|
||||
background-position: -64px -80px;
|
||||
}
|
||||
.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */
|
||||
{
|
||||
background-position: -64px -96px;
|
||||
}
|
||||
.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */
|
||||
.dynatree-exp-ed span.dynatree-expander /* Expanded, delayed, not last sibling */
|
||||
{
|
||||
background-position: -32px -80px;
|
||||
}
|
||||
.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */
|
||||
.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */
|
||||
{
|
||||
background-position: -32px -96px;
|
||||
}
|
||||
.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */
|
||||
{
|
||||
background-position: 0 0;
|
||||
background-image: url("loading.gif");
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Checkbox icon
|
||||
*/
|
||||
span.dynatree-checkbox
|
||||
{
|
||||
margin-left: 3px;
|
||||
background-position: 0px -32px;
|
||||
}
|
||||
span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -16px -32px;
|
||||
}
|
||||
|
||||
.dynatree-partsel span.dynatree-checkbox
|
||||
{
|
||||
background-position: -64px -32px;
|
||||
}
|
||||
.dynatree-partsel span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -80px -32px;
|
||||
}
|
||||
|
||||
.dynatree-selected span.dynatree-checkbox
|
||||
{
|
||||
background-position: -32px -32px;
|
||||
}
|
||||
.dynatree-selected span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -48px -32px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Radiobutton icon
|
||||
* This is a customization, that may be activated by overriding the 'checkbox'
|
||||
* class name as 'dynatree-radio' in the tree options.
|
||||
*/
|
||||
span.dynatree-radio
|
||||
{
|
||||
margin-left: 3px;
|
||||
background-position: 0px -48px;
|
||||
}
|
||||
span.dynatree-radio:hover
|
||||
{
|
||||
background-position: -16px -48px;
|
||||
}
|
||||
|
||||
.dynatree-partsel span.dynatree-radio
|
||||
{
|
||||
background-position: -64px -48px;
|
||||
}
|
||||
.dynatree-partsel span.dynatree-radio:hover
|
||||
{
|
||||
background-position: -80px -48px;
|
||||
}
|
||||
|
||||
.dynatree-selected span.dynatree-radio
|
||||
{
|
||||
background-position: -32px -48px;
|
||||
}
|
||||
.dynatree-selected span.dynatree-radio:hover
|
||||
{
|
||||
background-position: -48px -48px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Node type icon
|
||||
* Note: IE6 doesn't correctly evaluate multiples class names,
|
||||
* so we create combined class names that can be used in the CSS.
|
||||
*
|
||||
* Prefix: dynatree-ico-
|
||||
* 1st character: 'e': expanded, 'c': collapsed
|
||||
* 2nd character (optional): 'f': folder
|
||||
*/
|
||||
|
||||
span.dynatree-icon /* Default icon */
|
||||
{
|
||||
margin-left: 3px;
|
||||
background-position: 0px 0px;
|
||||
}
|
||||
|
||||
.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */
|
||||
{
|
||||
background-position: 0px -16px;
|
||||
}
|
||||
|
||||
.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */
|
||||
{
|
||||
background-position: -64px -16px;
|
||||
}
|
||||
|
||||
/* Status node icons */
|
||||
|
||||
.dynatree-statusnode-wait span.dynatree-icon
|
||||
{
|
||||
background-image: url("loading.gif");
|
||||
}
|
||||
|
||||
.dynatree-statusnode-error span.dynatree-icon
|
||||
{
|
||||
background-position: 0px -112px;
|
||||
/* background-image: url("ltError.gif");*/
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Node titles
|
||||
*/
|
||||
|
||||
/* @Chrome: otherwise hit area of node titles is broken (issue 133)
|
||||
Removed again for issue 165; (133 couldn't be reproduced) */
|
||||
span.dynatree-node
|
||||
{
|
||||
/* display: -moz-inline-box; /* issue 133, 165, 172, 192. removed for issue 221*/
|
||||
/* -moz-box-align: start; /* issue 221 */
|
||||
display: inline-block; /* issue 373 Required to make a span sizeable */
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
/* Remove blue color and underline from title links */
|
||||
ul.dynatree-container a
|
||||
/*, ul.dynatree-container a:visited*/
|
||||
{
|
||||
color: black; /* inherit doesn't work on IE */
|
||||
text-decoration: none;
|
||||
vertical-align: top;
|
||||
margin: 0px;
|
||||
margin-left: 3px;
|
||||
/* outline: 0; /* @ Firefox, prevent dotted border after click */
|
||||
}
|
||||
|
||||
ul.dynatree-container a:hover
|
||||
{
|
||||
/* text-decoration: underline; */
|
||||
background-color: #F2F7FD; /* light blue */
|
||||
border-color: #B8D6FB; /* darker light blue */
|
||||
}
|
||||
|
||||
span.dynatree-node a
|
||||
{
|
||||
font-size: 10pt; /* required for IE, quirks mode */
|
||||
display: inline-block; /* Better alignment, when title contains <br> */
|
||||
/* vertical-align: top;*/
|
||||
padding-left: 3px;
|
||||
padding-right: 3px; /* Otherwise italic font will be outside bounds */
|
||||
/* line-height: 16px; /* should be the same as img height, in case 16 px */
|
||||
}
|
||||
span.dynatree-folder a
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.dynatree-container a:focus,
|
||||
span.dynatree-focused a:link /* @IE */
|
||||
{
|
||||
background-color: #EFEBDE; /* gray */
|
||||
}
|
||||
|
||||
span.dynatree-has-children a
|
||||
{
|
||||
}
|
||||
|
||||
span.dynatree-expanded a
|
||||
{
|
||||
}
|
||||
|
||||
span.dynatree-selected a
|
||||
{
|
||||
/* color: green; */
|
||||
/* font-style: italic; */
|
||||
/* font-weight:bold; */
|
||||
}
|
||||
|
||||
span.dynatree-active a
|
||||
{
|
||||
background-color: #3169C6 !important;
|
||||
color: white !important; /* @ IE6 */
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Drag'n'drop support
|
||||
*/
|
||||
|
||||
/*** Helper object ************************************************************/
|
||||
div.dynatree-drag-helper
|
||||
{
|
||||
}
|
||||
div.dynatree-drag-helper a
|
||||
{
|
||||
border: 1px solid gray;
|
||||
background-color: white;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
span.dynatree-drag-helper-img
|
||||
{
|
||||
/*
|
||||
position: relative;
|
||||
left: -16px;
|
||||
*/
|
||||
}
|
||||
div.dynatree-drag-helper /*.dynatree-drop-accept*/
|
||||
{
|
||||
|
||||
/* border-color: green;
|
||||
background-color: red;*/
|
||||
}
|
||||
div.dynatree-drop-accept span.dynatree-drag-helper-img
|
||||
{
|
||||
background-position: -32px -112px;
|
||||
}
|
||||
div.dynatree-drag-helper.dynatree-drop-reject
|
||||
{
|
||||
border-color: red;
|
||||
}
|
||||
div.dynatree-drop-reject span.dynatree-drag-helper-img
|
||||
{
|
||||
background-position: -16px -112px;
|
||||
}
|
||||
|
||||
/*** Drop marker icon *********************************************************/
|
||||
|
||||
#dynatree-drop-marker
|
||||
{
|
||||
width: 24px;
|
||||
position: absolute;
|
||||
background-position: 0 -128px;
|
||||
margin: 0;
|
||||
/* border: 1px solid red; */
|
||||
}
|
||||
#dynatree-drop-marker.dynatree-drop-after,
|
||||
#dynatree-drop-marker.dynatree-drop-before
|
||||
{
|
||||
width:64px;
|
||||
background-position: 0 -144px;
|
||||
}
|
||||
#dynatree-drop-marker.dynatree-drop-copy
|
||||
{
|
||||
background-position: -64px -128px;
|
||||
}
|
||||
#dynatree-drop-marker.dynatree-drop-move
|
||||
{
|
||||
background-position: -64px -128px;
|
||||
}
|
||||
|
||||
/*** Source node while dragging ***********************************************/
|
||||
|
||||
span.dynatree-drag-source
|
||||
{
|
||||
/* border: 1px dotted gray; */
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
span.dynatree-drag-source a
|
||||
{
|
||||
color: gray;
|
||||
}
|
||||
|
||||
/*** Target node while dragging cursor is over it *****************************/
|
||||
|
||||
span.dynatree-drop-target
|
||||
{
|
||||
/*border: 1px solid gray;*/
|
||||
}
|
||||
span.dynatree-drop-target a
|
||||
{
|
||||
}
|
||||
span.dynatree-drop-target.dynatree-drop-accept a
|
||||
{
|
||||
/*border: 1px solid green;*/
|
||||
background-color: #3169C6 !important;
|
||||
color: white !important; /* @ IE6 */
|
||||
text-decoration: none;
|
||||
}
|
||||
span.dynatree-drop-target.dynatree-drop-reject
|
||||
{
|
||||
/*border: 1px solid red;*/
|
||||
}
|
||||
span.dynatree-drop-target.dynatree-drop-after a
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Custom node classes (sample)
|
||||
*/
|
||||
|
||||
span.custom1 a
|
||||
{
|
||||
background-color: maroon;
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
|
||||
.list-group
|
||||
{
|
||||
padding-left: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.list-group ul
|
||||
{
|
||||
list-style-type: none;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.list-group ol
|
||||
{
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
|
||||
.list-group-menu:hover a
|
||||
{
|
||||
background-color:#cccccc;
|
||||
}
|
||||
|
||||
.dynatree-selected + ul li .dynatree-selected span span.dynatree-checkbox
|
||||
{
|
||||
background-position: -64px -32px;
|
||||
}
|
||||
|
||||
.dynatree-selected + ul li .dynatree-selected span span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -80px -32px;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 842 B |
|
Before Width: | Height: | Size: 844 B |
@ -1,572 +0,0 @@
|
||||
/**
|
||||
* h5Validate
|
||||
* @version v0.9.0
|
||||
* Using semantic versioning: http://semver.org/
|
||||
* @author Eric Hamilton http://ericleads.com/
|
||||
* @copyright 2010 - 2012 Eric Hamilton
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Developed under the sponsorship of RootMusic, Zumba Fitness, LLC, and Rese Property Management
|
||||
*/
|
||||
|
||||
/*global jQuery, window, console */
|
||||
(function ($) {
|
||||
'use strict';
|
||||
var console = window.console || function () {},
|
||||
h5 = { // Public API
|
||||
defaults : {
|
||||
debug: false,
|
||||
|
||||
RODom: false,
|
||||
|
||||
// HTML5-compatible validation pattern library that can be extended and/or overriden.
|
||||
patternLibrary : { //** TODO: Test the new regex patterns. Should I apply these to the new input types?
|
||||
// **TODO: password
|
||||
phone: /([\+][0-9]{1,3}([ \.\-])?)?([\(]{1}[0-9]{1,6}[\)])?([0-9A-Za-z \.\-]{1,32})(([A-Za-z \:]{1,11})?[0-9]{1,4}?)/,
|
||||
|
||||
// Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
|
||||
email: /((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?/,
|
||||
|
||||
// Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/iri/
|
||||
url: /(https?|ftp):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?/,
|
||||
|
||||
// Number, including positive, negative, and floating decimal. Credit: bassistance
|
||||
number: /-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?/,
|
||||
|
||||
// Date in ISO format. Credit: bassistance
|
||||
dateISO: /\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,
|
||||
|
||||
alpha: /[a-zA-Z]+/,
|
||||
alphaNumeric: /\w+/,
|
||||
integer: /-?\d+/
|
||||
},
|
||||
|
||||
// The prefix to use for dynamically-created class names.
|
||||
classPrefix: 'h5-',
|
||||
|
||||
errorClass: 'has-error', // No prefix for these.
|
||||
validClass: '', // "
|
||||
activeClass: 'active', // Prefix will get prepended.
|
||||
requiredClass: 'required',
|
||||
requiredAttribute: 'required',
|
||||
patternAttribute: 'pattern',
|
||||
|
||||
// Attribute which stores the ID of the error container element (without the hash).
|
||||
errorAttribute: 'data-h5-errorid',
|
||||
|
||||
// Events API
|
||||
customEvents: {
|
||||
'validate': true
|
||||
},
|
||||
|
||||
// Setup KB event delegation.
|
||||
kbSelectors: ':input:not(:button):not(:disabled):not(.novalidate)',
|
||||
focusout: true,
|
||||
focusin: false,
|
||||
change: true,
|
||||
keyup: false,
|
||||
activeKeyup: true,
|
||||
|
||||
// Setup mouse event delegation.
|
||||
mSelectors: '[type="range"]:not(:disabled):not(.novalidate), :radio:not(:disabled):not(.novalidate), :checkbox:not(:disabled):not(.novalidate), select:not(:disabled):not(.novalidate), option:not(:disabled):not(.novalidate)',
|
||||
click: true,
|
||||
|
||||
// What do we name the required .data variable?
|
||||
requiredVar: 'h5-required',
|
||||
|
||||
// What do we name the pattern .data variable?
|
||||
patternVar: 'h5-pattern',
|
||||
stripMarkup: true,
|
||||
|
||||
// Run submit related checks and prevent form submission if any fields are invalid?
|
||||
submit: true,
|
||||
|
||||
// Move focus to the first invalid field on submit?
|
||||
focusFirstInvalidElementOnSubmit: true,
|
||||
|
||||
// When submitting, validate elements that haven't been validated yet?
|
||||
validateOnSubmit: true,
|
||||
|
||||
// Callback stubs
|
||||
invalidCallback: function () {},
|
||||
validCallback: function () {},
|
||||
|
||||
// Elements to validate with allValid (only validating visible elements)
|
||||
allValidSelectors: ':input:visible:not(:button):not(:disabled):not(.novalidate)',
|
||||
|
||||
// Mark field invalid.
|
||||
// ** TODO: Highlight labels
|
||||
// ** TODO: Implement setCustomValidity as per the spec:
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#dom-cva-setcustomvalidity
|
||||
markInvalid: function markInvalid(options) {
|
||||
var $element = $(options.element),
|
||||
$errorID = $(options.errorID);
|
||||
$element.parent().addClass(options.errorClass);
|
||||
$element.removeClass(options.validClass);
|
||||
|
||||
// User needs help. Enable active validation.
|
||||
$element.addClass(options.settings.activeClass);
|
||||
|
||||
if ($errorID.length) { // These ifs are technically not needed, but improve server-side performance
|
||||
if ($element.attr('title')) {
|
||||
$errorID.text($element.attr('title'));
|
||||
}
|
||||
$errorID.show();
|
||||
}
|
||||
$element.data('valid', false);
|
||||
options.settings.invalidCallback.call(options.element, options.validity);
|
||||
return $element;
|
||||
},
|
||||
|
||||
// Mark field valid.
|
||||
markValid: function markValid(options) {
|
||||
var $element = $(options.element),
|
||||
$errorID = $(options.errorID);
|
||||
|
||||
$element.addClass(options.validClass);
|
||||
$element.parent().removeClass(options.errorClass);
|
||||
if ($errorID.length) {
|
||||
$errorID.hide();
|
||||
}
|
||||
$element.data('valid', true);
|
||||
options.settings.validCallback.call(options.element, options.validity);
|
||||
return $element;
|
||||
},
|
||||
|
||||
// Unmark field
|
||||
unmark: function unmark(options) {
|
||||
var $element = $(options.element);
|
||||
$element.parent().removeClass(options.errorClass);
|
||||
$element.removeClass(options.validClass);
|
||||
$element.form.find("#" + options.element.id).parent().removeClass(options.errorClass);
|
||||
$element.form.find("#" + options.element.id).removeClass(options.validClass);
|
||||
return $element;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Aliases
|
||||
defaults = h5.defaults,
|
||||
patternLibrary = defaults.patternLibrary,
|
||||
|
||||
createValidity = function createValidity(validity) {
|
||||
return $.extend({
|
||||
customError: validity.customError || false,
|
||||
patternMismatch: validity.patternMismatch || false,
|
||||
rangeOverflow: validity.rangeOverflow || false,
|
||||
rangeUnderflow: validity.rangeUnderflow || false,
|
||||
stepMismatch: validity.stepMismatch || false,
|
||||
tooLong: validity.tooLong || false,
|
||||
typeMismatch: validity.typeMismatch || false,
|
||||
valid: validity.valid || true,
|
||||
valueMissing: validity.valueMissing || false
|
||||
}, validity);
|
||||
},
|
||||
|
||||
methods = {
|
||||
/**
|
||||
* Check the validity of the current field
|
||||
* @param {object} settings instance settings
|
||||
* @param {object} options
|
||||
* .revalidate - trigger validation function first?
|
||||
* @return {Boolean}
|
||||
*/
|
||||
isValid: function (settings, options) {
|
||||
var $this = $(this);
|
||||
|
||||
options = (settings && options) || {};
|
||||
|
||||
// Revalidate defaults to true
|
||||
if (options.revalidate !== false) {
|
||||
$this.trigger('validate');
|
||||
}
|
||||
|
||||
return $this.data('valid'); // get the validation result
|
||||
},
|
||||
allValid: function (config, options) {
|
||||
var valid = true,
|
||||
formValidity = [],
|
||||
$this = $(this),
|
||||
$allFields,
|
||||
$filteredFields,
|
||||
radioNames = [],
|
||||
getValidity = function getValidity(e, data) {
|
||||
data.e = e;
|
||||
formValidity.push(data);
|
||||
},
|
||||
settings = $.extend({}, config, options); // allow options to override settings
|
||||
|
||||
options = options || {};
|
||||
|
||||
$this.trigger('formValidate', {settings: $.extend(true, {}, settings)});
|
||||
|
||||
// Make sure we're not triggering handlers more than we need to.
|
||||
$this.undelegate(settings.allValidSelectors,
|
||||
'.allValid', getValidity);
|
||||
$this.delegate(settings.allValidSelectors,
|
||||
'validated.allValid', getValidity);
|
||||
|
||||
$allFields = $this.find(settings.allValidSelectors);
|
||||
|
||||
// Filter radio buttons with the same name and keep only one,
|
||||
// since they will be checked as a group by isValid()
|
||||
$filteredFields = $allFields.filter(function(index) {
|
||||
var name;
|
||||
|
||||
if(this.tagName === "INPUT"
|
||||
&& this.type === "radio") {
|
||||
name = this.name;
|
||||
if(radioNames[name] === true) {
|
||||
return false;
|
||||
}
|
||||
radioNames[name] = true;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
$filteredFields.each(function () {
|
||||
var $this = $(this);
|
||||
valid = $this.h5Validate('isValid', options) && valid;
|
||||
});
|
||||
|
||||
$this.trigger('formValidated', {valid: valid, elements: formValidity});
|
||||
return valid;
|
||||
},
|
||||
validate: function (settings) {
|
||||
// Get the HTML5 pattern attribute if it exists.
|
||||
// ** TODO: If a pattern class exists, grab the pattern from the patternLibrary, but the pattern attrib should override that value.
|
||||
var $this = $(this),
|
||||
pattern = $this.filter('[pattern]')[0] ? $this.attr('pattern') : false,
|
||||
|
||||
// The pattern attribute must match the whole value, not just a subset:
|
||||
// "...as if it implied a ^(?: at the start of the pattern and a )$ at the end."
|
||||
re = new RegExp('^(?:' + pattern + ')$'),
|
||||
$radiosWithSameName = null,
|
||||
value = ($this.is('[type=checkbox]')) ?
|
||||
$this.is(':checked') : ($this.is('[type=radio]') ?
|
||||
// Cache all radio buttons (in the same form) with the same name as this one
|
||||
($radiosWithSameName = $this.parents('form')
|
||||
// **TODO: escape the radio buttons' name before using it in the jQuery selector
|
||||
.find('input[name="' + $this.attr('name') + '"]'))
|
||||
.filter(':checked')
|
||||
.length > 0 : $this.val()),
|
||||
errorClass = settings.errorClass,
|
||||
validClass = settings.validClass,
|
||||
errorIDbare = $this.attr(settings.errorAttribute) || false, // Get the ID of the error element.
|
||||
errorID = errorIDbare ? '#' + errorIDbare.replace(/(:|\.|\[|\])/g,'\\$1') : false, // Add the hash for convenience. This is done in two steps to avoid two attribute lookups.
|
||||
required = false,
|
||||
validity = createValidity({element: this, valid: true}),
|
||||
$checkRequired = $('<input required>'),
|
||||
maxlength;
|
||||
|
||||
/* If the required attribute exists, set it required to true, unless it's set 'false'.
|
||||
* This is a minor deviation from the spec, but it seems some browsers have falsey
|
||||
* required values if the attribute is empty (should be true). The more conformant
|
||||
* version of this failed sanity checking in the browser environment.
|
||||
* This plugin is meant to be practical, not ideologically married to the spec.
|
||||
*/
|
||||
// Feature fork
|
||||
if ($checkRequired.filter('[required]') && $checkRequired.filter('[required]').length) {
|
||||
required = ($this.filter('[required]').length && $this.attr('required') !== 'false');
|
||||
} else {
|
||||
required = ($this.attr('required') !== undefined);
|
||||
}
|
||||
|
||||
if (settings.debug && window.console) {
|
||||
console.log('Validate called on "' + value + '" with regex "' + re + '". Required: ' + required); // **DEBUG
|
||||
console.log('Regex test: ' + re.test(value) + ', Pattern: ' + pattern); // **DEBUG
|
||||
}
|
||||
|
||||
maxlength = parseInt($this.attr('maxlength'), 10);
|
||||
if (!isNaN(maxlength) && value.length > maxlength) {
|
||||
validity.valid = false;
|
||||
validity.tooLong = true;
|
||||
}
|
||||
|
||||
if (required && !value) {
|
||||
validity.valid = false;
|
||||
validity.valueMissing = true;
|
||||
} else if (pattern && !re.test(value) && value) {
|
||||
validity.valid = false;
|
||||
validity.patternMismatch = true;
|
||||
} else {
|
||||
if (!settings.RODom) {
|
||||
settings.markValid({
|
||||
element: this,
|
||||
validity: validity,
|
||||
errorClass: errorClass,
|
||||
validClass: validClass,
|
||||
errorID: errorID,
|
||||
settings: settings
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!validity.valid) {
|
||||
if (!settings.RODom) {
|
||||
settings.markInvalid({
|
||||
element: this,
|
||||
validity: validity,
|
||||
errorClass: errorClass,
|
||||
validClass: validClass,
|
||||
errorID: errorID,
|
||||
settings: settings
|
||||
});
|
||||
}
|
||||
}
|
||||
$this.trigger('validated', validity);
|
||||
|
||||
// If it's a radio button, also validate the other radio buttons with the same name
|
||||
// (while making sure the call is not recursive)
|
||||
if($radiosWithSameName !== null
|
||||
&& settings.alreadyCheckingRelatedRadioButtons !== true) {
|
||||
|
||||
settings.alreadyCheckingRelatedRadioButtons = true;
|
||||
|
||||
$radiosWithSameName
|
||||
.not($this)
|
||||
.trigger('validate');
|
||||
|
||||
settings.alreadyCheckingRelatedRadioButtons = false;
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Take the event preferences and delegate the events to selected
|
||||
* objects.
|
||||
*
|
||||
* @param {object} eventFlags The object containing event flags.
|
||||
*
|
||||
* @returns {element} The passed element (for method chaining).
|
||||
*/
|
||||
delegateEvents: function (selectors, eventFlags, element, settings) {
|
||||
var events = {},
|
||||
key = 0,
|
||||
validate = function () {
|
||||
settings.validate.call(this, settings);
|
||||
};
|
||||
$.each(eventFlags, function (key, value) {
|
||||
if (value) {
|
||||
events[key] = key;
|
||||
}
|
||||
});
|
||||
// key = 0;
|
||||
for (key in events) {
|
||||
if (events.hasOwnProperty(key)) {
|
||||
$(element).delegate(selectors, events[key] + '.h5Validate', validate);
|
||||
}
|
||||
}
|
||||
return element;
|
||||
},
|
||||
/**
|
||||
* Prepare for event delegation.
|
||||
*
|
||||
* @param {object} settings The full plugin state, including
|
||||
* options.
|
||||
*
|
||||
* @returns {object} jQuery object for chaining.
|
||||
*/
|
||||
bindDelegation: function (settings) {
|
||||
var $this = $(this),
|
||||
$forms;
|
||||
// Attach patterns from the library to elements.
|
||||
// **TODO: pattern / validation method matching should
|
||||
// take place inside the validate action.
|
||||
$.each(patternLibrary, function (key, value) {
|
||||
var pattern = value.toString();
|
||||
pattern = pattern.substring(1, pattern.length - 1);
|
||||
$('.' + settings.classPrefix + key).attr('pattern', pattern);
|
||||
});
|
||||
|
||||
$forms = $this.filter('form')
|
||||
.add($this.find('form'))
|
||||
.add($this.parents('form'));
|
||||
|
||||
$forms
|
||||
.attr('novalidate', 'novalidate')
|
||||
.submit(checkValidityOnSubmitHandler);
|
||||
|
||||
$forms.find("input[formnovalidate][type='submit']").click(function(){
|
||||
$(this).closest("form").unbind('submit', checkValidityOnSubmitHandler);
|
||||
});
|
||||
|
||||
return this.each(function () {
|
||||
var kbEvents = {
|
||||
focusout: settings.focusout,
|
||||
focusin: settings.focusin,
|
||||
change: settings.change,
|
||||
keyup: settings.keyup
|
||||
},
|
||||
mEvents = {
|
||||
click: settings.click
|
||||
},
|
||||
activeEvents = {
|
||||
keyup: settings.activeKeyup
|
||||
};
|
||||
|
||||
settings.delegateEvents(':input', settings.customEvents, this, settings);
|
||||
settings.delegateEvents(settings.kbSelectors, kbEvents, this, settings);
|
||||
settings.delegateEvents(settings.mSelectors, mEvents, this, settings);
|
||||
settings.delegateEvents(settings.activeClassSelector, activeEvents, this, settings);
|
||||
settings.delegateEvents('textarea[maxlength]', {keyup: true}, this, settings);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler for the form submit event.
|
||||
* When settings.submit is enabled:
|
||||
* - prevents submission if any invalid fields are found.
|
||||
* - Optionally validates all fields.
|
||||
* - Optionally moves focus to the first invalid field.
|
||||
*
|
||||
* @param {object} evt The jQuery Event object as from the submit event.
|
||||
*
|
||||
* @returns {object} undefined if no validation was done, true if validation passed, false if validation didn't.
|
||||
*/
|
||||
checkValidityOnSubmitHandler = function(evt) {
|
||||
|
||||
var $this,
|
||||
settings = getInstance.call(this),
|
||||
allValid;
|
||||
|
||||
if(settings.submit !== true) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this = $(this);
|
||||
allValid = $this.h5Validate('allValid', { revalidate: settings.validateOnSubmit === true });
|
||||
|
||||
if(allValid !== true) {
|
||||
evt.preventDefault();
|
||||
|
||||
if(settings.focusFirstInvalidElementOnSubmit === true){
|
||||
var $invalid = $(settings.allValidSelectors, $this)
|
||||
.filter(function(index){
|
||||
return $(this).h5Validate('isValid', { revalidate: false }) !== true;
|
||||
});
|
||||
|
||||
$invalid.first().focus();
|
||||
}
|
||||
}
|
||||
|
||||
return allValid;
|
||||
},
|
||||
|
||||
instances = [],
|
||||
|
||||
buildSettings = function buildSettings(options) {
|
||||
// Combine defaults and options to get current settings.
|
||||
var settings = $.extend({}, defaults, options, methods),
|
||||
activeClass = settings.classPrefix + settings.activeClass;
|
||||
|
||||
return $.extend(settings, {
|
||||
activeClass: activeClass,
|
||||
activeClassSelector: '.' + activeClass,
|
||||
requiredClass: settings.classPrefix + settings.requiredClass,
|
||||
el: this
|
||||
});
|
||||
},
|
||||
|
||||
getInstance = function getInstance() {
|
||||
var $parent = $(this).closest('[data-h5-instanceId]');
|
||||
return instances[$parent.attr('data-h5-instanceId')];
|
||||
},
|
||||
|
||||
setInstance = function setInstance(settings) {
|
||||
var instanceId = instances.push(settings) - 1;
|
||||
if (settings.RODom !== true) {
|
||||
$(this).attr('data-h5-instanceId', instanceId);
|
||||
}
|
||||
$(this).trigger('instance', { 'data-h5-instanceId': instanceId });
|
||||
};
|
||||
|
||||
$.h5Validate = {
|
||||
/**
|
||||
* Take a map of pattern names and HTML5-compatible regular
|
||||
* expressions, and add them to the patternLibrary. Patterns in
|
||||
* the library are automatically assigned to HTML element pattern
|
||||
* attributes for validation.
|
||||
*
|
||||
* @param {Object} patterns A map of pattern names and HTML5 compatible
|
||||
* regular expressions.
|
||||
*
|
||||
* @returns {Object} patternLibrary The modified pattern library
|
||||
*/
|
||||
addPatterns: function (patterns) {
|
||||
var patternLibrary = defaults.patternLibrary,
|
||||
key;
|
||||
for (key in patterns) {
|
||||
if (patterns.hasOwnProperty(key)) {
|
||||
patternLibrary[key] = patterns[key];
|
||||
}
|
||||
}
|
||||
return patternLibrary;
|
||||
},
|
||||
/**
|
||||
* Take a valid jQuery selector, and a list of valid values to
|
||||
* validate against.
|
||||
* If the user input isn't in the list, validation fails.
|
||||
*
|
||||
* @param {String} selector Any valid jQuery selector.
|
||||
*
|
||||
* @param {Array} values A list of valid values to validate selected
|
||||
* fields against.
|
||||
*/
|
||||
validValues: function (selector, values) {
|
||||
var i = 0,
|
||||
ln = values.length,
|
||||
pattern = '',
|
||||
re;
|
||||
// Build regex pattern
|
||||
for (i = 0; i < ln; i += 1) {
|
||||
pattern = pattern ? pattern + '|' + values[i] : values[i];
|
||||
}
|
||||
re = new RegExp('^(?:' + pattern + ')$');
|
||||
$(selector).data('regex', re);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.h5Validate = function h5Validate(options) {
|
||||
var action,
|
||||
args,
|
||||
settings;
|
||||
|
||||
if (typeof options === 'string' && typeof methods[options] === 'function') {
|
||||
// Whoah, hold on there! First we need to get the instance:
|
||||
settings = getInstance.call(this);
|
||||
|
||||
args = [].slice.call(arguments, 0);
|
||||
action = options;
|
||||
args.shift();
|
||||
args = $.merge([settings], args);
|
||||
|
||||
// Use settings here so we can plug methods into the instance dynamically?
|
||||
return settings[action].apply(this, args);
|
||||
}
|
||||
|
||||
settings = buildSettings.call(this, options);
|
||||
setInstance.call(this, settings);
|
||||
|
||||
// Returning the jQuery object allows for method chaining.
|
||||
return methods.bindDelegation.call(this, settings);
|
||||
};
|
||||
}(jQuery));
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('#createLeg').h5Validate();
|
||||
|
||||
$('#createLeg').submit(function( event )
|
||||
{
|
||||
//var leg = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
|
||||
|
||||
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
});
|
||||
@ -1,94 +0,0 @@
|
||||
// Knockout JavaScript library v3.0.0
|
||||
// (c) Steven Sanderson - http://knockoutjs.com/
|
||||
// License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
|
||||
(function() {(function(q){var y=this||(0,eval)("this"),w=y.document,K=y.navigator,u=y.jQuery,B=y.JSON;(function(q){"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?q(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],q):q(y.ko={})})(function(F){function G(a,c){return null===a||typeof a in N?a===c:!1}function H(b,c,d,e){a.d[b]={init:function(b){a.a.f.set(b,L,{});return{controlsDescendantBindings:!0}},update:function(b,h,k,m,f){k=a.a.f.get(b,L);h=a.a.c(h());
|
||||
m=!d!==!h;var p=!k.ob;if(p||c||m!==k.Db)p&&(k.ob=a.a.Ya(a.e.childNodes(b),!0)),m?(p||a.e.S(b,a.a.Ya(k.ob)),a.Ta(e?e(f,h):f,b)):a.e.Z(b),k.Db=m}};a.g.Y[b]=!1;a.e.P[b]=!0}var a="undefined"!==typeof F?F:{};a.b=function(b,c){for(var d=b.split("."),e=a,g=0;g<d.length-1;g++)e=e[d[g]];e[d[d.length-1]]=c};a.s=function(a,c,d){a[c]=d};a.version="3.0.0";a.b("version",a.version);a.a=function(){function b(a,b){for(var f in a)a.hasOwnProperty(f)&&b(f,a[f])}function c(k,b){if("input"!==a.a.v(k)||!k.type||"click"!=
|
||||
b.toLowerCase())return!1;var f=k.type;return"checkbox"==f||"radio"==f}var d={},e={};d[K&&/Firefox\/2/i.test(K.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];d.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");b(d,function(a,b){if(b.length)for(var f=0,c=b.length;f<c;f++)e[b[f]]=a});var g={propertychange:!0},h=w&&function(){for(var a=3,b=w.createElement("div"),f=b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+
|
||||
++a+"]><i></i><![endif]--\x3e",f[0];);return 4<a?a:q}();return{$a:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],n:function(a,b){for(var f=0,c=a.length;f<c;f++)b(a[f])},l:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var f=0,c=a.length;f<c;f++)if(a[f]===b)return f;return-1},Ua:function(a,b,f){for(var c=0,d=a.length;c<d;c++)if(b.call(f,a[c]))return a[c];return null},ia:function(b,c){var f=a.a.l(b,c);0<=f&&b.splice(f,1)},Va:function(b){b=
|
||||
b||[];for(var c=[],f=0,d=b.length;f<d;f++)0>a.a.l(c,b[f])&&c.push(b[f]);return c},ha:function(a,b){a=a||[];for(var f=[],c=0,d=a.length;c<d;c++)f.push(b(a[c]));return f},ga:function(a,b){a=a||[];for(var f=[],c=0,d=a.length;c<d;c++)b(a[c])&&f.push(a[c]);return f},X:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var f=0,c=b.length;f<c;f++)a.push(b[f]);return a},V:function(b,c,f){var d=a.a.l(a.a.Ha(b),c);0>d?f&&b.push(c):f||b.splice(d,1)},extend:function(a,b){if(b)for(var f in b)b.hasOwnProperty(f)&&
|
||||
(a[f]=b[f]);return a},K:b,Da:function(a,b){if(!a)return a;var f={},c;for(c in a)a.hasOwnProperty(c)&&(f[c]=b(a[c],c,a));return f},wa:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Vb:function(b){b=a.a.Q(b);for(var c=w.createElement("div"),f=0,d=b.length;f<d;f++)c.appendChild(a.L(b[f]));return c},Ya:function(b,c){for(var f=0,d=b.length,e=[];f<d;f++){var g=b[f].cloneNode(!0);e.push(c?a.L(g):g)}return e},S:function(b,c){a.a.wa(b);if(c)for(var f=0,d=c.length;f<d;f++)b.appendChild(c[f])},nb:function(b,
|
||||
c){var f=b.nodeType?[b]:b;if(0<f.length){for(var d=f[0],e=d.parentNode,g=0,n=c.length;g<n;g++)e.insertBefore(c[g],d);g=0;for(n=f.length;g<n;g++)a.removeNode(f[g])}},$:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);if(1<a.length){var f=a[0],c=a[a.length-1];for(a.length=0;f!==c;)if(a.push(f),f=f.nextSibling,!f)return;a.push(c)}}return a},qb:function(a,b){7>h?a.setAttribute("selected",b):a.selected=b},la:function(a){return null===a||a===
|
||||
q?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},ec:function(b,c){for(var f=[],d=(b||"").split(c),e=0,g=d.length;e<g;e++){var n=a.a.la(d[e]);""!==n&&f.push(n)}return f},ac:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},Gb:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(3===a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;
|
||||
return!!a},va:function(b){return a.a.Gb(b,b.ownerDocument.documentElement)},Ra:function(b){return!!a.a.Ua(b,a.a.va)},v:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},r:function(b,d,f){var e=h&&g[d];if(e||"undefined"==typeof u)if(e||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var s=function(a){f.call(b,a)},l="on"+d;b.attachEvent(l,s);a.a.C.ea(b,function(){b.detachEvent(l,s)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else b.addEventListener(d,
|
||||
f,!1);else{if(c(b,d)){var n=f;f=function(a,b){var f=this.checked;b&&(this.checked=!0!==b.Ab);n.call(this,a);this.checked=f}}u(b).bind(d,f)}},da:function(a,b){if(!a||!a.nodeType)throw Error("element must be a DOM node when calling triggerEvent");if("undefined"!=typeof u){var f=[];c(a,b)&&f.push({Ab:a.checked});u(a).trigger(b,f)}else if("function"==typeof w.createEvent)if("function"==typeof a.dispatchEvent)f=w.createEvent(e[b]||"HTMLEvents"),f.initEvent(b,!0,!0,y,0,0,0,0,0,!1,!1,!1,!1,0,a),a.dispatchEvent(f);
|
||||
else throw Error("The supplied element doesn't support dispatchEvent");else if("undefined"!=typeof a.fireEvent)c(a,b)&&(a.checked=!0!==a.checked),a.fireEvent("on"+b);else throw Error("Browser doesn't support triggering events");},c:function(b){return a.M(b)?b():b},Ha:function(b){return a.M(b)?b.t():b},ma:function(b,c,f){if(c){var d=/\S+/g,e=b.className.match(d)||[];a.a.n(c.match(d),function(b){a.a.V(e,b,f)});b.className=e.join(" ")}},Ma:function(b,c){var f=a.a.c(c);if(null===f||f===q)f="";var d=a.e.firstChild(b);
|
||||
!d||3!=d.nodeType||a.e.nextSibling(d)?a.e.S(b,[w.createTextNode(f)]):d.data=f;a.a.Jb(b)},pb:function(a,b){a.name=b;if(7>=h)try{a.mergeAttributes(w.createElement("<input name='"+a.name+"'/>"),!1)}catch(f){}},Jb:function(a){9<=h&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},Hb:function(a){if(h){var b=a.style.width;a.style.width=0;a.style.width=b}},Zb:function(b,c){b=a.a.c(b);c=a.a.c(c);for(var f=[],d=b;d<=c;d++)f.push(d);return f},Q:function(a){for(var b=[],c=0,d=a.length;c<
|
||||
d;c++)b.push(a[c]);return b},cc:6===h,dc:7===h,ja:h,ab:function(b,c){for(var f=a.a.Q(b.getElementsByTagName("input")).concat(a.a.Q(b.getElementsByTagName("textarea"))),d="string"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},e=[],g=f.length-1;0<=g;g--)d(f[g])&&e.push(f[g]);return e},Wb:function(b){return"string"==typeof b&&(b=a.a.la(b))?B&&B.parse?B.parse(b):(new Function("return "+b))():null},Na:function(b,c,f){if(!B||!B.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
|
||||
return B.stringify(a.a.c(b),c,f)},Xb:function(c,d,f){f=f||{};var e=f.params||{},g=f.includeFields||this.$a,h=c;if("object"==typeof c&&"form"===a.a.v(c))for(var h=c.action,n=g.length-1;0<=n;n--)for(var r=a.a.ab(c,g[n]),v=r.length-1;0<=v;v--)e[r[v].name]=r[v].value;d=a.a.c(d);var t=w.createElement("form");t.style.display="none";t.action=h;t.method="post";for(var E in d)c=w.createElement("input"),c.name=E,c.value=a.a.Na(a.a.c(d[E])),t.appendChild(c);b(e,function(a,b){var c=w.createElement("input");c.name=
|
||||
a;c.value=b;t.appendChild(c)});w.body.appendChild(t);f.submitter?f.submitter(t):t.submit();setTimeout(function(){t.parentNode.removeChild(t)},0)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.n);a.b("utils.arrayFirst",a.a.Ua);a.b("utils.arrayFilter",a.a.ga);a.b("utils.arrayGetDistinctValues",a.a.Va);a.b("utils.arrayIndexOf",a.a.l);a.b("utils.arrayMap",a.a.ha);a.b("utils.arrayPushAll",a.a.X);a.b("utils.arrayRemoveItem",a.a.ia);a.b("utils.extend",a.a.extend);a.b("utils.fieldsIncludedWithJsonPost",
|
||||
a.a.$a);a.b("utils.getFormFields",a.a.ab);a.b("utils.peekObservable",a.a.Ha);a.b("utils.postJson",a.a.Xb);a.b("utils.parseJson",a.a.Wb);a.b("utils.registerEventHandler",a.a.r);a.b("utils.stringifyJson",a.a.Na);a.b("utils.range",a.a.Zb);a.b("utils.toggleDomNodeCssClass",a.a.ma);a.b("utils.triggerEvent",a.a.da);a.b("utils.unwrapObservable",a.a.c);a.b("utils.objectForEach",a.a.K);a.b("utils.addOrRemoveItem",a.a.V);a.b("unwrap",a.a.c);Function.prototype.bind||(Function.prototype.bind=function(a){var c=
|
||||
this,d=Array.prototype.slice.call(arguments);a=d.shift();return function(){return c.apply(a,d.concat(Array.prototype.slice.call(arguments)))}});a.a.f=new function(){function a(b,h){var k=b[d];if(!k||"null"===k||!e[k]){if(!h)return q;k=b[d]="ko"+c++;e[k]={}}return e[k]}var c=0,d="__ko__"+(new Date).getTime(),e={};return{get:function(c,d){var e=a(c,!1);return e===q?q:e[d]},set:function(c,d,e){if(e!==q||a(c,!1)!==q)a(c,!0)[d]=e},clear:function(a){var b=a[d];return b?(delete e[b],a[d]=null,!0):!1},D:function(){return c++ +
|
||||
d}}};a.b("utils.domData",a.a.f);a.b("utils.domData.clear",a.a.f.clear);a.a.C=new function(){function b(b,c){var e=a.a.f.get(b,d);e===q&&c&&(e=[],a.a.f.set(b,d,e));return e}function c(d){var e=b(d,!1);if(e)for(var e=e.slice(0),m=0;m<e.length;m++)e[m](d);a.a.f.clear(d);"function"==typeof u&&"function"==typeof u.cleanData&&u.cleanData([d]);if(g[d.nodeType])for(e=d.firstChild;d=e;)e=d.nextSibling,8===d.nodeType&&c(d)}var d=a.a.f.D(),e={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{ea:function(a,c){if("function"!=
|
||||
typeof c)throw Error("Callback must be a function");b(a,!0).push(c)},mb:function(c,e){var g=b(c,!1);g&&(a.a.ia(g,e),0==g.length&&a.a.f.set(c,d,q))},L:function(b){if(e[b.nodeType]&&(c(b),g[b.nodeType])){var d=[];a.a.X(d,b.getElementsByTagName("*"));for(var m=0,f=d.length;m<f;m++)c(d[m])}return b},removeNode:function(b){a.L(b);b.parentNode&&b.parentNode.removeChild(b)}}};a.L=a.a.C.L;a.removeNode=a.a.C.removeNode;a.b("cleanNode",a.L);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.C);
|
||||
a.b("utils.domNodeDisposal.addDisposeCallback",a.a.C.ea);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.C.mb);(function(){a.a.Fa=function(b){var c;if("undefined"!=typeof u)if(u.parseHTML)c=u.parseHTML(b)||[];else{if((c=u.clean([b]))&&c[0]){for(b=c[0];b.parentNode&&11!==b.parentNode.nodeType;)b=b.parentNode;b.parentNode&&b.parentNode.removeChild(b)}}else{var d=a.a.la(b).toLowerCase();c=w.createElement("div");d=d.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!d.indexOf("<tr")&&[2,
|
||||
"<table><tbody>","</tbody></table>"]||(!d.indexOf("<td")||!d.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];b="ignored<div>"+d[1]+b+d[2]+"</div>";for("function"==typeof y.innerShiv?c.appendChild(y.innerShiv(b)):c.innerHTML=b;d[0]--;)c=c.lastChild;c=a.a.Q(c.lastChild.childNodes)}return c};a.a.Ka=function(b,c){a.a.wa(b);c=a.a.c(c);if(null!==c&&c!==q)if("string"!=typeof c&&(c=c.toString()),"undefined"!=typeof u)u(b).html(c);else for(var d=a.a.Fa(c),e=0;e<d.length;e++)b.appendChild(d[e])}})();
|
||||
a.b("utils.parseHtmlFragment",a.a.Fa);a.b("utils.setHtml",a.a.Ka);a.u=function(){function b(c,e){if(c)if(8==c.nodeType){var g=a.u.jb(c.nodeValue);null!=g&&e.push({Fb:c,Tb:g})}else if(1==c.nodeType)for(var g=0,h=c.childNodes,k=h.length;g<k;g++)b(h[g],e)}var c={};return{Ca:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);
|
||||
c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},ub:function(a,b){var g=c[a];if(g===q)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return g.apply(null,b||[]),!0}finally{delete c[a]}},vb:function(c,e){var g=[];b(c,g);for(var h=0,k=g.length;h<k;h++){var m=g[h].Fb,f=[m];e&&a.a.X(f,e);a.u.ub(g[h].Tb,f);m.nodeValue="";m.parentNode&&m.parentNode.removeChild(m)}},jb:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.u);a.b("memoization.memoize",
|
||||
a.u.Ca);a.b("memoization.unmemoize",a.u.ub);a.b("memoization.parseMemoText",a.u.jb);a.b("memoization.unmemoizeDomNodeAndDescendants",a.u.vb);a.xa={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.h({read:b,write:function(a){clearTimeout(d);d=setTimeout(function(){b(a)},c)}})},notify:function(a,c){a.equalityComparer="always"==c?null:G}};var N={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.xa);a.sb=function(b,c,d){this.target=b;this.qa=c;this.Eb=d;a.s(this,"dispose",
|
||||
this.B)};a.sb.prototype.B=function(){this.Qb=!0;this.Eb()};a.ca=function(){this.F={};a.a.extend(this,a.ca.fn);a.s(this,"subscribe",this.T);a.s(this,"extend",this.extend);a.s(this,"getSubscriptionsCount",this.Lb)};var I="change";a.ca.fn={T:function(b,c,d){d=d||I;var e=new a.sb(this,c?b.bind(c):b,function(){a.a.ia(this.F[d],e)}.bind(this));this.F[d]||(this.F[d]=[]);this.F[d].push(e);return e},notifySubscribers:function(b,c){c=c||I;if(this.cb(c))try{a.i.Wa();for(var d=this.F[c].slice(0),e=0,g;g=d[e];++e)g&&
|
||||
!0!==g.Qb&&g.qa(b)}finally{a.i.end()}},cb:function(a){return this.F[a]&&this.F[a].length},Lb:function(){var b=0;a.a.K(this.F,function(a,d){b+=d.length});return b},extend:function(b){var c=this;b&&a.a.K(b,function(b,e){var g=a.xa[b];"function"==typeof g&&(c=g(c,e)||c)});return c}};a.fb=function(a){return null!=a&&"function"==typeof a.T&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.ca);a.b("isSubscribable",a.fb);a.i=function(){var b=[];return{Wa:function(a){b.push(a&&{qa:a,Za:[]})},
|
||||
end:function(){b.pop()},lb:function(c){if(!a.fb(c))throw Error("Only subscribable things can act as dependencies");if(0<b.length){var d=b[b.length-1];!d||0<=a.a.l(d.Za,c)||(d.Za.push(c),d.qa(c))}},p:function(a,d,e){try{return b.push(null),a.apply(d,e||[])}finally{b.pop()}}}}();a.q=function(b){function c(){if(0<arguments.length)return c.equalityComparer&&c.equalityComparer(d,arguments[0])||(c.O(),d=arguments[0],c.N()),this;a.i.lb(c);return d}var d=b;a.ca.call(c);c.t=function(){return d};c.N=function(){c.notifySubscribers(d)};
|
||||
c.O=function(){c.notifySubscribers(d,"beforeChange")};a.a.extend(c,a.q.fn);a.s(c,"peek",c.t);a.s(c,"valueHasMutated",c.N);a.s(c,"valueWillMutate",c.O);return c};a.q.fn={equalityComparer:G};var C=a.q.Yb="__ko_proto__";a.q.fn[C]=a.q;a.ya=function(b,c){return null===b||b===q||b[C]===q?!1:b[C]===c?!0:a.ya(b[C],c)};a.M=function(b){return a.ya(b,a.q)};a.gb=function(b){return"function"==typeof b&&b[C]===a.q||"function"==typeof b&&b[C]===a.h&&b.Nb?!0:!1};a.b("observable",a.q);a.b("isObservable",a.M);a.b("isWriteableObservable",
|
||||
a.gb);a.ba=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.q(b);a.a.extend(b,a.ba.fn);return b.extend({trackArrayChanges:!0})};a.ba.fn={remove:function(b){for(var c=this.t(),d=[],e="function"!=typeof b||a.M(b)?function(a){return a===b}:b,g=0;g<c.length;g++){var h=c[g];e(h)&&(0===d.length&&this.O(),d.push(h),c.splice(g,1),g--)}d.length&&this.N();return d},removeAll:function(b){if(b===
|
||||
q){var c=this.t(),d=c.slice(0);this.O();c.splice(0,c.length);this.N();return d}return b?this.remove(function(c){return 0<=a.a.l(b,c)}):[]},destroy:function(b){var c=this.t(),d="function"!=typeof b||a.M(b)?function(a){return a===b}:b;this.O();for(var e=c.length-1;0<=e;e--)d(c[e])&&(c[e]._destroy=!0);this.N()},destroyAll:function(b){return b===q?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.l(b,c)}):[]},indexOf:function(b){var c=this();return a.a.l(c,b)},replace:function(a,
|
||||
c){var d=this.indexOf(a);0<=d&&(this.O(),this.t()[d]=c,this.N())}};a.a.n("pop push reverse shift sort splice unshift".split(" "),function(b){a.ba.fn[b]=function(){var a=this.t();this.O();this.Xa(a,b,arguments);a=a[b].apply(a,arguments);this.N();return a}});a.a.n(["slice"],function(b){a.ba.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.b("observableArray",a.ba);var J="arrayChange";a.xa.trackArrayChanges=function(b){function c(){if(!d){d=!0;var c=b.notifySubscribers;b.notifySubscribers=
|
||||
function(a,b){b&&b!==I||++g;return c.apply(this,arguments)};var m=[].concat(b.t()||[]);e=null;b.T(function(c){c=[].concat(c||[]);if(b.cb(J)){var d;if(!e||1<g)e=a.a.ra(m,c,{sparse:!0});d=e;d.length&&b.notifySubscribers(d,J)}m=c;e=null;g=0})}}if(!b.Xa){var d=!1,e=null,g=0,h=b.T;b.T=b.subscribe=function(a,b,f){f===J&&c();return h.apply(this,arguments)};b.Xa=function(a,b,c){function p(a,b,c){h.push({status:a,value:b,index:c})}if(d&&!g){var h=[],l=a.length,n=c.length,r=0;switch(b){case "push":r=l;case "unshift":for(b=
|
||||
0;b<n;b++)p("added",c[b],r+b);break;case "pop":r=l-1;case "shift":l&&p("deleted",a[r],r);break;case "splice":b=Math.min(Math.max(0,0>c[0]?l+c[0]:c[0]),l);for(var l=1===n?l:Math.min(b+(c[1]||0),l),n=b+n-2,r=Math.max(l,n),v=2;b<r;++b,++v)b<l&&p("deleted",a[b],b),b<n&&p("added",c[v],b);break;default:return}e=h}}}};a.h=function(b,c,d){function e(){a.a.n(z,function(a){a.B()});z=[]}function g(){var a=k.throttleEvaluation;a&&0<=a?(clearTimeout(x),x=setTimeout(h,a)):h()}function h(){if(!s){if(E&&E()){if(!l){D();
|
||||
p=!0;return}}else l=!1;s=!0;try{var b=a.a.ha(z,function(a){return a.target});a.i.Wa(function(c){var d;0<=(d=a.a.l(b,c))?b[d]=q:z.push(c.T(g))});for(var d=c?n.call(c):n(),e=b.length-1;0<=e;e--)b[e]&&z.splice(e,1)[0].B();p=!0;k.equalityComparer&&k.equalityComparer(f,d)||(k.notifySubscribers(f,"beforeChange"),f=d,k.notifySubscribers(f))}finally{a.i.end(),s=!1}z.length||D()}}function k(){if(0<arguments.length){if("function"===typeof r)r.apply(c,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
|
||||
return this}p||h();a.i.lb(k);return f}function m(){return!p||0<z.length}var f,p=!1,s=!1,l=!1,n=b;n&&"object"==typeof n?(d=n,n=d.read):(d=d||{},n||(n=d.read));if("function"!=typeof n)throw Error("Pass a function that returns the value of the ko.computed");var r=d.write,v=d.disposeWhenNodeIsRemoved||d.I||null,t=d.disposeWhen||d.ua,E=t,D=e,z=[],x=null;c||(c=d.owner);k.t=function(){p||h();return f};k.Kb=function(){return z.length};k.Nb="function"===typeof d.write;k.B=function(){D()};k.aa=m;a.ca.call(k);
|
||||
a.a.extend(k,a.h.fn);a.s(k,"peek",k.t);a.s(k,"dispose",k.B);a.s(k,"isActive",k.aa);a.s(k,"getDependenciesCount",k.Kb);v&&(l=!0,v.nodeType&&(E=function(){return!a.a.va(v)||t&&t()}));!0!==d.deferEvaluation&&h();v&&m()&&(D=function(){a.a.C.mb(v,D);e()},a.a.C.ea(v,D));return k};a.Pb=function(b){return a.ya(b,a.h)};F=a.q.Yb;a.h[F]=a.q;a.h.fn={equalityComparer:G};a.h.fn[F]=a.h;a.b("dependentObservable",a.h);a.b("computed",a.h);a.b("isComputed",a.Pb);(function(){function b(a,g,h){h=h||new d;a=g(a);if("object"!=
|
||||
typeof a||null===a||a===q||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var k=a instanceof Array?[]:{};h.save(a,k);c(a,function(c){var d=g(a[c]);switch(typeof d){case "boolean":case "number":case "string":case "function":k[c]=d;break;case "object":case "undefined":var p=h.get(d);k[c]=p!==q?p:b(d,g,h)}});return k}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);"function"==typeof a.toJSON&&b("toJSON")}else for(c in a)b(c)}function d(){this.keys=
|
||||
[];this.Qa=[]}a.tb=function(c){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(c,function(b){for(var c=0;a.M(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.tb(b);return a.a.Na(b,c,d)};d.prototype={save:function(b,c){var d=a.a.l(this.keys,b);0<=d?this.Qa[d]=c:(this.keys.push(b),this.Qa.push(c))},get:function(b){b=a.a.l(this.keys,b);return 0<=b?this.Qa[b]:q}}})();a.b("toJS",a.tb);a.b("toJSON",a.toJSON);(function(){a.k={o:function(b){switch(a.a.v(b)){case "option":return!0===
|
||||
b.__ko__hasDomDataOptionValue__?a.a.f.get(b,a.d.options.Ea):7>=a.a.ja?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.k.o(b.options[b.selectedIndex]):q;default:return b.value}},na:function(b,c){switch(a.a.v(b)){case "option":switch(typeof c){case "string":a.a.f.set(b,a.d.options.Ea,q);"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__;b.value=c;break;default:a.a.f.set(b,a.d.options.Ea,c),b.__ko__hasDomDataOptionValue__=
|
||||
!0,b.value="number"===typeof c?c:""}break;case "select":""===c&&(c=q);if(null===c||c===q)b.selectedIndex=-1;for(var d=b.options.length-1;0<=d;d--)if(a.k.o(b.options[d])==c){b.selectedIndex=d;break}1<b.size||-1!==b.selectedIndex||(b.selectedIndex=0);break;default:if(null===c||c===q)c="";b.value=c}}}})();a.b("selectExtensions",a.k);a.b("selectExtensions.readValue",a.k.o);a.b("selectExtensions.writeValue",a.k.na);a.g=function(){function b(b){b=a.a.la(b);123===b.charCodeAt(0)&&(b=b.slice(1,-1));var c=
|
||||
[],d=b.match(e),k,l,n=0;if(d){d.push(",");for(var r=0,v;v=d[r];++r){var t=v.charCodeAt(0);if(44===t){if(0>=n){k&&c.push(l?{key:k,value:l.join("")}:{unknown:k});k=l=n=0;continue}}else if(58===t){if(!l)continue}else if(47===t&&r&&1<v.length)(t=d[r-1].match(g))&&!h[t[0]]&&(b=b.substr(b.indexOf(v)+1),d=b.match(e),d.push(","),r=-1,v="/");else if(40===t||123===t||91===t)++n;else if(41===t||125===t||93===t)--n;else if(!k&&!l){k=34===t||39===t?v.slice(1,-1):v;continue}l?l.push(v):l=[v]}}return c}var c=["true",
|
||||
"false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),g=/[\])"'A-Za-z0-9_$]+$/,h={"in":1,"return":1,"typeof":1},k={};return{Y:[],U:k,Ga:b,ka:function(e,f){function g(b,f){var e,r=a.getBindingHandler(b);if(r&&r.preprocess?f=r.preprocess(f,b,g):1){if(r=k[b])e=f,0<=a.a.l(c,e)?e=!1:(r=e.match(d),e=null===r?!1:r[1]?"Object("+r[1]+")"+
|
||||
r[2]:e),r=e;r&&l.push("'"+b+"':function(_z){"+e+"=_z}");n&&(f="function(){return "+f+" }");h.push("'"+b+"':"+f)}}f=f||{};var h=[],l=[],n=f.valueAccessors,r="string"===typeof e?b(e):e;a.a.n(r,function(a){g(a.key||a.unknown,a.value)});l.length&&g("_ko_property_writers","{"+l.join(",")+"}");return h.join(",")},Sb:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},oa:function(b,c,d,e,k){if(b&&a.M(b))!a.gb(b)||k&&b.t()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();
|
||||
a.b("expressionRewriting",a.g);a.b("expressionRewriting.bindingRewriteValidators",a.g.Y);a.b("expressionRewriting.parseObjectLiteral",a.g.Ga);a.b("expressionRewriting.preProcessBindings",a.g.ka);a.b("expressionRewriting._twoWayBindings",a.g.U);a.b("jsonExpressionRewriting",a.g);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.g.ka);(function(){function b(a){return 8==a.nodeType&&h.test(g?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&k.test(g?a.text:a.nodeValue)}function d(a,
|
||||
d){for(var e=a,k=1,n=[];e=e.nextSibling;){if(c(e)&&(k--,0===k))return n;n.push(e);b(e)&&k++}if(!d)throw Error("Cannot find closing comment tag to match: "+a.nodeValue);return null}function e(a,b){var c=d(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var g=w&&"\x3c!--test--\x3e"===w.createComment("test").text,h=g?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=g?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,m={ul:!0,ol:!0};a.e={P:{},childNodes:function(a){return b(a)?
|
||||
d(a):a.childNodes},Z:function(c){if(b(c)){c=a.e.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.wa(c)},S:function(c,d){if(b(c)){a.e.Z(c);for(var e=c.nextSibling,k=0,n=d.length;k<n;k++)e.parentNode.insertBefore(d[k],e)}else a.a.S(c,d)},kb:function(a,c){b(a)?a.parentNode.insertBefore(c,a.nextSibling):a.firstChild?a.insertBefore(c,a.firstChild):a.appendChild(c)},eb:function(c,d,e){e?b(c)?c.parentNode.insertBefore(d,e.nextSibling):e.nextSibling?c.insertBefore(d,e.nextSibling):
|
||||
c.appendChild(d):a.e.kb(c,d)},firstChild:function(a){return b(a)?!a.nextSibling||c(a.nextSibling)?null:a.nextSibling:a.firstChild},nextSibling:function(a){b(a)&&(a=e(a));return a.nextSibling&&c(a.nextSibling)?null:a.nextSibling},Mb:b,bc:function(a){return(a=(g?a.text:a.nodeValue).match(h))?a[1]:null},ib:function(d){if(m[a.a.v(d)]){var k=d.firstChild;if(k){do if(1===k.nodeType){var g;g=k.firstChild;var h=null;if(g){do if(h)h.push(g);else if(b(g)){var n=e(g,!0);n?g=n:h=[g]}else c(g)&&(h=[g]);while(g=
|
||||
g.nextSibling)}if(g=h)for(h=k.nextSibling,n=0;n<g.length;n++)h?d.insertBefore(g[n],h):d.appendChild(g[n])}while(k=k.nextSibling)}}}}})();a.b("virtualElements",a.e);a.b("virtualElements.allowedBindings",a.e.P);a.b("virtualElements.emptyNode",a.e.Z);a.b("virtualElements.insertAfter",a.e.eb);a.b("virtualElements.prepend",a.e.kb);a.b("virtualElements.setDomNodeChildren",a.e.S);(function(){a.H=function(){this.zb={}};a.a.extend(a.H.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=
|
||||
b.getAttribute("data-bind");case 8:return a.e.Mb(b);default:return!1}},getBindings:function(a,c){var d=this.getBindingsString(a,c);return d?this.parseBindingsString(d,c,a):null},getBindingAccessors:function(a,c){var d=this.getBindingsString(a,c);return d?this.parseBindingsString(d,c,a,{valueAccessors:!0}):null},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.e.bc(b);default:return null}},parseBindingsString:function(b,c,d,e){try{var g=this.zb,
|
||||
h=b+(e&&e.valueAccessors||""),k;if(!(k=g[h])){var m,f="with($context){with($data||{}){return{"+a.g.ka(b,e)+"}}}";m=new Function("$context","$element",f);k=g[h]=m}return k(c,d)}catch(p){throw p.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+p.message,p;}}});a.H.instance=new a.H})();a.b("bindingProvider",a.H);(function(){function b(a){return function(){return a}}function c(a){return a()}function d(b){return a.a.Da(a.i.p(b),function(a,c){return function(){return b()[c]}})}function e(a,
|
||||
b){return d(this.getBindings.bind(this,a,b))}function g(b,c,d){var f,e=a.e.firstChild(c),k=a.H.instance,g=k.preprocessNode;if(g){for(;f=e;)e=a.e.nextSibling(f),g.call(k,f);e=a.e.firstChild(c)}for(;f=e;)e=a.e.nextSibling(f),h(b,f,d)}function h(b,c,d){var f=!0,e=1===c.nodeType;e&&a.e.ib(c);if(e&&d||a.H.instance.nodeHasBindings(c))f=m(c,null,b,d).shouldBindDescendants;f&&!p[a.a.v(c)]&&g(b,c,!e)}function k(b){var c=[],d={},f=[];a.a.K(b,function D(e){if(!d[e]){var k=a.getBindingHandler(e);k&&(k.after&&
|
||||
(f.push(e),a.a.n(k.after,function(c){if(b[c]){if(-1!==a.a.l(f,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+f.join(", "));D(c)}}),f.pop()),c.push({key:e,bb:k}));d[e]=!0}});return c}function m(b,d,f,g){var h=a.a.f.get(b,s);if(!d){if(h)throw Error("You cannot apply bindings multiple times to the same element.");a.a.f.set(b,s,!0)}!h&&g&&a.rb(b,f);var m;if(d&&"function"!==typeof d)m=d;else{var p=a.H.instance,l=p.getBindingAccessors||e;if(d||f.A){var A=
|
||||
a.h(function(){(m=d?d(f,b):l.call(p,b,f))&&f.A&&f.A();return m},null,{I:b});m&&A.aa()||(A=null)}else m=a.i.p(l,p,[b,f])}var u;if(m){var w=A?function(a){return function(){return c(A()[a])}}:function(a){return m[a]},y=function(){return a.a.Da(A?A():m,c)};y.get=function(a){return m[a]&&c(w(a))};y.has=function(a){return a in m};g=k(m);a.a.n(g,function(c){var d=c.bb.init,e=c.bb.update,k=c.key;if(8===b.nodeType&&!a.e.P[k])throw Error("The binding '"+k+"' cannot be used with virtual elements");try{"function"==
|
||||
typeof d&&a.i.p(function(){var a=d(b,w(k),y,f.$data,f);if(a&&a.controlsDescendantBindings){if(u!==q)throw Error("Multiple bindings ("+u+" and "+k+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=k}}),"function"==typeof e&&a.h(function(){e(b,w(k),y,f.$data,f)},null,{I:b})}catch(g){throw g.message='Unable to process binding "'+k+": "+m[k]+'"\nMessage: '+g.message,g;}})}return{shouldBindDescendants:u===q}}function f(b){return b&&
|
||||
b instanceof a.G?b:new a.G(b)}a.d={};var p={script:!0};a.getBindingHandler=function(b){return a.d[b]};a.G=function(b,c,d,f){var e=this,k="function"==typeof b,g,h=a.h(function(){var g=k?b():b;c?(c.A&&c.A(),a.a.extend(e,c),h&&(e.A=h)):(e.$parents=[],e.$root=g,e.ko=a);e.$rawData=b;e.$data=g;d&&(e[d]=g);f&&f(e,c,g);return e.$data},null,{ua:function(){return g&&!a.a.Ra(g)},I:!0});h.aa()&&(e.A=h,h.equalityComparer=null,g=[],h.wb=function(b){g.push(b);a.a.C.ea(b,function(b){a.a.ia(g,b);g.length||(h.B(),
|
||||
e.A=h=q)})})};a.G.prototype.createChildContext=function(b,c,d){return new a.G(b,this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)})};a.G.prototype.extend=function(b){return new a.G(this.$rawData,this,null,function(c){a.a.extend(c,"function"==typeof b?b():b)})};var s=a.a.f.D(),l=a.a.f.D();a.rb=function(b,c){if(2==arguments.length)a.a.f.set(b,l,c),c.A&&c.A.wb(b);else return a.a.f.get(b,l)};a.pa=function(b,c,d){1===b.nodeType&&
|
||||
a.e.ib(b);return m(b,c,f(d),!0)};a.xb=function(c,e,k){k=f(k);return a.pa(c,"function"===typeof e?d(e.bind(null,k,c)):a.a.Da(e,b),k)};a.Ta=function(a,b){1!==b.nodeType&&8!==b.nodeType||g(f(a),b,!0)};a.Sa=function(a,b){if(b&&1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");b=b||y.document.body;h(f(a),b,!0)};a.ta=function(b){switch(b.nodeType){case 1:case 8:var c=a.rb(b);if(c)return c;if(b.parentNode)return a.ta(b.parentNode)}return q};
|
||||
a.Cb=function(b){return(b=a.ta(b))?b.$data:q};a.b("bindingHandlers",a.d);a.b("applyBindings",a.Sa);a.b("applyBindingsToDescendants",a.Ta);a.b("applyBindingAccessorsToNode",a.pa);a.b("applyBindingsToNode",a.xb);a.b("contextFor",a.ta);a.b("dataFor",a.Cb)})();var M={"class":"className","for":"htmlFor"};a.d.attr={update:function(b,c){var d=a.a.c(c())||{};a.a.K(d,function(c,d){d=a.a.c(d);var h=!1===d||null===d||d===q;h&&b.removeAttribute(c);8>=a.a.ja&&c in M?(c=M[c],h?b.removeAttribute(c):b[c]=d):h||b.setAttribute(c,
|
||||
d.toString());"name"===c&&a.a.pb(b,h?"":d.toString())})}};(function(){a.d.checked={after:["value","attr"],init:function(b,c,d){function e(){return d.has("checkedValue")?a.a.c(d.get("checkedValue")):b.value}function g(){var k=b.checked,g=s?e():k;if(l&&(!m||k)){var h=a.i.p(c);f?p!==g?(k&&(a.a.V(h,g,!0),a.a.V(h,p,!1)),p=g):a.a.V(h,g,k):a.g.oa(h,d,"checked",g,!0)}}function h(){var d=a.a.c(c());b.checked=f?0<=a.a.l(d,e()):k?d:e()===d}var k="checkbox"==b.type,m="radio"==b.type;if(k||m){var f=k&&a.a.c(c())instanceof
|
||||
Array,p=f?e():q,s=m||f,l=!1;m&&!b.name&&a.d.uniqueName.init(b,function(){return!0});a.h(g,null,{I:b});a.a.r(b,"click",g);a.h(h,null,{I:b});l=!0}}};a.g.U.checked=!0;a.d.checkedValue={update:function(b,c){b.value=a.a.c(c())}}})();a.d.css={update:function(b,c){var d=a.a.c(c());"object"==typeof d?a.a.K(d,function(c,d){d=a.a.c(d);a.a.ma(b,c,d)}):(d=String(d||""),a.a.ma(b,b.__ko__cssValue,!1),b.__ko__cssValue=d,a.a.ma(b,d,!0))}};a.d.enable={update:function(b,c){var d=a.a.c(c());d&&b.disabled?b.removeAttribute("disabled"):
|
||||
d||b.disabled||(b.disabled=!0)}};a.d.disable={update:function(b,c){a.d.enable.update(b,function(){return!a.a.c(c())})}};a.d.event={init:function(b,c,d,e,g){var h=c()||{};a.a.K(h,function(k){"string"==typeof k&&a.a.r(b,k,function(b){var f,h=c()[k];if(h){try{var s=a.a.Q(arguments);e=g.$data;s.unshift(e);f=h.apply(e,s)}finally{!0!==f&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(k+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.d.foreach={hb:function(b){return function(){var c=
|
||||
b(),d=a.a.Ha(c);if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.J.Aa};a.a.c(c);return{foreach:d.data,as:d.as,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.J.Aa}}},init:function(b,c){return a.d.template.init(b,a.d.foreach.hb(c))},update:function(b,c,d,e,g){return a.d.template.update(b,a.d.foreach.hb(c),d,e,g)}};a.g.Y.foreach=!1;a.e.P.foreach=!0;a.d.hasfocus=
|
||||
{init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var g=b.ownerDocument;if("activeElement"in g){var f;try{f=g.activeElement}catch(h){f=g.body}e=f===b}g=c();a.g.oa(g,d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var g=e.bind(null,!0),h=e.bind(null,!1);a.a.r(b,"focus",g);a.a.r(b,"focusin",g);a.a.r(b,"blur",h);a.a.r(b,"focusout",h)},update:function(b,c){var d=!!a.a.c(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===d||(d?b.focus():b.blur(),a.i.p(a.a.da,
|
||||
null,[b,d?"focusin":"focusout"]))}};a.g.U.hasfocus=!0;a.d.hasFocus=a.d.hasfocus;a.g.U.hasFocus=!0;a.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Ka(b,c())}};var L=a.a.f.D();H("if");H("ifnot",!1,!0);H("with",!0,!1,function(a,c){return a.createChildContext(c)});a.d.options={init:function(b){if("select"!==a.a.v(b))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,
|
||||
c,d){function e(){return a.a.ga(b.options,function(a){return a.selected})}function g(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function h(c,d){if(p.length){var f=0<=a.a.l(p,a.k.o(d[0]));a.a.qb(d[0],f);l&&!f&&a.i.p(a.a.da,null,[b,"change"])}}var k=0!=b.length&&b.multiple?b.scrollTop:null;c=a.a.c(c());var m=d.get("optionsIncludeDestroyed"),f={},p;p=b.multiple?a.a.ha(e(),a.k.o):0<=b.selectedIndex?[a.k.o(b.options[b.selectedIndex])]:[];if(c){"undefined"==typeof c.length&&(c=[c]);
|
||||
var s=a.a.ga(c,function(b){return m||b===q||null===b||!a.a.c(b._destroy)});d.has("optionsCaption")&&(c=a.a.c(d.get("optionsCaption")),null!==c&&c!==q&&s.unshift(f))}else c=[];var l=!1;c=h;d.has("optionsAfterRender")&&(c=function(b,c){h(0,c);a.i.p(d.get("optionsAfterRender"),null,[c[0],b!==f?b:q])});a.a.Ja(b,s,function(b,c,e){e.length&&(p=e[0].selected?[a.k.o(e[0])]:[],l=!0);c=w.createElement("option");b===f?(a.a.Ma(c,d.get("optionsCaption")),a.k.na(c,q)):(e=g(b,d.get("optionsValue"),b),a.k.na(c,a.a.c(e)),
|
||||
b=g(b,d.get("optionsText"),e),a.a.Ma(c,b));return[c]},null,c);(b.multiple?p.length&&e().length<p.length:p.length&&0<=b.selectedIndex?a.k.o(b.options[b.selectedIndex])!==p[0]:p.length||0<=b.selectedIndex)&&a.i.p(a.a.da,null,[b,"change"]);a.a.Hb(b);k&&20<Math.abs(k-b.scrollTop)&&(b.scrollTop=k)}};a.d.options.Ea=a.a.f.D();a.d.selectedOptions={after:["options","foreach"],init:function(b,c,d){a.a.r(b,"change",function(){var e=c(),g=[];a.a.n(b.getElementsByTagName("option"),function(b){b.selected&&g.push(a.k.o(b))});
|
||||
a.g.oa(e,d,"selectedOptions",g)})},update:function(b,c){if("select"!=a.a.v(b))throw Error("values binding applies only to SELECT elements");var d=a.a.c(c());d&&"number"==typeof d.length&&a.a.n(b.getElementsByTagName("option"),function(b){var c=0<=a.a.l(d,a.k.o(b));a.a.qb(b,c)})}};a.g.U.selectedOptions=!0;a.d.style={update:function(b,c){var d=a.a.c(c()||{});a.a.K(d,function(c,d){d=a.a.c(d);b.style[c]=d||""})}};a.d.submit={init:function(b,c,d,e,g){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");
|
||||
a.a.r(b,"submit",function(a){var d,e=c();try{d=e.call(g.$data,b)}finally{!0!==d&&(a.preventDefault?a.preventDefault():a.returnValue=!1)}})}};a.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Ma(b,c())}};a.e.P.text=!0;a.d.uniqueName={init:function(b,c){if(c()){var d="ko_unique_"+ ++a.d.uniqueName.Bb;a.a.pb(b,d)}}};a.d.uniqueName.Bb=0;a.d.value={after:["options","foreach"],init:function(b,c,d){function e(){k=!1;var e=c(),f=a.k.o(b);a.g.oa(e,d,"value",f)}var g=
|
||||
["change"],h=d.get("valueUpdate"),k=!1;h&&("string"==typeof h&&(h=[h]),a.a.X(g,h),g=a.a.Va(g));!a.a.ja||"input"!=b.tagName.toLowerCase()||"text"!=b.type||"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete||-1!=a.a.l(g,"propertychange")||(a.a.r(b,"propertychange",function(){k=!0}),a.a.r(b,"blur",function(){k&&e()}));a.a.n(g,function(c){var d=e;a.a.ac(c,"after")&&(d=function(){setTimeout(e,0)},c=c.substring(5));a.a.r(b,c,d)})},update:function(b,c){var d="select"===a.a.v(b),e=a.a.c(c()),g=a.k.o(b);
|
||||
e!==g&&(g=function(){a.k.na(b,e)},g(),d&&(e!==a.k.o(b)?a.i.p(a.a.da,null,[b,"change"]):setTimeout(g,0)))}};a.g.U.value=!0;a.d.visible={update:function(b,c){var d=a.a.c(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};(function(b){a.d[b]={init:function(c,d,e,g,h){return a.d.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,g,h)}}})("click");a.w=function(){};a.w.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");
|
||||
};a.w.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.w.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.m.j(d)}if(1==b.nodeType||8==b.nodeType)return new a.m.W(b);throw Error("Unknown template type: "+b);};a.w.prototype.renderTemplate=function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,
|
||||
d)};a.w.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.w.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.w);a.Oa=function(){function b(b,c,d,k){b=a.g.Ga(b);for(var m=a.g.Y,f=0;f<b.length;f++){var p=b[f].key;if(m.hasOwnProperty(p)){var s=m[p];if("function"===typeof s){if(p=s(b[f].value))throw Error(p);}else if(!s)throw Error("This template engine does not support the '"+
|
||||
p+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.g.ka(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return k.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Ib:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.Oa.Ub(b,c)},
|
||||
d)},Ub:function(a,g){return a.replace(c,function(a,c,d,f,e){return b(e,c,d,g)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",g)})},yb:function(b,c){return a.u.Ca(function(d,k){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.pa(m,b,k)})}}}();a.b("__tr_ambtns",a.Oa.yb);(function(){a.m={};a.m.j=function(a){this.j=a};a.m.j.prototype.text=function(){var b=a.a.v(this.j),b="script"===b?"text":"textarea"===b?"value":"innerHTML";if(0==arguments.length)return this.j[b];var c=arguments[0];
|
||||
"innerHTML"===b?a.a.Ka(this.j,c):this.j[b]=c};var b=a.a.f.D()+"_";a.m.j.prototype.data=function(c){if(1===arguments.length)return a.a.f.get(this.j,b+c);a.a.f.set(this.j,b+c,arguments[1])};var c=a.a.f.D();a.m.W=function(a){this.j=a};a.m.W.prototype=new a.m.j;a.m.W.prototype.text=function(){if(0==arguments.length){var b=a.a.f.get(this.j,c)||{};b.Pa===q&&b.sa&&(b.Pa=b.sa.innerHTML);return b.Pa}a.a.f.set(this.j,c,{Pa:arguments[0]})};a.m.j.prototype.nodes=function(){if(0==arguments.length)return(a.a.f.get(this.j,
|
||||
c)||{}).sa;a.a.f.set(this.j,c,{sa:arguments[0]})};a.b("templateSources",a.m);a.b("templateSources.domElement",a.m.j);a.b("templateSources.anonymousTemplate",a.m.W)})();(function(){function b(b,c,d){var e;for(c=a.e.nextSibling(c);b&&(e=b)!==c;)b=a.e.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var f=c[0],e=c[c.length-1],g=f.parentNode,h=a.H.instance,n=h.preprocessNode;if(n){b(f,e,function(a,b){var c=a.previousSibling,d=n.call(h,a);d&&(a===f&&(f=d[0]||b),a===e&&(e=d[d.length-1]||c))});c.length=
|
||||
0;if(!f)return;f===e?c.push(f):(c.push(f,e),a.a.$(c,g))}b(f,e,function(b){1!==b.nodeType&&8!==b.nodeType||a.Sa(d,b)});b(f,e,function(b){1!==b.nodeType&&8!==b.nodeType||a.u.vb(b,[d])});a.a.$(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,s){s=s||{};var l=b&&d(b),l=l&&l.ownerDocument,n=s.templateEngine||g;a.Oa.Ib(f,n,l);f=n.renderTemplate(f,h,s,l);if("number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");
|
||||
l=!1;switch(e){case "replaceChildren":a.e.S(b,f);l=!0;break;case "replaceNode":a.a.nb(b,f);l=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+e);}l&&(c(f,h),s.afterRender&&a.i.p(s.afterRender,null,[f,h.$data]));return f}var g;a.La=function(b){if(b!=q&&!(b instanceof a.w))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.Ia=function(b,c,f,h,s){f=f||{};if((f.templateEngine||g)==q)throw Error("Set a template engine before calling renderTemplate");
|
||||
s=s||"replaceChildren";if(h){var l=d(h);return a.h(function(){var g=c&&c instanceof a.G?c:new a.G(a.a.c(c)),r="function"==typeof b?b(g.$data,g):b,g=e(h,s,r,g,f);"replaceNode"==s&&(h=g,l=d(h))},null,{ua:function(){return!l||!a.a.va(l)},I:l&&"replaceNode"==s?l.parentNode:l})}return a.u.Ca(function(d){a.Ia(b,c,f,d,"replaceNode")})};a.$b=function(b,d,f,g,h){function l(a,b){c(b,r);f.afterRender&&f.afterRender(b,a)}function n(a,c){r=h.createChildContext(a,f.as,function(a){a.$index=c});var d="function"==
|
||||
typeof b?b(a,r):b;return e(null,"ignoreTargetNode",d,r,f)}var r;return a.h(function(){var b=a.a.c(d)||[];"undefined"==typeof b.length&&(b=[b]);b=a.a.ga(b,function(b){return f.includeDestroyed||b===q||null===b||!a.a.c(b._destroy)});a.i.p(a.a.Ja,null,[g,b,n,f,l])},null,{I:g})};var h=a.a.f.D();a.d.template={init:function(b,c){var d=a.a.c(c());"string"==typeof d||d.name?a.e.Z(b):(d=a.e.childNodes(b),d=a.a.Vb(d),(new a.m.W(b)).nodes(d));return{controlsDescendantBindings:!0}},update:function(b,c,d,e,g){c=
|
||||
a.a.c(c());d={};e=!0;var l,n=null;"string"!=typeof c&&(d=c,c=a.a.c(d.name),"if"in d&&(e=a.a.c(d["if"])),e&&"ifnot"in d&&(e=!a.a.c(d.ifnot)),l=a.a.c(d.data));"foreach"in d?n=a.$b(c||b,e&&d.foreach||[],d,b,g):e?(g="data"in d?g.createChildContext(l,d.as):g,n=a.Ia(c||b,g,d,b)):a.e.Z(b);g=n;(l=a.a.f.get(b,h))&&"function"==typeof l.B&&l.B();a.a.f.set(b,h,g&&g.aa()?g:q)}};a.g.Y.template=function(b){b=a.g.Ga(b);return 1==b.length&&b[0].unknown||a.g.Sb(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};
|
||||
a.e.P.template=!0})();a.b("setTemplateEngine",a.La);a.b("renderTemplate",a.Ia);a.a.ra=function(){function a(b,d,e,g,h){var k=Math.min,m=Math.max,f=[],p,q=b.length,l,n=d.length,r=n-q||1,v=q+n+1,t,u,w;for(p=0;p<=q;p++)for(u=t,f.push(t=[]),w=k(n,p+r),l=m(0,p-1);l<=w;l++)t[l]=l?p?b[p-1]===d[l-1]?u[l-1]:k(u[l]||v,t[l-1]||v)+1:l+1:p+1;k=[];m=[];r=[];p=q;for(l=n;p||l;)n=f[p][l]-1,l&&n===f[p][l-1]?m.push(k[k.length]={status:e,value:d[--l],index:l}):p&&n===f[p-1][l]?r.push(k[k.length]={status:g,value:b[--p],
|
||||
index:p}):(--l,--p,h.sparse||k.push({status:"retained",value:d[l]}));if(m.length&&r.length){b=10*q;var z;for(d=e=0;(h.dontLimitMoves||d<b)&&(z=m[e]);e++){for(g=0;f=r[g];g++)if(z.value===f.value){z.moved=f.index;f.moved=z.index;r.splice(g,1);d=g=0;break}d+=g}}return k.reverse()}return function(c,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};c=c||[];d=d||[];return c.length<=d.length?a(c,d,"added","deleted",e):a(d,c,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.ra);(function(){function b(b,
|
||||
c,g,h,k){var m=[],f=a.h(function(){var f=c(g,k,a.a.$(m,b))||[];0<m.length&&(a.a.nb(m,f),h&&a.i.p(h,null,[g,f,k]));m.splice(0,m.length);a.a.X(m,f)},null,{I:b,ua:function(){return!a.a.Ra(m)}});return{R:m,h:f.aa()?f:q}}var c=a.a.f.D();a.a.Ja=function(d,e,g,h,k){function m(b,c){x=s[c];t!==c&&(z[b]=x);x.za(t++);a.a.$(x.R,d);r.push(x);w.push(x)}function f(b,c){if(b)for(var d=0,e=c.length;d<e;d++)c[d]&&a.a.n(c[d].R,function(a){b(a,d,c[d].fa)})}e=e||[];h=h||{};var p=a.a.f.get(d,c)===q,s=a.a.f.get(d,c)||[],
|
||||
l=a.a.ha(s,function(a){return a.fa}),n=a.a.ra(l,e,h.dontLimitMoves),r=[],v=0,t=0,u=[],w=[];e=[];for(var z=[],l=[],x,A=0,y,B;y=n[A];A++)switch(B=y.moved,y.status){case "deleted":B===q&&(x=s[v],x.h&&x.h.B(),u.push.apply(u,a.a.$(x.R,d)),h.beforeRemove&&(e[A]=x,w.push(x)));v++;break;case "retained":m(A,v++);break;case "added":B!==q?m(A,B):(x={fa:y.value,za:a.q(t++)},r.push(x),w.push(x),p||(l[A]=x))}f(h.beforeMove,z);a.a.n(u,h.beforeRemove?a.L:a.removeNode);for(var A=0,p=a.e.firstChild(d),C;x=w[A];A++){x.R||
|
||||
a.a.extend(x,b(d,g,x.fa,k,x.za));for(v=0;n=x.R[v];p=n.nextSibling,C=n,v++)n!==p&&a.e.eb(d,n,C);!x.Ob&&k&&(k(x.fa,x.R,x.za),x.Ob=!0)}f(h.beforeRemove,e);f(h.afterMove,z);f(h.afterAdd,l);a.a.f.set(d,c,r)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.Ja);a.J=function(){this.allowTemplateRewriting=!1};a.J.prototype=new a.w;a.J.prototype.renderTemplateSource=function(b){var c=(9>a.a.ja?0:b.nodes)?b.nodes():null;if(c)return a.a.Q(c.cloneNode(!0).childNodes);b=b.text();return a.a.Fa(b)};a.J.Aa=
|
||||
new a.J;a.La(a.J.Aa);a.b("nativeTemplateEngine",a.J);(function(){a.Ba=function(){var a=this.Rb=function(){if("undefined"==typeof u||!u.tmpl)return 0;try{if(0<=u.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,e,g){g=g||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var h=b.data("precompiled");h||(h=b.text()||"",h=u.template(null,"{{ko_with $item.koBindingContext}}"+h+
|
||||
"{{/ko_with}}"),b.data("precompiled",h));b=[e.$data];e=u.extend({koBindingContext:e},g.templateOptions);e=u.tmpl(h,b,e);e.appendTo(w.createElement("div"));u.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){w.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(u.tmpl.tag.ko_code={open:"__.push($1 || '');"},u.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};a.Ba.prototype=
|
||||
new a.w;var b=new a.Ba;0<b.Rb&&a.La(b);a.b("jqueryTmplTemplateEngine",a.Ba)})()})})();})();
|
||||
@ -1,22 +0,0 @@
|
||||
/// Knockout Mapping plugin v2.4.1
|
||||
/// (c) 2013 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/
|
||||
/// License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
(function(e){"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?e(require("knockout"),exports):"function"===typeof define&&define.amd?define(["knockout","exports"],e):e(ko,ko.mapping={})})(function(e,f){function y(b,c){var a,d;for(d in c)if(c.hasOwnProperty(d)&&c[d])if(a=f.getType(b[d]),d&&b[d]&&"array"!==a&&"string"!==a)y(b[d],c[d]);else if("array"===f.getType(b[d])&&"array"===f.getType(c[d])){a=b;for(var e=d,l=b[d],n=c[d],t={},g=l.length-1;0<=g;--g)t[l[g]]=l[g];for(g=
|
||||
n.length-1;0<=g;--g)t[n[g]]=n[g];l=[];n=void 0;for(n in t)l.push(t[n]);a[e]=l}else b[d]=c[d]}function E(b,c){var a={};y(a,b);y(a,c);return a}function z(b,c){for(var a=E({},b),e=L.length-1;0<=e;e--){var f=L[e];a[f]&&(a[""]instanceof Object||(a[""]={}),a[""][f]=a[f],delete a[f])}c&&(a.ignore=h(c.ignore,a.ignore),a.include=h(c.include,a.include),a.copy=h(c.copy,a.copy),a.observe=h(c.observe,a.observe));a.ignore=h(a.ignore,j.ignore);a.include=h(a.include,j.include);a.copy=h(a.copy,j.copy);a.observe=h(a.observe,
|
||||
j.observe);a.mappedProperties=a.mappedProperties||{};a.copiedProperties=a.copiedProperties||{};return a}function h(b,c){"array"!==f.getType(b)&&(b="undefined"===f.getType(b)?[]:[b]);"array"!==f.getType(c)&&(c="undefined"===f.getType(c)?[]:[c]);return e.utils.arrayGetDistinctValues(b.concat(c))}function F(b,c,a,d,k,l,n){var t="array"===f.getType(e.utils.unwrapObservable(c));l=l||"";if(f.isMapped(b)){var g=e.utils.unwrapObservable(b)[p];a=E(g,a)}var j=n||k,h=function(){return a[d]&&a[d].create instanceof
|
||||
Function},x=function(b){var f=G,g=e.dependentObservable;e.dependentObservable=function(a,b,c){c=c||{};a&&"object"==typeof a&&(c=a);var d=c.deferEvaluation,M=!1;c.deferEvaluation=!0;a=new H(a,b,c);if(!d){var g=a,d=e.dependentObservable;e.dependentObservable=H;a=e.isWriteableObservable(g);e.dependentObservable=d;d=H({read:function(){M||(e.utils.arrayRemoveItem(f,g),M=!0);return g.apply(g,arguments)},write:a&&function(a){return g(a)},deferEvaluation:!0});d.__DO=g;a=d;f.push(a)}return a};e.dependentObservable.fn=
|
||||
H.fn;e.computed=e.dependentObservable;b=e.utils.unwrapObservable(k)instanceof Array?a[d].create({data:b||c,parent:j,skip:N}):a[d].create({data:b||c,parent:j});e.dependentObservable=g;e.computed=e.dependentObservable;return b},u=function(){return a[d]&&a[d].update instanceof Function},v=function(b,f){var g={data:f||c,parent:j,target:e.utils.unwrapObservable(b)};e.isWriteableObservable(b)&&(g.observable=b);return a[d].update(g)};if(n=I.get(c))return n;d=d||"";if(t){var t=[],s=!1,m=function(a){return a};
|
||||
a[d]&&a[d].key&&(m=a[d].key,s=!0);e.isObservable(b)||(b=e.observableArray([]),b.mappedRemove=function(a){var c="function"==typeof a?a:function(b){return b===m(a)};return b.remove(function(a){return c(m(a))})},b.mappedRemoveAll=function(a){var c=C(a,m);return b.remove(function(a){return-1!=e.utils.arrayIndexOf(c,m(a))})},b.mappedDestroy=function(a){var c="function"==typeof a?a:function(b){return b===m(a)};return b.destroy(function(a){return c(m(a))})},b.mappedDestroyAll=function(a){var c=C(a,m);return b.destroy(function(a){return-1!=
|
||||
e.utils.arrayIndexOf(c,m(a))})},b.mappedIndexOf=function(a){var c=C(b(),m);a=m(a);return e.utils.arrayIndexOf(c,a)},b.mappedGet=function(a){return b()[b.mappedIndexOf(a)]},b.mappedCreate=function(a){if(-1!==b.mappedIndexOf(a))throw Error("There already is an object with the key that you specified.");var c=h()?x(a):a;u()&&(a=v(c,a),e.isWriteableObservable(c)?c(a):c=a);b.push(c);return c});n=C(e.utils.unwrapObservable(b),m).sort();g=C(c,m);s&&g.sort();s=e.utils.compareArrays(n,g);n={};var J,A=e.utils.unwrapObservable(c),
|
||||
y={},z=!0,g=0;for(J=A.length;g<J;g++){var r=m(A[g]);if(void 0===r||r instanceof Object){z=!1;break}y[r]=A[g]}var A=[],B=0,g=0;for(J=s.length;g<J;g++){var r=s[g],q,w=l+"["+g+"]";switch(r.status){case "added":var D=z?y[r.value]:K(e.utils.unwrapObservable(c),r.value,m);q=F(void 0,D,a,d,b,w,k);h()||(q=e.utils.unwrapObservable(q));w=O(e.utils.unwrapObservable(c),D,n);q===N?B++:A[w-B]=q;n[w]=!0;break;case "retained":D=z?y[r.value]:K(e.utils.unwrapObservable(c),r.value,m);q=K(b,r.value,m);F(q,D,a,d,b,w,
|
||||
k);w=O(e.utils.unwrapObservable(c),D,n);A[w]=q;n[w]=!0;break;case "deleted":q=K(b,r.value,m)}t.push({event:r.status,item:q})}b(A);a[d]&&a[d].arrayChanged&&e.utils.arrayForEach(t,function(b){a[d].arrayChanged(b.event,b.item)})}else if(P(c)){b=e.utils.unwrapObservable(b);if(!b){if(h())return s=x(),u()&&(s=v(s)),s;if(u())return v(s);b={}}u()&&(b=v(b));I.save(c,b);if(u())return b;Q(c,function(d){var f=l.length?l+"."+d:d;if(-1==e.utils.arrayIndexOf(a.ignore,f))if(-1!=e.utils.arrayIndexOf(a.copy,f))b[d]=
|
||||
c[d];else if("object"!=typeof c[d]&&"array"!=typeof c[d]&&0<a.observe.length&&-1==e.utils.arrayIndexOf(a.observe,f))b[d]=c[d],a.copiedProperties[f]=!0;else{var g=I.get(c[d]),k=F(b[d],c[d],a,d,b,f,b),g=g||k;if(0<a.observe.length&&-1==e.utils.arrayIndexOf(a.observe,f))b[d]=g(),a.copiedProperties[f]=!0;else{if(e.isWriteableObservable(b[d])){if(g=e.utils.unwrapObservable(g),b[d]()!==g)b[d](g)}else g=void 0===b[d]?g:e.utils.unwrapObservable(g),b[d]=g;a.mappedProperties[f]=!0}}})}else switch(f.getType(c)){case "function":u()?
|
||||
e.isWriteableObservable(c)?(c(v(c)),b=c):b=v(c):b=c;break;default:if(e.isWriteableObservable(b))return q=u()?v(b):e.utils.unwrapObservable(c),b(q),q;h()||u();b=h()?x():e.observable(e.utils.unwrapObservable(c));u()&&b(v(b))}return b}function O(b,c,a){for(var d=0,e=b.length;d<e;d++)if(!0!==a[d]&&b[d]===c)return d;return null}function R(b,c){var a;c&&(a=c(b));"undefined"===f.getType(a)&&(a=b);return e.utils.unwrapObservable(a)}function K(b,c,a){b=e.utils.unwrapObservable(b);for(var d=0,f=b.length;d<
|
||||
f;d++){var l=b[d];if(R(l,a)===c)return l}throw Error("When calling ko.update*, the key '"+c+"' was not found!");}function C(b,c){return e.utils.arrayMap(e.utils.unwrapObservable(b),function(a){return c?R(a,c):a})}function Q(b,c){if("array"===f.getType(b))for(var a=0;a<b.length;a++)c(a);else for(a in b)c(a)}function P(b){var c=f.getType(b);return("object"===c||"array"===c)&&null!==b}function T(){var b=[],c=[];this.save=function(a,d){var f=e.utils.arrayIndexOf(b,a);0<=f?c[f]=d:(b.push(a),c.push(d))};
|
||||
this.get=function(a){a=e.utils.arrayIndexOf(b,a);return 0<=a?c[a]:void 0}}function S(){var b={},c=function(a){var c;try{c=a}catch(e){c="$$$"}a=b[c];void 0===a&&(a=new T,b[c]=a);return a};this.save=function(a,b){c(a).save(a,b)};this.get=function(a){return c(a).get(a)}}var p="__ko_mapping__",H=e.dependentObservable,B=0,G,I,L=["create","update","key","arrayChanged"],N={},x={include:["_destroy"],ignore:[],copy:[],observe:[]},j=x;f.isMapped=function(b){return(b=e.utils.unwrapObservable(b))&&b[p]};f.fromJS=
|
||||
function(b){if(0==arguments.length)throw Error("When calling ko.fromJS, pass the object you want to convert.");try{B++||(G=[],I=new S);var c,a;2==arguments.length&&(arguments[1][p]?a=arguments[1]:c=arguments[1]);3==arguments.length&&(c=arguments[1],a=arguments[2]);a&&(c=E(c,a[p]));c=z(c);var d=F(a,b,c);a&&(d=a);if(!--B)for(;G.length;){var e=G.pop();e&&(e(),e.__DO.throttleEvaluation=e.throttleEvaluation)}d[p]=E(d[p],c);return d}catch(f){throw B=0,f;}};f.fromJSON=function(b){var c=e.utils.parseJson(b);
|
||||
arguments[0]=c;return f.fromJS.apply(this,arguments)};f.updateFromJS=function(){throw Error("ko.mapping.updateFromJS, use ko.mapping.fromJS instead. Please note that the order of parameters is different!");};f.updateFromJSON=function(){throw Error("ko.mapping.updateFromJSON, use ko.mapping.fromJSON instead. Please note that the order of parameters is different!");};f.toJS=function(b,c){j||f.resetDefaultOptions();if(0==arguments.length)throw Error("When calling ko.mapping.toJS, pass the object you want to convert.");
|
||||
if("array"!==f.getType(j.ignore))throw Error("ko.mapping.defaultOptions().ignore should be an array.");if("array"!==f.getType(j.include))throw Error("ko.mapping.defaultOptions().include should be an array.");if("array"!==f.getType(j.copy))throw Error("ko.mapping.defaultOptions().copy should be an array.");c=z(c,b[p]);return f.visitModel(b,function(a){return e.utils.unwrapObservable(a)},c)};f.toJSON=function(b,c){var a=f.toJS(b,c);return e.utils.stringifyJson(a)};f.defaultOptions=function(){if(0<arguments.length)j=
|
||||
arguments[0];else return j};f.resetDefaultOptions=function(){j={include:x.include.slice(0),ignore:x.ignore.slice(0),copy:x.copy.slice(0)}};f.getType=function(b){if(b&&"object"===typeof b){if(b.constructor===Date)return"date";if(b.constructor===Array)return"array"}return typeof b};f.visitModel=function(b,c,a){a=a||{};a.visitedObjects=a.visitedObjects||new S;var d,k=e.utils.unwrapObservable(b);if(P(k))a=z(a,k[p]),c(b,a.parentName),d="array"===f.getType(k)?[]:{};else return c(b,a.parentName);a.visitedObjects.save(b,
|
||||
d);var l=a.parentName;Q(k,function(b){if(!(a.ignore&&-1!=e.utils.arrayIndexOf(a.ignore,b))){var j=k[b],g=a,h=l||"";"array"===f.getType(k)?l&&(h+="["+b+"]"):(l&&(h+="."),h+=b);g.parentName=h;if(!(-1===e.utils.arrayIndexOf(a.copy,b)&&-1===e.utils.arrayIndexOf(a.include,b)&&k[p]&&k[p].mappedProperties&&!k[p].mappedProperties[b]&&k[p].copiedProperties&&!k[p].copiedProperties[b]&&"array"!==f.getType(k)))switch(f.getType(e.utils.unwrapObservable(j))){case "object":case "array":case "undefined":g=a.visitedObjects.get(j);
|
||||
d[b]="undefined"!==f.getType(g)?g:f.visitModel(j,c,a);break;default:d[b]=c(j,a.parentName)}}});return d}});
|
||||
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Translated default messages for the jQuery validation plugin.
|
||||
* Locale: PT (Portuguese; português)
|
||||
* Region: PT (Portugal)
|
||||
*/
|
||||
(function ($) {
|
||||
$.extend($.validator.messages, {
|
||||
required: "Campo de preenchimento obrigatório.",
|
||||
remote: "Por favor, corrija este campo.",
|
||||
email: "Por favor, introduza um endereço eletrónico válido.",
|
||||
url: "Por favor, introduza um URL válido.",
|
||||
date: "Por favor, introduza uma data válida.",
|
||||
dateISO: "Por favor, introduza uma data válida (ISO).",
|
||||
number: "Por favor, introduza um número válido.",
|
||||
digits: "Por favor, introduza apenas dígitos.",
|
||||
creditcard: "Por favor, introduza um número de cartão de crédito válido.",
|
||||
equalTo: "Por favor, introduza de novo o mesmo valor.",
|
||||
accept: "Por favor, introduza um ficheiro com uma extensão válida.",
|
||||
maxlength: $.validator.format("Por favor, não introduza mais do que {0} caracteres."),
|
||||
minlength: $.validator.format("Por favor, introduza pelo menos {0} caracteres."),
|
||||
rangelength: $.validator.format("Por favor, introduza entre {0} e {1} caracteres."),
|
||||
range: $.validator.format("Por favor, introduza um valor entre {0} e {1}."),
|
||||
max: $.validator.format("Por favor, introduza um valor menor ou igual a {0}."),
|
||||
min: $.validator.format("Por favor, introduza um valor maior ou igual a {0}.")
|
||||
});
|
||||
}(jQuery));
|
||||
@ -1,927 +0,0 @@
|
||||
//
|
||||
// Definitions for schema: http://ws.safemode.pt/
|
||||
// http://localhost:8080/safemode/safemode-ws/utilizador?xsd=1
|
||||
//
|
||||
//
|
||||
// Constructor for XML Schema item {http://ws.safemode.pt/}recoverPasswordResponse
|
||||
//
|
||||
function ws_safemode_pt__recoverPasswordResponse () {
|
||||
this.typeMarker = 'ws_safemode_pt__recoverPasswordResponse';
|
||||
this._return = '';
|
||||
}
|
||||
|
||||
//
|
||||
// accessor is ws_safemode_pt__recoverPasswordResponse.prototype.getReturn
|
||||
// element get for return
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}boolean
|
||||
// - required element
|
||||
//
|
||||
// element set for return
|
||||
// setter function is is ws_safemode_pt__recoverPasswordResponse.prototype.setReturn
|
||||
//
|
||||
function ws_safemode_pt__recoverPasswordResponse_getReturn() { return this._return;}
|
||||
|
||||
ws_safemode_pt__recoverPasswordResponse.prototype.getReturn = ws_safemode_pt__recoverPasswordResponse_getReturn;
|
||||
|
||||
function ws_safemode_pt__recoverPasswordResponse_setReturn(value) { this._return = value;}
|
||||
|
||||
ws_safemode_pt__recoverPasswordResponse.prototype.setReturn = ws_safemode_pt__recoverPasswordResponse_setReturn;
|
||||
//
|
||||
// Serialize {http://ws.safemode.pt/}recoverPasswordResponse
|
||||
//
|
||||
function ws_safemode_pt__recoverPasswordResponse_serialize(cxfjsutils, elementName, extraNamespaces) {
|
||||
var xml = '';
|
||||
if (elementName != null) {
|
||||
xml = xml + '<';
|
||||
xml = xml + elementName;
|
||||
if (extraNamespaces) {
|
||||
xml = xml + ' ' + extraNamespaces;
|
||||
}
|
||||
xml = xml + '>';
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
xml = xml + '<return>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._return);
|
||||
xml = xml + '</return>';
|
||||
}
|
||||
if (elementName != null) {
|
||||
xml = xml + '</';
|
||||
xml = xml + elementName;
|
||||
xml = xml + '>';
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
|
||||
ws_safemode_pt__recoverPasswordResponse.prototype.serialize = ws_safemode_pt__recoverPasswordResponse_serialize;
|
||||
|
||||
function ws_safemode_pt__recoverPasswordResponse_deserialize (cxfjsutils, element) {
|
||||
var newobject = new ws_safemode_pt__recoverPasswordResponse();
|
||||
cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));
|
||||
var curElement = cxfjsutils.getFirstElementChild(element);
|
||||
var item;
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing return');
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = (value == 'true');
|
||||
}
|
||||
newobject.setReturn(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
return newobject;
|
||||
}
|
||||
|
||||
//
|
||||
// Constructor for XML Schema item {http://ws.safemode.pt/}recoverPassword
|
||||
//
|
||||
function ws_safemode_pt__recoverPassword () {
|
||||
this.typeMarker = 'ws_safemode_pt__recoverPassword';
|
||||
this._username = null;
|
||||
this._token = null;
|
||||
this._password = null;
|
||||
this._passwordRepeat = null;
|
||||
}
|
||||
|
||||
//
|
||||
// accessor is ws_safemode_pt__recoverPassword.prototype.getUsername
|
||||
// element get for username
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}string
|
||||
// - optional element
|
||||
//
|
||||
// element set for username
|
||||
// setter function is is ws_safemode_pt__recoverPassword.prototype.setUsername
|
||||
//
|
||||
function ws_safemode_pt__recoverPassword_getUsername() { return this._username;}
|
||||
|
||||
ws_safemode_pt__recoverPassword.prototype.getUsername = ws_safemode_pt__recoverPassword_getUsername;
|
||||
|
||||
function ws_safemode_pt__recoverPassword_setUsername(value) { this._username = value;}
|
||||
|
||||
ws_safemode_pt__recoverPassword.prototype.setUsername = ws_safemode_pt__recoverPassword_setUsername;
|
||||
//
|
||||
// accessor is ws_safemode_pt__recoverPassword.prototype.getToken
|
||||
// element get for token
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}string
|
||||
// - optional element
|
||||
//
|
||||
// element set for token
|
||||
// setter function is is ws_safemode_pt__recoverPassword.prototype.setToken
|
||||
//
|
||||
function ws_safemode_pt__recoverPassword_getToken() { return this._token;}
|
||||
|
||||
ws_safemode_pt__recoverPassword.prototype.getToken = ws_safemode_pt__recoverPassword_getToken;
|
||||
|
||||
function ws_safemode_pt__recoverPassword_setToken(value) { this._token = value;}
|
||||
|
||||
ws_safemode_pt__recoverPassword.prototype.setToken = ws_safemode_pt__recoverPassword_setToken;
|
||||
//
|
||||
// accessor is ws_safemode_pt__recoverPassword.prototype.getPassword
|
||||
// element get for password
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}string
|
||||
// - optional element
|
||||
//
|
||||
// element set for password
|
||||
// setter function is is ws_safemode_pt__recoverPassword.prototype.setPassword
|
||||
//
|
||||
function ws_safemode_pt__recoverPassword_getPassword() { return this._password;}
|
||||
|
||||
ws_safemode_pt__recoverPassword.prototype.getPassword = ws_safemode_pt__recoverPassword_getPassword;
|
||||
|
||||
function ws_safemode_pt__recoverPassword_setPassword(value) { this._password = value;}
|
||||
|
||||
ws_safemode_pt__recoverPassword.prototype.setPassword = ws_safemode_pt__recoverPassword_setPassword;
|
||||
//
|
||||
// accessor is ws_safemode_pt__recoverPassword.prototype.getPasswordRepeat
|
||||
// element get for passwordRepeat
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}string
|
||||
// - optional element
|
||||
//
|
||||
// element set for passwordRepeat
|
||||
// setter function is is ws_safemode_pt__recoverPassword.prototype.setPasswordRepeat
|
||||
//
|
||||
function ws_safemode_pt__recoverPassword_getPasswordRepeat() { return this._passwordRepeat;}
|
||||
|
||||
ws_safemode_pt__recoverPassword.prototype.getPasswordRepeat = ws_safemode_pt__recoverPassword_getPasswordRepeat;
|
||||
|
||||
function ws_safemode_pt__recoverPassword_setPasswordRepeat(value) { this._passwordRepeat = value;}
|
||||
|
||||
ws_safemode_pt__recoverPassword.prototype.setPasswordRepeat = ws_safemode_pt__recoverPassword_setPasswordRepeat;
|
||||
//
|
||||
// Serialize {http://ws.safemode.pt/}recoverPassword
|
||||
//
|
||||
function ws_safemode_pt__recoverPassword_serialize(cxfjsutils, elementName, extraNamespaces) {
|
||||
var xml = '';
|
||||
if (elementName != null) {
|
||||
xml = xml + '<';
|
||||
xml = xml + elementName;
|
||||
if (extraNamespaces) {
|
||||
xml = xml + ' ' + extraNamespaces;
|
||||
}
|
||||
xml = xml + '>';
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
if (this._username != null) {
|
||||
xml = xml + '<username>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._username);
|
||||
xml = xml + '</username>';
|
||||
}
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
if (this._token != null) {
|
||||
xml = xml + '<token>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._token);
|
||||
xml = xml + '</token>';
|
||||
}
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
if (this._password != null) {
|
||||
xml = xml + '<password>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._password);
|
||||
xml = xml + '</password>';
|
||||
}
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
if (this._passwordRepeat != null) {
|
||||
xml = xml + '<passwordRepeat>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._passwordRepeat);
|
||||
xml = xml + '</passwordRepeat>';
|
||||
}
|
||||
}
|
||||
if (elementName != null) {
|
||||
xml = xml + '</';
|
||||
xml = xml + elementName;
|
||||
xml = xml + '>';
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
|
||||
ws_safemode_pt__recoverPassword.prototype.serialize = ws_safemode_pt__recoverPassword_serialize;
|
||||
|
||||
function ws_safemode_pt__recoverPassword_deserialize (cxfjsutils, element) {
|
||||
var newobject = new ws_safemode_pt__recoverPassword();
|
||||
cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));
|
||||
var curElement = cxfjsutils.getFirstElementChild(element);
|
||||
var item;
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing username');
|
||||
if (curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'username')) {
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = value;
|
||||
}
|
||||
newobject.setUsername(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
}
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing token');
|
||||
if (curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'token')) {
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = value;
|
||||
}
|
||||
newobject.setToken(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
}
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing password');
|
||||
if (curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'password')) {
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = value;
|
||||
}
|
||||
newobject.setPassword(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
}
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing passwordRepeat');
|
||||
if (curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'passwordRepeat')) {
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = value;
|
||||
}
|
||||
newobject.setPasswordRepeat(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
}
|
||||
return newobject;
|
||||
}
|
||||
|
||||
//
|
||||
// Constructor for XML Schema item {http://ws.safemode.pt/}sendEmailResponse
|
||||
//
|
||||
function ws_safemode_pt__sendEmailResponse () {
|
||||
this.typeMarker = 'ws_safemode_pt__sendEmailResponse';
|
||||
this._return = null;
|
||||
}
|
||||
|
||||
//
|
||||
// accessor is ws_safemode_pt__sendEmailResponse.prototype.getReturn
|
||||
// element get for return
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}int
|
||||
// - optional element
|
||||
//
|
||||
// element set for return
|
||||
// setter function is is ws_safemode_pt__sendEmailResponse.prototype.setReturn
|
||||
//
|
||||
function ws_safemode_pt__sendEmailResponse_getReturn() { return this._return;}
|
||||
|
||||
ws_safemode_pt__sendEmailResponse.prototype.getReturn = ws_safemode_pt__sendEmailResponse_getReturn;
|
||||
|
||||
function ws_safemode_pt__sendEmailResponse_setReturn(value) { this._return = value;}
|
||||
|
||||
ws_safemode_pt__sendEmailResponse.prototype.setReturn = ws_safemode_pt__sendEmailResponse_setReturn;
|
||||
//
|
||||
// Serialize {http://ws.safemode.pt/}sendEmailResponse
|
||||
//
|
||||
function ws_safemode_pt__sendEmailResponse_serialize(cxfjsutils, elementName, extraNamespaces) {
|
||||
var xml = '';
|
||||
if (elementName != null) {
|
||||
xml = xml + '<';
|
||||
xml = xml + elementName;
|
||||
if (extraNamespaces) {
|
||||
xml = xml + ' ' + extraNamespaces;
|
||||
}
|
||||
xml = xml + '>';
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
if (this._return != null) {
|
||||
xml = xml + '<return>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._return);
|
||||
xml = xml + '</return>';
|
||||
}
|
||||
}
|
||||
if (elementName != null) {
|
||||
xml = xml + '</';
|
||||
xml = xml + elementName;
|
||||
xml = xml + '>';
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
|
||||
ws_safemode_pt__sendEmailResponse.prototype.serialize = ws_safemode_pt__sendEmailResponse_serialize;
|
||||
|
||||
function ws_safemode_pt__sendEmailResponse_deserialize (cxfjsutils, element) {
|
||||
var newobject = new ws_safemode_pt__sendEmailResponse();
|
||||
cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));
|
||||
var curElement = cxfjsutils.getFirstElementChild(element);
|
||||
var item;
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing return');
|
||||
if (curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'return')) {
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = parseInt(value);
|
||||
}
|
||||
newobject.setReturn(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
}
|
||||
return newobject;
|
||||
}
|
||||
|
||||
//
|
||||
// Constructor for XML Schema item {http://ws.safemode.pt/}verificarEmail
|
||||
//
|
||||
function ws_safemode_pt__verificarEmail () {
|
||||
this.typeMarker = 'ws_safemode_pt__verificarEmail';
|
||||
this._username = null;
|
||||
this._email = null;
|
||||
}
|
||||
|
||||
//
|
||||
// accessor is ws_safemode_pt__verificarEmail.prototype.getUsername
|
||||
// element get for username
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}string
|
||||
// - optional element
|
||||
//
|
||||
// element set for username
|
||||
// setter function is is ws_safemode_pt__verificarEmail.prototype.setUsername
|
||||
//
|
||||
function ws_safemode_pt__verificarEmail_getUsername() { return this._username;}
|
||||
|
||||
ws_safemode_pt__verificarEmail.prototype.getUsername = ws_safemode_pt__verificarEmail_getUsername;
|
||||
|
||||
function ws_safemode_pt__verificarEmail_setUsername(value) { this._username = value;}
|
||||
|
||||
ws_safemode_pt__verificarEmail.prototype.setUsername = ws_safemode_pt__verificarEmail_setUsername;
|
||||
//
|
||||
// accessor is ws_safemode_pt__verificarEmail.prototype.getEmail
|
||||
// element get for email
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}string
|
||||
// - optional element
|
||||
//
|
||||
// element set for email
|
||||
// setter function is is ws_safemode_pt__verificarEmail.prototype.setEmail
|
||||
//
|
||||
function ws_safemode_pt__verificarEmail_getEmail() { return this._email;}
|
||||
|
||||
ws_safemode_pt__verificarEmail.prototype.getEmail = ws_safemode_pt__verificarEmail_getEmail;
|
||||
|
||||
function ws_safemode_pt__verificarEmail_setEmail(value) { this._email = value;}
|
||||
|
||||
ws_safemode_pt__verificarEmail.prototype.setEmail = ws_safemode_pt__verificarEmail_setEmail;
|
||||
//
|
||||
// Serialize {http://ws.safemode.pt/}verificarEmail
|
||||
//
|
||||
function ws_safemode_pt__verificarEmail_serialize(cxfjsutils, elementName, extraNamespaces) {
|
||||
var xml = '';
|
||||
if (elementName != null) {
|
||||
xml = xml + '<';
|
||||
xml = xml + elementName;
|
||||
if (extraNamespaces) {
|
||||
xml = xml + ' ' + extraNamespaces;
|
||||
}
|
||||
xml = xml + '>';
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
if (this._username != null) {
|
||||
xml = xml + '<username>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._username);
|
||||
xml = xml + '</username>';
|
||||
}
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
if (this._email != null) {
|
||||
xml = xml + '<email>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._email);
|
||||
xml = xml + '</email>';
|
||||
}
|
||||
}
|
||||
if (elementName != null) {
|
||||
xml = xml + '</';
|
||||
xml = xml + elementName;
|
||||
xml = xml + '>';
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
|
||||
ws_safemode_pt__verificarEmail.prototype.serialize = ws_safemode_pt__verificarEmail_serialize;
|
||||
|
||||
function ws_safemode_pt__verificarEmail_deserialize (cxfjsutils, element) {
|
||||
var newobject = new ws_safemode_pt__verificarEmail();
|
||||
cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));
|
||||
var curElement = cxfjsutils.getFirstElementChild(element);
|
||||
var item;
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing username');
|
||||
if (curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'username')) {
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = value;
|
||||
}
|
||||
newobject.setUsername(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
}
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing email');
|
||||
if (curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'email')) {
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = value;
|
||||
}
|
||||
newobject.setEmail(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
}
|
||||
return newobject;
|
||||
}
|
||||
|
||||
//
|
||||
// Constructor for XML Schema item {http://ws.safemode.pt/}verificarEmailResponse
|
||||
//
|
||||
function ws_safemode_pt__verificarEmailResponse () {
|
||||
this.typeMarker = 'ws_safemode_pt__verificarEmailResponse';
|
||||
this._return = '';
|
||||
}
|
||||
|
||||
//
|
||||
// accessor is ws_safemode_pt__verificarEmailResponse.prototype.getReturn
|
||||
// element get for return
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}boolean
|
||||
// - required element
|
||||
//
|
||||
// element set for return
|
||||
// setter function is is ws_safemode_pt__verificarEmailResponse.prototype.setReturn
|
||||
//
|
||||
function ws_safemode_pt__verificarEmailResponse_getReturn() { return this._return;}
|
||||
|
||||
ws_safemode_pt__verificarEmailResponse.prototype.getReturn = ws_safemode_pt__verificarEmailResponse_getReturn;
|
||||
|
||||
function ws_safemode_pt__verificarEmailResponse_setReturn(value) { this._return = value;}
|
||||
|
||||
ws_safemode_pt__verificarEmailResponse.prototype.setReturn = ws_safemode_pt__verificarEmailResponse_setReturn;
|
||||
//
|
||||
// Serialize {http://ws.safemode.pt/}verificarEmailResponse
|
||||
//
|
||||
function ws_safemode_pt__verificarEmailResponse_serialize(cxfjsutils, elementName, extraNamespaces) {
|
||||
var xml = '';
|
||||
if (elementName != null) {
|
||||
xml = xml + '<';
|
||||
xml = xml + elementName;
|
||||
if (extraNamespaces) {
|
||||
xml = xml + ' ' + extraNamespaces;
|
||||
}
|
||||
xml = xml + '>';
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
xml = xml + '<return>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._return);
|
||||
xml = xml + '</return>';
|
||||
}
|
||||
if (elementName != null) {
|
||||
xml = xml + '</';
|
||||
xml = xml + elementName;
|
||||
xml = xml + '>';
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
|
||||
ws_safemode_pt__verificarEmailResponse.prototype.serialize = ws_safemode_pt__verificarEmailResponse_serialize;
|
||||
|
||||
function ws_safemode_pt__verificarEmailResponse_deserialize (cxfjsutils, element) {
|
||||
var newobject = new ws_safemode_pt__verificarEmailResponse();
|
||||
cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));
|
||||
var curElement = cxfjsutils.getFirstElementChild(element);
|
||||
var item;
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing return');
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = (value == 'true');
|
||||
}
|
||||
newobject.setReturn(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
return newobject;
|
||||
}
|
||||
|
||||
//
|
||||
// Constructor for XML Schema item {http://ws.safemode.pt/}sendEmail
|
||||
//
|
||||
function ws_safemode_pt__sendEmail () {
|
||||
this.typeMarker = 'ws_safemode_pt__sendEmail';
|
||||
this._username = null;
|
||||
}
|
||||
|
||||
//
|
||||
// accessor is ws_safemode_pt__sendEmail.prototype.getUsername
|
||||
// element get for username
|
||||
// - element type is {http://www.w3.org/2001/XMLSchema}string
|
||||
// - optional element
|
||||
//
|
||||
// element set for username
|
||||
// setter function is is ws_safemode_pt__sendEmail.prototype.setUsername
|
||||
//
|
||||
function ws_safemode_pt__sendEmail_getUsername() { return this._username;}
|
||||
|
||||
ws_safemode_pt__sendEmail.prototype.getUsername = ws_safemode_pt__sendEmail_getUsername;
|
||||
|
||||
function ws_safemode_pt__sendEmail_setUsername(value) { this._username = value;}
|
||||
|
||||
ws_safemode_pt__sendEmail.prototype.setUsername = ws_safemode_pt__sendEmail_setUsername;
|
||||
//
|
||||
// Serialize {http://ws.safemode.pt/}sendEmail
|
||||
//
|
||||
function ws_safemode_pt__sendEmail_serialize(cxfjsutils, elementName, extraNamespaces) {
|
||||
var xml = '';
|
||||
if (elementName != null) {
|
||||
xml = xml + '<';
|
||||
xml = xml + elementName;
|
||||
if (extraNamespaces) {
|
||||
xml = xml + ' ' + extraNamespaces;
|
||||
}
|
||||
xml = xml + '>';
|
||||
}
|
||||
// block for local variables
|
||||
{
|
||||
if (this._username != null) {
|
||||
xml = xml + '<username>';
|
||||
xml = xml + cxfjsutils.escapeXmlEntities(this._username);
|
||||
xml = xml + '</username>';
|
||||
}
|
||||
}
|
||||
if (elementName != null) {
|
||||
xml = xml + '</';
|
||||
xml = xml + elementName;
|
||||
xml = xml + '>';
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
|
||||
ws_safemode_pt__sendEmail.prototype.serialize = ws_safemode_pt__sendEmail_serialize;
|
||||
|
||||
function ws_safemode_pt__sendEmail_deserialize (cxfjsutils, element) {
|
||||
var newobject = new ws_safemode_pt__sendEmail();
|
||||
cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));
|
||||
var curElement = cxfjsutils.getFirstElementChild(element);
|
||||
var item;
|
||||
cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));
|
||||
cxfjsutils.trace('processing username');
|
||||
if (curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'username')) {
|
||||
var value = null;
|
||||
if (!cxfjsutils.isElementNil(curElement)) {
|
||||
value = cxfjsutils.getNodeText(curElement);
|
||||
item = value;
|
||||
}
|
||||
newobject.setUsername(item);
|
||||
var item = null;
|
||||
if (curElement != null) {
|
||||
curElement = cxfjsutils.getNextElementSibling(curElement);
|
||||
}
|
||||
}
|
||||
return newobject;
|
||||
}
|
||||
|
||||
//
|
||||
// Definitions for schema: null
|
||||
// http://localhost:8080/safemode/safemode-ws/utilizador?wsdl=1#types1
|
||||
//
|
||||
//
|
||||
// Definitions for service: {http://impl.ws.safemode.pt/}UtilizadorWSImplService
|
||||
//
|
||||
|
||||
// Javascript for {http://ws.safemode.pt/}UtilizadoresWS
|
||||
|
||||
function ws_safemode_pt__UtilizadoresWS () {
|
||||
this.jsutils = new CxfApacheOrgUtil();
|
||||
this.jsutils.interfaceObject = this;
|
||||
this.synchronous = false;
|
||||
this.url = null;
|
||||
this.client = null;
|
||||
this.response = null;
|
||||
this.globalElementSerializers = [];
|
||||
this.globalElementDeserializers = [];
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}recoverPasswordResponse'] = ws_safemode_pt__recoverPasswordResponse_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}recoverPasswordResponse'] = ws_safemode_pt__recoverPasswordResponse_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}sendEmailResponse'] = ws_safemode_pt__sendEmailResponse_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}sendEmailResponse'] = ws_safemode_pt__sendEmailResponse_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}recoverPassword'] = ws_safemode_pt__recoverPassword_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}recoverPassword'] = ws_safemode_pt__recoverPassword_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}verificarEmail'] = ws_safemode_pt__verificarEmail_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}verificarEmail'] = ws_safemode_pt__verificarEmail_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}verificarEmailResponse'] = ws_safemode_pt__verificarEmailResponse_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}verificarEmailResponse'] = ws_safemode_pt__verificarEmailResponse_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}sendEmail'] = ws_safemode_pt__sendEmail_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}sendEmail'] = ws_safemode_pt__sendEmail_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}recoverPasswordResponse'] = ws_safemode_pt__recoverPasswordResponse_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}recoverPasswordResponse'] = ws_safemode_pt__recoverPasswordResponse_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}recoverPassword'] = ws_safemode_pt__recoverPassword_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}recoverPassword'] = ws_safemode_pt__recoverPassword_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}sendEmailResponse'] = ws_safemode_pt__sendEmailResponse_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}sendEmailResponse'] = ws_safemode_pt__sendEmailResponse_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}verificarEmail'] = ws_safemode_pt__verificarEmail_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}verificarEmail'] = ws_safemode_pt__verificarEmail_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}verificarEmailResponse'] = ws_safemode_pt__verificarEmailResponse_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}verificarEmailResponse'] = ws_safemode_pt__verificarEmailResponse_deserialize;
|
||||
this.globalElementSerializers['{http://ws.safemode.pt/}sendEmail'] = ws_safemode_pt__sendEmail_serialize;
|
||||
this.globalElementDeserializers['{http://ws.safemode.pt/}sendEmail'] = ws_safemode_pt__sendEmail_deserialize;
|
||||
}
|
||||
|
||||
function ws_safemode_pt__verificarEmail_op_onsuccess(client, responseXml) {
|
||||
if (client.user_onsuccess) {
|
||||
var responseObject = null;
|
||||
var element = responseXml.documentElement;
|
||||
this.jsutils.trace('responseXml: ' + this.jsutils.traceElementName(element));
|
||||
element = this.jsutils.getFirstElementChild(element);
|
||||
this.jsutils.trace('first element child: ' + this.jsutils.traceElementName(element));
|
||||
while (!this.jsutils.isNodeNamedNS(element, 'http://schemas.xmlsoap.org/soap/envelope/', 'Body')) {
|
||||
element = this.jsutils.getNextElementSibling(element);
|
||||
if (element == null) {
|
||||
throw 'No env:Body in message.'
|
||||
}
|
||||
}
|
||||
element = this.jsutils.getFirstElementChild(element);
|
||||
this.jsutils.trace('part element: ' + this.jsutils.traceElementName(element));
|
||||
this.jsutils.trace('calling ws_safemode_pt__verificarEmailResponse_deserializeResponse');
|
||||
responseObject = ws_safemode_pt__verificarEmailResponse_deserializeResponse(this.jsutils, element);
|
||||
client.user_onsuccess(responseObject);
|
||||
}
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.verificarEmail_onsuccess = ws_safemode_pt__verificarEmail_op_onsuccess;
|
||||
|
||||
function ws_safemode_pt__verificarEmail_op_onerror(client) {
|
||||
if (client.user_onerror) {
|
||||
var httpStatus;
|
||||
var httpStatusText;
|
||||
try {
|
||||
httpStatus = client.req.status;
|
||||
httpStatusText = client.req.statusText;
|
||||
} catch(e) {
|
||||
httpStatus = -1;
|
||||
httpStatusText = 'Error opening connection to server';
|
||||
}
|
||||
client.user_onerror(httpStatus, httpStatusText);
|
||||
}
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.verificarEmail_onerror = ws_safemode_pt__verificarEmail_op_onerror;
|
||||
|
||||
//
|
||||
// Operation {http://ws.safemode.pt/}verificarEmail
|
||||
// Wrapped operation.
|
||||
// parameter username
|
||||
// - simple type {http://www.w3.org/2001/XMLSchema}string// parameter email
|
||||
// - simple type {http://www.w3.org/2001/XMLSchema}string//
|
||||
function ws_safemode_pt__verificarEmail_op(successCallback, errorCallback, username, email) {
|
||||
this.client = new CxfApacheOrgClient(this.jsutils);
|
||||
var xml = null;
|
||||
var args = new Array(2);
|
||||
args[0] = username;
|
||||
args[1] = email;
|
||||
xml = this.verificarEmail_serializeInput(this.jsutils, args);
|
||||
this.client.user_onsuccess = successCallback;
|
||||
this.client.user_onerror = errorCallback;
|
||||
var closureThis = this;
|
||||
this.client.onsuccess = function(client, responseXml) { closureThis.verificarEmail_onsuccess(client, responseXml); };
|
||||
this.client.onerror = function(client) { closureThis.verificarEmail_onerror(client); };
|
||||
var requestHeaders = [];
|
||||
requestHeaders['SOAPAction'] = '';
|
||||
this.jsutils.trace('synchronous = ' + this.synchronous);
|
||||
this.client.request(this.url, xml, null, this.synchronous, requestHeaders);
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.verificarEmail = ws_safemode_pt__verificarEmail_op;
|
||||
|
||||
function ws_safemode_pt__verificarEmail_serializeInput(cxfjsutils, args) {
|
||||
var wrapperObj = new ws_safemode_pt__verificarEmail();
|
||||
wrapperObj.setUsername(args[0]);
|
||||
wrapperObj.setEmail(args[1]);
|
||||
var xml;
|
||||
xml = cxfjsutils.beginSoap11Message("xmlns:jns0='http://ws.safemode.pt/' ");
|
||||
// block for local variables
|
||||
{
|
||||
xml = xml + wrapperObj.serialize(cxfjsutils, 'jns0:verificarEmail', null);
|
||||
}
|
||||
xml = xml + cxfjsutils.endSoap11Message();
|
||||
return xml;
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.verificarEmail_serializeInput = ws_safemode_pt__verificarEmail_serializeInput;
|
||||
|
||||
function ws_safemode_pt__verificarEmailResponse_deserializeResponse(cxfjsutils, partElement) {
|
||||
var returnObject = ws_safemode_pt__verificarEmailResponse_deserialize (cxfjsutils, partElement);
|
||||
|
||||
return returnObject;
|
||||
}
|
||||
function ws_safemode_pt__sendEmail_op_onsuccess(client, responseXml) {
|
||||
if (client.user_onsuccess) {
|
||||
var responseObject = null;
|
||||
var element = responseXml.documentElement;
|
||||
this.jsutils.trace('responseXml: ' + this.jsutils.traceElementName(element));
|
||||
element = this.jsutils.getFirstElementChild(element);
|
||||
this.jsutils.trace('first element child: ' + this.jsutils.traceElementName(element));
|
||||
while (!this.jsutils.isNodeNamedNS(element, 'http://schemas.xmlsoap.org/soap/envelope/', 'Body')) {
|
||||
element = this.jsutils.getNextElementSibling(element);
|
||||
if (element == null) {
|
||||
throw 'No env:Body in message.'
|
||||
}
|
||||
}
|
||||
element = this.jsutils.getFirstElementChild(element);
|
||||
this.jsutils.trace('part element: ' + this.jsutils.traceElementName(element));
|
||||
this.jsutils.trace('calling ws_safemode_pt__sendEmailResponse_deserializeResponse');
|
||||
responseObject = ws_safemode_pt__sendEmailResponse_deserializeResponse(this.jsutils, element);
|
||||
client.user_onsuccess(responseObject);
|
||||
}
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.sendEmail_onsuccess = ws_safemode_pt__sendEmail_op_onsuccess;
|
||||
|
||||
function ws_safemode_pt__sendEmail_op_onerror(client) {
|
||||
if (client.user_onerror) {
|
||||
var httpStatus;
|
||||
var httpStatusText;
|
||||
try {
|
||||
httpStatus = client.req.status;
|
||||
httpStatusText = client.req.statusText;
|
||||
} catch(e) {
|
||||
httpStatus = -1;
|
||||
httpStatusText = 'Error opening connection to server';
|
||||
}
|
||||
client.user_onerror(httpStatus, httpStatusText);
|
||||
}
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.sendEmail_onerror = ws_safemode_pt__sendEmail_op_onerror;
|
||||
|
||||
//
|
||||
// Operation {http://ws.safemode.pt/}sendEmail
|
||||
// Wrapped operation.
|
||||
// parameter username
|
||||
// - simple type {http://www.w3.org/2001/XMLSchema}string//
|
||||
function ws_safemode_pt__sendEmail_op(successCallback, errorCallback, username) {
|
||||
this.client = new CxfApacheOrgClient(this.jsutils);
|
||||
var xml = null;
|
||||
var args = new Array(1);
|
||||
args[0] = username;
|
||||
xml = this.sendEmail_serializeInput(this.jsutils, args);
|
||||
this.client.user_onsuccess = successCallback;
|
||||
this.client.user_onerror = errorCallback;
|
||||
var closureThis = this;
|
||||
this.client.onsuccess = function(client, responseXml) { closureThis.sendEmail_onsuccess(client, responseXml); };
|
||||
this.client.onerror = function(client) { closureThis.sendEmail_onerror(client); };
|
||||
var requestHeaders = [];
|
||||
requestHeaders['SOAPAction'] = '';
|
||||
this.jsutils.trace('synchronous = ' + this.synchronous);
|
||||
this.client.request(this.url, xml, null, this.synchronous, requestHeaders);
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.sendEmail = ws_safemode_pt__sendEmail_op;
|
||||
|
||||
function ws_safemode_pt__sendEmail_serializeInput(cxfjsutils, args) {
|
||||
var wrapperObj = new ws_safemode_pt__sendEmail();
|
||||
wrapperObj.setUsername(args[0]);
|
||||
var xml;
|
||||
xml = cxfjsutils.beginSoap11Message("xmlns:jns0='http://ws.safemode.pt/' ");
|
||||
// block for local variables
|
||||
{
|
||||
xml = xml + wrapperObj.serialize(cxfjsutils, 'jns0:sendEmail', null);
|
||||
}
|
||||
xml = xml + cxfjsutils.endSoap11Message();
|
||||
return xml;
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.sendEmail_serializeInput = ws_safemode_pt__sendEmail_serializeInput;
|
||||
|
||||
function ws_safemode_pt__sendEmailResponse_deserializeResponse(cxfjsutils, partElement) {
|
||||
var returnObject = ws_safemode_pt__sendEmailResponse_deserialize (cxfjsutils, partElement);
|
||||
|
||||
return returnObject;
|
||||
}
|
||||
function ws_safemode_pt__recoverPassword_op_onsuccess(client, responseXml) {
|
||||
if (client.user_onsuccess) {
|
||||
var responseObject = null;
|
||||
var element = responseXml.documentElement;
|
||||
this.jsutils.trace('responseXml: ' + this.jsutils.traceElementName(element));
|
||||
element = this.jsutils.getFirstElementChild(element);
|
||||
this.jsutils.trace('first element child: ' + this.jsutils.traceElementName(element));
|
||||
while (!this.jsutils.isNodeNamedNS(element, 'http://schemas.xmlsoap.org/soap/envelope/', 'Body')) {
|
||||
element = this.jsutils.getNextElementSibling(element);
|
||||
if (element == null) {
|
||||
throw 'No env:Body in message.'
|
||||
}
|
||||
}
|
||||
element = this.jsutils.getFirstElementChild(element);
|
||||
this.jsutils.trace('part element: ' + this.jsutils.traceElementName(element));
|
||||
this.jsutils.trace('calling ws_safemode_pt__recoverPasswordResponse_deserializeResponse');
|
||||
responseObject = ws_safemode_pt__recoverPasswordResponse_deserializeResponse(this.jsutils, element);
|
||||
client.user_onsuccess(responseObject);
|
||||
}
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.recoverPassword_onsuccess = ws_safemode_pt__recoverPassword_op_onsuccess;
|
||||
|
||||
function ws_safemode_pt__recoverPassword_op_onerror(client) {
|
||||
if (client.user_onerror) {
|
||||
var httpStatus;
|
||||
var httpStatusText;
|
||||
try {
|
||||
httpStatus = client.req.status;
|
||||
httpStatusText = client.req.statusText;
|
||||
} catch(e) {
|
||||
httpStatus = -1;
|
||||
httpStatusText = 'Error opening connection to server';
|
||||
}
|
||||
client.user_onerror(httpStatus, httpStatusText);
|
||||
}
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.recoverPassword_onerror = ws_safemode_pt__recoverPassword_op_onerror;
|
||||
|
||||
//
|
||||
// Operation {http://ws.safemode.pt/}recoverPassword
|
||||
// Wrapped operation.
|
||||
// parameter username
|
||||
// - simple type {http://www.w3.org/2001/XMLSchema}string// parameter token
|
||||
// - simple type {http://www.w3.org/2001/XMLSchema}string// parameter password
|
||||
// - simple type {http://www.w3.org/2001/XMLSchema}string// parameter passwordRepeat
|
||||
// - simple type {http://www.w3.org/2001/XMLSchema}string//
|
||||
function ws_safemode_pt__recoverPassword_op(successCallback, errorCallback, username, token, password, passwordRepeat) {
|
||||
this.client = new CxfApacheOrgClient(this.jsutils);
|
||||
var xml = null;
|
||||
var args = new Array(4);
|
||||
args[0] = username;
|
||||
args[1] = token;
|
||||
args[2] = password;
|
||||
args[3] = passwordRepeat;
|
||||
xml = this.recoverPassword_serializeInput(this.jsutils, args);
|
||||
this.client.user_onsuccess = successCallback;
|
||||
this.client.user_onerror = errorCallback;
|
||||
var closureThis = this;
|
||||
this.client.onsuccess = function(client, responseXml) { closureThis.recoverPassword_onsuccess(client, responseXml); };
|
||||
this.client.onerror = function(client) { closureThis.recoverPassword_onerror(client); };
|
||||
var requestHeaders = [];
|
||||
requestHeaders['SOAPAction'] = '';
|
||||
this.jsutils.trace('synchronous = ' + this.synchronous);
|
||||
this.client.request(this.url, xml, null, this.synchronous, requestHeaders);
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.recoverPassword = ws_safemode_pt__recoverPassword_op;
|
||||
|
||||
function ws_safemode_pt__recoverPassword_serializeInput(cxfjsutils, args) {
|
||||
var wrapperObj = new ws_safemode_pt__recoverPassword();
|
||||
wrapperObj.setUsername(args[0]);
|
||||
wrapperObj.setToken(args[1]);
|
||||
wrapperObj.setPassword(args[2]);
|
||||
wrapperObj.setPasswordRepeat(args[3]);
|
||||
var xml;
|
||||
xml = cxfjsutils.beginSoap11Message("xmlns:jns0='http://ws.safemode.pt/' ");
|
||||
// block for local variables
|
||||
{
|
||||
xml = xml + wrapperObj.serialize(cxfjsutils, 'jns0:recoverPassword', null);
|
||||
}
|
||||
xml = xml + cxfjsutils.endSoap11Message();
|
||||
return xml;
|
||||
}
|
||||
|
||||
ws_safemode_pt__UtilizadoresWS.prototype.recoverPassword_serializeInput = ws_safemode_pt__recoverPassword_serializeInput;
|
||||
|
||||
function ws_safemode_pt__recoverPasswordResponse_deserializeResponse(cxfjsutils, partElement) {
|
||||
var returnObject = ws_safemode_pt__recoverPasswordResponse_deserialize (cxfjsutils, partElement);
|
||||
|
||||
return returnObject;
|
||||
}
|
||||
function ws_safemode_pt__UtilizadoresWS_impl_ws_safemode_pt__UtilizadorWSImplPort () {
|
||||
this.url = '/safemode/safemode-ws/utilizador';
|
||||
}
|
||||
ws_safemode_pt__UtilizadoresWS_impl_ws_safemode_pt__UtilizadorWSImplPort.prototype = new ws_safemode_pt__UtilizadoresWS;
|
||||
@ -1,529 +0,0 @@
|
||||
$.noConflict();
|
||||
|
||||
var app = angular.module('categoriaApp', ['ui.bootstrap']);
|
||||
|
||||
app.controller('categoriaCtrl', ['$scope', '$modal', '$q', function($scope, $modal, $q) {
|
||||
|
||||
$scope.novaCategoria = new ws_safemode_pt__classificacaoBean();
|
||||
|
||||
$scope.novaCategoria._categoria = 'Nova';
|
||||
$scope.novaCategoria._categoriaId = undefined;
|
||||
$scope.novaCategoria._tema = undefined;
|
||||
$scope.novaCategoria._subtema = undefined;
|
||||
|
||||
$scope.categorias = {
|
||||
valoresSelected: [],
|
||||
selectedOption: $scope.novaCategoria,
|
||||
selectedOld: undefined,
|
||||
selected: undefined
|
||||
};
|
||||
|
||||
$scope.loadCategorias = function() {
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllCategorias(function(x, y) {
|
||||
$scope.categorias.valoresSelected.push( $scope.novaCategoria );
|
||||
jQuery.merge( $scope.categorias.valoresSelected, x.getReturn() );
|
||||
$scope.categorias.selectedOption = $scope.novaCategoria;
|
||||
$scope.$apply();
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
});
|
||||
};
|
||||
$scope.loadCategorias();
|
||||
|
||||
$scope.$watch("categorias.selectedOption", function(value) {
|
||||
$scope.temas.selected = '';
|
||||
$scope.subtemas.selected = '';
|
||||
$scope.temas.selectedOld = undefined;
|
||||
$scope.subtemas.selectedOld = undefined;
|
||||
$scope.temas.selectedOption = $scope.novoTema;
|
||||
$scope.subtemas.selectedOption = $scope.novoSubtema;
|
||||
$scope.categorias.selected = '';
|
||||
if(value === undefined )
|
||||
{
|
||||
$scope.temas.valoresSelected = [];
|
||||
$scope.subtemas.valoresSelected = [];
|
||||
return;
|
||||
}
|
||||
if(value === $scope.novaCategoria)
|
||||
{
|
||||
$scope.temas.valoresSelected = [];
|
||||
$scope.subtemas.valoresSelected = [];
|
||||
$scope.categorias.selectedOld = $scope.categorias.selectedOption;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.categorias.selected = $scope.categorias.selectedOption._categoria;
|
||||
$scope.categorias.selectedOld = $scope.categorias.selectedOption;
|
||||
$scope.temas.load($scope.categorias.selectedOld);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.novoTema = new ws_safemode_pt__classificacaoBean();
|
||||
|
||||
$scope.novoTema._categoria = undefined;
|
||||
$scope.novoTema._categoriaId = undefined;
|
||||
$scope.novoTema._tema = 'Novo';
|
||||
$scope.novoTema._temaId = undefined;
|
||||
|
||||
$scope.temas = {
|
||||
valoresSelected: [],
|
||||
selectedOption: $scope.novoTema,
|
||||
selectedOld: undefined,
|
||||
selected: undefined,
|
||||
load: function(categorias) {
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllTemas(function(x, y) {
|
||||
$scope.novoTema._categoria = categorias._categoria;
|
||||
$scope.novoTema._categoriaId = categorias._categoriaId;
|
||||
$scope.novoTema._novaCategoria = categorias._novaCategoria;
|
||||
$scope.temas.valoresSelected = [];
|
||||
$scope.temas.valoresSelected.push( $scope.novoTema );
|
||||
jQuery.merge( $scope.temas.valoresSelected, x.getReturn() );
|
||||
$scope.temas.selectedOption = $scope.novoTema;
|
||||
$scope.$apply();
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, categorias);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch("temas.selectedOption", function(value) {
|
||||
if( $scope.categorias.selectedOld !== undefined )
|
||||
{
|
||||
$scope.categorias.selected = $scope.categorias.selectedOld._categoria;
|
||||
}
|
||||
$scope.subtemas.selected = '';
|
||||
$scope.subtemas.selectedOld = undefined;
|
||||
$scope.subtemas.selectedOption = $scope.novoSubtema;
|
||||
if(value === undefined )
|
||||
{
|
||||
$scope.subtemas.valoresSelected = [];
|
||||
$scope.temas.selected = '';
|
||||
return;
|
||||
}
|
||||
if (value === $scope.novoTema )
|
||||
{
|
||||
$scope.subtemas.valoresSelected = [];
|
||||
$scope.temas.selected = '';
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.temas.selected = '';
|
||||
$scope.temas.selected = $scope.temas.selectedOption._tema;
|
||||
$scope.temas.selectedOld = $scope.temas.selectedOption;
|
||||
$scope.subtemas.load($scope.temas.selectedOld);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.novoSubtema = new ws_safemode_pt__classificacaoBean();
|
||||
|
||||
$scope.novoSubtema._categoria = undefined;
|
||||
$scope.novoSubtema._categoriaId = undefined;
|
||||
$scope.novoSubtema._tema = undefined;
|
||||
$scope.novoSubtema._temaId = undefined;
|
||||
$scope.novoSubtema._subtema = 'Novo';
|
||||
$scope.novoSubtema._subtemaId = undefined;
|
||||
|
||||
$scope.subtemas = {
|
||||
valoresSelected: [],
|
||||
selectedOption: $scope.novoSubtema,
|
||||
selected: undefined,
|
||||
selectedOld: undefined,
|
||||
load: function(tema) {
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllSubtemas(function(x, y) {
|
||||
$scope.novoSubtema._categoria = tema._categoria;
|
||||
$scope.novoSubtema._categoriaId = tema._categoriaId;
|
||||
$scope.novoSubtema._novaCategoria = tema._novaCategoria;
|
||||
|
||||
$scope.novoSubtema._tema = tema._tema;
|
||||
$scope.novoSubtema._temaId = tema._temaId;
|
||||
$scope.novoSubtema._novoTema = tema._novoTema;
|
||||
|
||||
$scope.subtemas.valoresSelected = [];
|
||||
$scope.subtemas.valoresSelected.push( $scope.novoSubtema );
|
||||
jQuery.merge( $scope.subtemas.valoresSelected, x.getReturn() );
|
||||
$scope.subtemas.selectedOption = $scope.novoSubtema;
|
||||
$scope.$apply();
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, tema);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch("subtemas.selectedOption", function(value) {
|
||||
if( $scope.temas.selectedOld !== undefined )
|
||||
{
|
||||
$scope.temas.selected = $scope.temas.selectedOld._tema;
|
||||
}
|
||||
if( $scope.categorias.selectedOld !== undefined )
|
||||
{
|
||||
$scope.categorias.selected = $scope.categorias.selectedOld._categoria;
|
||||
}
|
||||
if(value === undefined )
|
||||
{
|
||||
$scope.subtemas.selected = '';
|
||||
return;
|
||||
}
|
||||
if (value === $scope.novoSubtema)
|
||||
{
|
||||
$scope.subtemas.selected = '';
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.subtemas.selected = '';
|
||||
$scope.subtemas.selected = $scope.subtemas.selectedOption._subtema;
|
||||
$scope.subtemas.selectedOld = $scope.subtemas.selectedOption;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch("categorias.selected", function(value)
|
||||
{
|
||||
if( $scope.categorias.selectedOption !== undefined )
|
||||
{
|
||||
if( $scope.categorias.selectedOption === $scope.novaCategoria )
|
||||
{
|
||||
$scope.temas.selectedOption = $scope.novoTema;
|
||||
$scope.subtemas.selectedOption = $scope.novoSubtema;
|
||||
$scope.temas.selected = '';
|
||||
$scope.subtemas.selected = '';
|
||||
$scope.temas.selectedOld = undefined;
|
||||
$scope.subtemas.selectedOld = undefined;
|
||||
$scope.categorias.selectedOld = new ws_safemode_pt__classificacaoBean();
|
||||
|
||||
$scope.categorias.selectedOld._novaCategoria = $scope.categorias.selected;
|
||||
$scope.categorias.selectedOld._categoriaId = undefined;
|
||||
}
|
||||
else if( ( $scope.categorias.selected === '' ) || ( $scope.categorias.selected === undefined ) )
|
||||
{
|
||||
$scope.categorias.selected = $scope.categorias.selectedOption._categoria;
|
||||
$scope.categorias.selectedOld = new ws_safemode_pt__classificacaoBean();
|
||||
$scope.categorias.selectedOld._categoria = $scope.categorias.selectedOption._categoria;
|
||||
$scope.categorias.selectedOld._categoriaId = $scope.categorias.selectedOption._categoriaId;
|
||||
|
||||
$scope.temas.selectedOld._categoria = $scope.categorias.selectedOption._categoria;
|
||||
$scope.temas.selectedOld._categoriaId = $scope.categorias.selectedOption._categoriaId;
|
||||
|
||||
$scope.subtemas.selectedOld._categoria = $scope.categorias.selectedOption._categoria;
|
||||
$scope.subtemas.selectedOld._categoriaId = $scope.categorias.selectedOption._categoriaId;
|
||||
}
|
||||
else if( $scope.categorias.selectedOption._categoria !== $scope.categorias.selected )
|
||||
{
|
||||
$scope.categorias.selectedOld = new ws_safemode_pt__classificacaoBean();
|
||||
$scope.categorias.selectedOld._categoria = $scope.categorias.selectedOption._categoria;
|
||||
$scope.categorias.selectedOld._categoriaId = $scope.categorias.selectedOption._categoriaId;
|
||||
$scope.categorias.selectedOld._novaCategoria = $scope.categorias.selected;
|
||||
|
||||
$scope.temas.selectedOld._categoria = $scope.categorias.selectedOption._categoria;
|
||||
$scope.temas.selectedOld._categoriaId = $scope.categorias.selectedOption._categoriaId;
|
||||
$scope.temas.selectedOld._novaCategoria = $scope.categorias.selected;
|
||||
|
||||
$scope.subtemas.selectedOld._categoria = $scope.categorias.selectedOption._categoria;
|
||||
$scope.subtemas.selectedOld._categoriaId = $scope.categorias.selectedOption._categoriaId;
|
||||
$scope.subtemas.selectedOld._novaCategoria = $scope.categorias.selected;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch("temas.selected", function(value)
|
||||
{
|
||||
if( $scope.temas.selectedOption !== undefined )
|
||||
{
|
||||
if( $scope.temas.selectedOption === $scope.novoTema )
|
||||
{
|
||||
$scope.subtemas.selected = '';
|
||||
$scope.subtemas.selectedOld = undefined;
|
||||
$scope.subtemas.selectedOption = $scope.novoSubtema;
|
||||
$scope.temas.selectedOld = new ws_safemode_pt__classificacaoBean();
|
||||
$scope.temas.selectedOld._categoria = $scope.categorias.selectedOld._categoria;
|
||||
$scope.temas.selectedOld._categoriaId = $scope.categorias.selectedOld._categoriaId;
|
||||
$scope.temas.selectedOld._novaCategoria = $scope.categorias.selectedOld._novaCategoria;
|
||||
|
||||
$scope.temas.selectedOld._novoTema = $scope.temas.selected;
|
||||
$scope.temas.selectedOld._temaId = undefined;
|
||||
}
|
||||
else if( ( $scope.temas.selected === '' ) || ( $scope.temas.selected === undefined ) )
|
||||
{
|
||||
$scope.temas.selected = $scope.temas.selectedOption._tema;
|
||||
|
||||
$scope.temas.selectedOld = new ws_safemode_pt__classificacaoBean();
|
||||
$scope.temas.selectedOld._categoria = $scope.categorias.selectedOld._categoria;
|
||||
$scope.temas.selectedOld._categoriaId = $scope.categorias.selectedOld._categoriaId;
|
||||
$scope.temas.selectedOld._novaCategoria = $scope.categorias.selectedOld._novaCategoria;
|
||||
|
||||
$scope.temas.selectedOld._tema = $scope.temas.selectedOption._tema;
|
||||
$scope.temas.selectedOld._temaId = $scope.temas.selectedOption._temaId;
|
||||
|
||||
$scope.subtemas.selectedOld._tema = $scope.temas.selectedOption._tema;
|
||||
$scope.subtemas.selectedOld._temaId = $scope.temas.selectedOption._temaId;
|
||||
|
||||
}
|
||||
else if( $scope.temas.selectedOption._tema !== $scope.temas.selected )
|
||||
{
|
||||
$scope.temas.selectedOld = new ws_safemode_pt__classificacaoBean();
|
||||
$scope.temas.selectedOld._categoria = $scope.categorias.selectedOld._categoria;
|
||||
$scope.temas.selectedOld._categoriaId = $scope.categorias.selectedOld._categoriaId;
|
||||
$scope.temas.selectedOld._novaCategoria = $scope.categorias.selectedOld._novaCategoria;
|
||||
$scope.temas.selectedOld._tema = $scope.temas.selectedOption._tema;
|
||||
$scope.temas.selectedOld._temaId = $scope.temas.selectedOption._temaId;
|
||||
$scope.temas.selectedOld._novoTema = $scope.temas.selected;
|
||||
|
||||
$scope.subtemas.selectedOld._tema = $scope.temas.selectedOption._tema;
|
||||
$scope.subtemas.selectedOld._temaId = $scope.temas.selectedOption._temaId;
|
||||
$scope.subtemas.selectedOld._novoTema = $scope.temas.selected;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch("subtemas.selected", function(value)
|
||||
{
|
||||
if( $scope.subtemas.selectedOption !== undefined )
|
||||
{
|
||||
if( $scope.subtemas.selectedOption === $scope.novoSubtema )
|
||||
{
|
||||
$scope.subtemas.selectedOld = new ws_safemode_pt__classificacaoBean();
|
||||
|
||||
$scope.subtemas.selectedOld._categoria = $scope.categorias.selectedOld._categoria;
|
||||
$scope.subtemas.selectedOld._categoriaId = $scope.categorias.selectedOld._categoriaId;
|
||||
$scope.subtemas.selectedOld._novaCategoria = $scope.categorias.selectedOld._novaCategoria;
|
||||
|
||||
$scope.subtemas.selectedOld._tema = $scope.temas.selectedOld._tema;
|
||||
$scope.subtemas.selectedOld._temaId = $scope.temas.selectedOld._temaId;
|
||||
$scope.subtemas.selectedOld._novoTema = $scope.temas.selectedOld._novoTema;
|
||||
|
||||
$scope.subtemas.selectedOld._novaSubtema = $scope.subtemas.selected;
|
||||
$scope.subtemas.selectedOld._subtemaId = undefined;
|
||||
}
|
||||
else if( ( $scope.subtemas.selected === '' ) || ( $scope.subtemas.selected === undefined ) )
|
||||
{
|
||||
$scope.subtemas.selectedOld = new ws_safemode_pt__classificacaoBean();
|
||||
|
||||
$scope.subtemas.selectedOld._categoria = $scope.categorias.selectedOld._categoria;
|
||||
$scope.subtemas.selectedOld._categoriaId = $scope.categorias.selectedOld._categoriaId;
|
||||
$scope.subtemas.selectedOld._novaCategoria = $scope.categorias.selectedOld._novaCategoria;
|
||||
|
||||
$scope.subtemas.selectedOld._tema = $scope.temas.selectedOld._tema;
|
||||
$scope.subtemas.selectedOld._temaId = $scope.temas.selectedOld._temaId;
|
||||
$scope.subtemas.selectedOld._novoTema = $scope.temas.selectedOld._novoTema;
|
||||
|
||||
$scope.subtemas.selectedOld._subtema = $scope.subtemas.selectedOption._subtema;
|
||||
$scope.subtemas.selectedOld._subtemaId = $scope.subtemas.selectedOption._subtemaId;
|
||||
|
||||
}
|
||||
else if( $scope.subtemas.selectedOption._subtema !== $scope.subtemas.selected )
|
||||
{
|
||||
$scope.subtemas.selectedOld = new ws_safemode_pt__classificacaoBean();
|
||||
|
||||
$scope.subtemas.selectedOld._categoria = $scope.categorias.selectedOld._categoria;
|
||||
$scope.subtemas.selectedOld._categoriaId = $scope.categorias.selectedOld._categoriaId;
|
||||
$scope.subtemas.selectedOld._novaCategoria = $scope.categorias.selectedOld._novaCategoria;
|
||||
|
||||
$scope.subtemas.selectedOld._tema = $scope.temas.selectedOld._tema;
|
||||
$scope.subtemas.selectedOld._temaId = $scope.temas.selectedOld._temaId;
|
||||
$scope.subtemas.selectedOld._novoTema = $scope.temas.selectedOld._novoTema;
|
||||
|
||||
$scope.subtemas.selectedOld._subtema = $scope.subtemas.selectedOption._subtema;
|
||||
$scope.subtemas.selectedOld._subtemaId = $scope.subtemas.selectedOption._subtemaId;
|
||||
|
||||
$scope.subtemas.selectedOld._subtema = $scope.subtemas.selectedOption._subtema;
|
||||
$scope.subtemas.selectedOld._subtemaId = $scope.subtemas.selectedOption._subtemaId;
|
||||
$scope.subtemas.selectedOld._novaSubtema = $scope.subtemas.selected;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$scope.send = function()
|
||||
{
|
||||
var result = window.confirm("Deseja aplicar as alteracões à categoria, tema ou subtema?");
|
||||
if( result === true )
|
||||
{
|
||||
if( $scope.categorias.selectedOld._novaCategoria !== undefined )
|
||||
{
|
||||
console.log($scope.categorias.selectedOld);
|
||||
|
||||
if( ( $scope.categorias.selectedOld._novaCategoria != undefined ) &&
|
||||
( $scope.categorias.selectedOld._categoriaId != undefined ) )
|
||||
{
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.gravarCategoriaTemaSubtema(function(x, y) {
|
||||
|
||||
if( x._return === false )
|
||||
{
|
||||
alert("Erro ao alterar a categoria. Por favor verifique os dados.");
|
||||
}
|
||||
else window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.categorias.selectedOld._categoriaId, $scope.categorias.selectedOld._novaCategoria,
|
||||
undefined, undefined,
|
||||
undefined, undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( $scope.categorias.selectedOld._novaCategoria != undefined ) &&
|
||||
( $scope.categorias.selectedOld._categoriaId == undefined ) )
|
||||
{
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.gravarCategoriaTemaSubtema(function(x, y) {
|
||||
|
||||
if( x._return === false )
|
||||
{
|
||||
alert("Erro ao alterar a categoria. Por favor verifique os dados.");
|
||||
}
|
||||
else window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, undefined, $scope.categorias.selectedOld._novaCategoria,
|
||||
undefined, undefined,
|
||||
undefined, undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
else if( $scope.temas.selectedOld._novoTema !== undefined )
|
||||
{
|
||||
console.log($scope.temas.selectedOld);
|
||||
|
||||
if( ( $scope.temas.selectedOld._novoTema != undefined ) &&
|
||||
( $scope.temas.selectedOld._temaId != undefined ) )
|
||||
{
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.gravarCategoriaTemaSubtema(function(x, y) {
|
||||
|
||||
if( x._return === false )
|
||||
{
|
||||
alert("Erro ao alterar o tema. Por favor verifique os dados.");
|
||||
}
|
||||
else window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.temas.selectedOld._categoriaId, undefined,
|
||||
$scope.temas.selectedOld._temaId, $scope.temas.selectedOld._novoTema,
|
||||
undefined, undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( $scope.temas.selectedOld._novoTema != undefined ) &&
|
||||
( $scope.temas.selectedOld._temaId == undefined ) )
|
||||
{
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.gravarCategoriaTemaSubtema(function(x, y) {
|
||||
|
||||
if( x._return === false )
|
||||
{
|
||||
alert("Erro ao alterar o tema. Por favor verifique os dados.");
|
||||
}
|
||||
else window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.temas.selectedOld._categoriaId, undefined,
|
||||
undefined, $scope.temas.selectedOld._novoTema,
|
||||
undefined, undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
else if( $scope.subtemas.selectedOld._novaSubtema !== undefined )
|
||||
{
|
||||
console.log($scope.subtemas.selectedOld);
|
||||
|
||||
if( ( $scope.subtemas.selectedOld._novaSubtema != undefined ) &&
|
||||
( $scope.subtemas.selectedOld._subtemaId != undefined ) )
|
||||
{
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.gravarCategoriaTemaSubtema(function(x, y) {
|
||||
|
||||
if( x._return === false )
|
||||
{
|
||||
alert("Erro ao alterar o subtema. Por favor verifique os dados.");
|
||||
}
|
||||
else window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.subtemas.selectedOld._categoriaId, undefined,
|
||||
$scope.subtemas.selectedOld._temaId, undefined,
|
||||
$scope.subtemas.selectedOld._subtemaId, $scope.subtemas.selectedOld._novaSubtema);
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( $scope.subtemas.selectedOld._novaSubtema != undefined ) &&
|
||||
( $scope.subtemas.selectedOld._subtemaId == undefined ) )
|
||||
{
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.gravarCategoriaTemaSubtema(function(x, y) {
|
||||
|
||||
if( x._return === false )
|
||||
{
|
||||
alert("Erro ao alterar o subtema. Por favor verifique os dados.");
|
||||
}
|
||||
else window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createCategoria.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.subtemas.selectedOld._categoriaId, undefined,
|
||||
$scope.subtemas.selectedOld._temaId, undefined,
|
||||
undefined, $scope.subtemas.selectedOld._novaSubtema);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}]);
|
||||
@ -1,140 +0,0 @@
|
||||
$.noConflict();
|
||||
|
||||
var app = angular.module('entidadesReguladorasApp', ['ui.bootstrap']);
|
||||
|
||||
app.controller('entidadesReguladorasCtrl', ['$scope', '$modal', '$q', function($scope, $modal, $q) {
|
||||
|
||||
$scope.novaEntidadeReguladora = new ws_safemode_pt__legEntidadeReguladoraBean();
|
||||
|
||||
$scope.novaEntidadeReguladora._id = null;
|
||||
$scope.novaEntidadeReguladora._designacao = "Nova";
|
||||
|
||||
$scope.entidadesReguladoras = {
|
||||
valoresSelected: [],
|
||||
selectedOption: $scope.novaEntidadeReguladora,
|
||||
selected: undefined,
|
||||
selectedOld: undefined
|
||||
};
|
||||
|
||||
$scope.loadEntidadesReguladoras = function() {
|
||||
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllEntidadesReguladoras(function(x, y) {
|
||||
|
||||
$scope.entidadesReguladoras.valoresSelected.push( $scope.novaEntidadeReguladora );
|
||||
jQuery.merge( $scope.entidadesReguladoras.valoresSelected, x.getReturn() );
|
||||
$scope.entidadesReguladoras.selectedOption = $scope.novaEntidadeReguladora;
|
||||
$scope.$apply();
|
||||
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createEntidadeReguladora.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
});
|
||||
};
|
||||
$scope.loadEntidadesReguladoras();
|
||||
|
||||
$scope.$watch("entidadesReguladoras.selectedOption", function(value) {
|
||||
if(value === undefined )
|
||||
{
|
||||
$scope.entidadesReguladoras.selected = '';
|
||||
return;
|
||||
}
|
||||
if (value === $scope.novaEntidadeReguladora)
|
||||
{
|
||||
$scope.entidadesReguladoras.selected = '';
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.entidadesReguladoras.selected = '';
|
||||
$scope.entidadesReguladoras.selected = $scope.entidadesReguladoras.selectedOption._designacao;
|
||||
$scope.entidadesReguladoras.selectedOld = $scope.entidadesReguladoras.selectedOption;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch("entidadesReguladoras.selected", function(value)
|
||||
{
|
||||
if( $scope.entidadesReguladoras.selectedOption !== undefined )
|
||||
{
|
||||
if( $scope.entidadesReguladoras.selectedOption === $scope.novaEntidadeReguladora )
|
||||
{
|
||||
$scope.entidadesReguladoras.selectedOld = new ws_safemode_pt__legEntidadeReguladoraBean();
|
||||
|
||||
$scope.entidadesReguladoras.selectedOld._designacao = $scope.entidadesReguladoras.selected;
|
||||
$scope.entidadesReguladoras.selectedOld._id = null;
|
||||
}
|
||||
else if( ( $scope.entidadesReguladoras.selected === '' ) || ( $scope.entidadesReguladoras.selected === undefined ) )
|
||||
{
|
||||
$scope.entidadesReguladoras.selectedOld = new ws_safemode_pt__legEntidadeReguladoraBean();
|
||||
|
||||
$scope.entidadesReguladoras.selectedOld._designacao = $scope.entidadesReguladoras.selectedOption._designacao;
|
||||
$scope.entidadesReguladoras.selectedOld._id = $scope.entidadesReguladoras.selectedOption._id;
|
||||
|
||||
}
|
||||
else if( $scope.entidadesReguladoras.selectedOption._designacao !== $scope.entidadesReguladoras.selected )
|
||||
{
|
||||
$scope.entidadesReguladoras.selectedOld = new ws_safemode_pt__legEntidadeReguladoraBean();
|
||||
|
||||
$scope.entidadesReguladoras.selectedOld._id = $scope.entidadesReguladoras.selectedOption._id;
|
||||
$scope.entidadesReguladoras.selectedOld._designacao = $scope.entidadesReguladoras.selected;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$scope.send = function()
|
||||
{
|
||||
var result = window.confirm("Deseja aplicar as alteracões à entidade reguladora?");
|
||||
if( result === true )
|
||||
{
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.createEntidadeReguladora(function(x, y) {
|
||||
|
||||
if( x._return === false )
|
||||
{
|
||||
alert("Erro ao alterar a entidade reguladora. Por favor verifique os dados.");
|
||||
}
|
||||
else window.location = "/safemode/pages/legislacao/createEntidadeReguladora.do";
|
||||
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createEntidadeReguladora.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.entidadesReguladoras.selectedOld);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
$scope.apagar = function() {
|
||||
var result = window.confirm("Deseja remover a entidade reguladora seleccionada?");
|
||||
if( result === true )
|
||||
{
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.removeEntidadeReguladora(function(x, y)
|
||||
{
|
||||
if( x._return === false )
|
||||
{
|
||||
alert("Erro ao remover a entidade reguladora. Por favor verifique se ela não é utilizada em nenhum diploma.");
|
||||
}
|
||||
else window.location = "/safemode/pages/legislacao/createEntidadeReguladora.do";
|
||||
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createEntidadeReguladora.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, $scope.entidadesReguladoras.selectedOld);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}]);
|
||||
|
||||
@ -1,131 +0,0 @@
|
||||
$( window ).load( function( )
|
||||
{
|
||||
$( "#dashboard-form" ).validate(
|
||||
{
|
||||
rules :
|
||||
{
|
||||
fullname :
|
||||
{
|
||||
required : true
|
||||
},
|
||||
password :
|
||||
{
|
||||
required : true,
|
||||
minlength : 5,
|
||||
alphanumeric : true,
|
||||
nowhitespace : true
|
||||
},
|
||||
email :
|
||||
{
|
||||
required : true,
|
||||
email : true
|
||||
}
|
||||
},
|
||||
submitHandler : function( form )
|
||||
{
|
||||
form.submit( );
|
||||
},
|
||||
focusCleanup : true,
|
||||
messages :
|
||||
{
|
||||
fullname :
|
||||
{
|
||||
required : "Por favor introduza o seu nome completo."
|
||||
},
|
||||
password :
|
||||
{
|
||||
required : "Por favor introduza a sua nova palavra passe de utilizador.",
|
||||
minlength : "Por favor introduza uma palavra passe com no mínimo cinco caracteres.",
|
||||
alphanumeric : "Por favor introduza uma palavra passe utilizando apenas números ou letras.",
|
||||
nowhitespace : "Por favor introduza uma palavra passe sem espaços."
|
||||
},
|
||||
email :
|
||||
{
|
||||
email : "Por favor introduza um email válido."
|
||||
}
|
||||
},
|
||||
highlight : function( element )
|
||||
{
|
||||
$( element ).closest( '.form-group' ).addClass( 'has-error' );
|
||||
},
|
||||
unhighlight : function( element )
|
||||
{
|
||||
$( element ).closest( '.form-group' ).removeClass( 'has-error' );
|
||||
},
|
||||
errorElement : 'span',
|
||||
errorClass : 'help-block',
|
||||
errorPlacement : function( error, element )
|
||||
{
|
||||
if( element.parent( '.input-group' ).length )
|
||||
{
|
||||
error.insertAfter( element.parent( ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
error.insertAfter( element );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
$( "#telephone-group" ).click( function( )
|
||||
{
|
||||
$( "#info-phone" ).attr( "title", "Insira o novo número de telefone de contacto do utilizador." );
|
||||
$( "#telephone" ).removeAttr( "readonly" );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",telephone" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
$( "#email-group" ).click( function( )
|
||||
{
|
||||
$( "#info-email" ).attr( "title", "Insira o novo email do utilizador." );
|
||||
$( "#email" ).removeAttr( "readonly" );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",email" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
$( "#fullname-group" ).click( function( )
|
||||
{
|
||||
$( "#info-fullname" ).attr( "title", "Insira o novo nome completo do utilizador." );
|
||||
$( "#fullname" ).removeAttr( "readonly" );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",fullname" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
$( "#password-group" ).click( function( )
|
||||
{
|
||||
$( "#info-password" ).attr( "title",
|
||||
"Insira a nova palavra passe do utilizador, com no mínimo cinco caracteres e utilizando apenas números ou letras sem espaços." );
|
||||
$( "#password" ).removeAttr( "readonly" );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",password" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
$( "#telephone" ).change(function( )
|
||||
{
|
||||
if( ( $( "#telephone" ).attr( "readonly" ) === undefined )
|
||||
&& ( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
} );
|
||||
$( "#email" ).change( function( )
|
||||
{
|
||||
if( ( $( "#email" ).attr( "readonly" ) === undefined ) &&
|
||||
( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
} );
|
||||
$( "#fullname" ).change(function( )
|
||||
{
|
||||
if( ( $( "#fullname" ).attr( "readonly" ) === undefined ) &&
|
||||
( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
} );
|
||||
$( "#password" ).change(function( )
|
||||
{
|
||||
if( ( $( "#password" ).attr( "readonly" ) === undefined ) &&
|
||||
( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
@ -1 +0,0 @@
|
||||
$(window).load(function(){$("#dashboard-form").validate({rules:{fullname:{required:true},password:{required:true,minlength:5,alphanumeric:true,nowhitespace:true},email:{required:true,email:true}},submitHandler:function(a){a.submit()},focusCleanup:true,messages:{fullname:{required:"Por favor introduza o seu nome completo."},password:{required:"Por favor introduza a sua nova palavra passe de utilizador.",minlength:"Por favor introduza uma palavra passe com no mínimo cinco caracteres.",alphanumeric:"Por favor introduza uma palavra passe utilizando apenas números ou letras.",nowhitespace:"Por favor introduza uma palavra passe sem espaços."},email:{email:"Por favor introduza um email válido."}},highlight:function(a){$(a).closest(".form-group").addClass("has-error")},unhighlight:function(a){$(a).closest(".form-group").removeClass("has-error")},errorElement:"span",errorClass:"help-block",errorPlacement:function(a,b){if(b.parent(".input-group").length){a.insertAfter(b.parent())}else{a.insertAfter(b)}}});$("#telephone-group").click(function(){if($("#telephone").attr("readonly")!==undefined){$("#info-phone").attr("title","Insira o novo número de telefone de contacto do utilizador.");$("#telephone").removeAttr("readonly");var a=$("#hiddenfield").attr("value").concat(",telephone");$("#hiddenfield").attr("value",a)}});$("#email-group").click(function(){if($("#email").attr("readonly")!==undefined){$("#info-email").attr("title","Insira o novo email do utilizador.");$("#email").removeAttr("readonly");var a=$("#hiddenfield").attr("value").concat(",email");$("#hiddenfield").attr("value",a)}});$("#fullname-group").click(function(){if($("#fullname").attr("readonly")!==undefined){$("#info-fullname").attr("title","Insira o novo nome completo do utilizador.");$("#fullname").removeAttr("readonly");var a=$("#hiddenfield").attr("value").concat(",fullname");$("#hiddenfield").attr("value",a)}});$("#password-group").click(function(){if($("#password").attr("readonly")!==undefined){$("#info-password").attr("title","Insira a nova palavra passe do utilizador, com no mínimo cinco caracteres e utilizando apenas números ou letras sem espaços.");$("#password").removeAttr("readonly");var a=$("#hiddenfield").attr("value").concat(",password");$("#hiddenfield").attr("value",a)}});$("#telephone").change(function(){if(($("#telephone").attr("readonly")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}});$("#email").change(function(){if(($("#email").attr("readonly")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}});$("#fullname").change(function(){if(($("#fullname").attr("readonly")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}});$("#password").change(function(){if(($("#password").attr("readonly")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}})});
|
||||
@ -1,577 +0,0 @@
|
||||
$.noConflict();
|
||||
|
||||
var app = angular.module('ngCreateDiploma', ['ui.bootstrap']);
|
||||
|
||||
app.controller('CreateDiplomaCtrl', ['$scope', '$modal', '$q', function($scope, $modal, $q) {
|
||||
|
||||
$scope.bean = new ws_safemode_pt__legislacaoBean();
|
||||
|
||||
$scope.fileData = {
|
||||
fileName: 'Nenhum ficheiro seleccionado',
|
||||
selectedFile: null,
|
||||
fileSelected: false,
|
||||
fileTooltip: 'Adicionar ficheiro'
|
||||
};
|
||||
|
||||
jQuery("#btn").click(function()
|
||||
{
|
||||
if($scope.fileData.fileSelected === false)
|
||||
{
|
||||
jQuery("#pdf").click();
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.fileData.selectedFile = null;
|
||||
}
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
$scope.$watch("fileData.selectedFile", function(value)
|
||||
{
|
||||
if( value !== null )
|
||||
{
|
||||
$scope.fileData.fileSelected = true;
|
||||
$scope.fileData.fileName = value.replace(/.*(\/|\\)/, '');
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.fileData.fileSelected = false;
|
||||
$scope.fileData.fileName = 'Nenhum ficheiro seleccionado';
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch("fileData.fileSelected", function(value)
|
||||
{
|
||||
if(value === false)
|
||||
{
|
||||
$scope.fileData.fileTooltip = 'Adicionar ficheiro';
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.fileData.fileTooltip = 'Remover ficheiro';
|
||||
}
|
||||
});
|
||||
|
||||
$scope.tipo = function()
|
||||
{
|
||||
if( $scope.tipos === undefined )
|
||||
{
|
||||
var tipos = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
tipos.getTipos(function(result)
|
||||
{
|
||||
$scope.tipos = result._return;
|
||||
$scope.$apply();
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createLegislacao.do";
|
||||
}
|
||||
else $scope.tipos = [];
|
||||
});
|
||||
}
|
||||
};
|
||||
$scope.tipo();
|
||||
|
||||
$scope.estado = function()
|
||||
{
|
||||
if( $scope.estados === undefined )
|
||||
{
|
||||
var estados = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
estados.getEstados(function(result)
|
||||
{
|
||||
$scope.estados = result._return;
|
||||
var position = jQuery.inArray("Em vigor", $scope.estados);
|
||||
if( position !== -1 )
|
||||
{
|
||||
$scope.bean._estado = $scope.estados[position];
|
||||
}
|
||||
$scope.$apply();
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createLegislacao.do";
|
||||
}
|
||||
else $scope.estados = [];
|
||||
});
|
||||
}
|
||||
};
|
||||
$scope.estado();
|
||||
|
||||
$scope.entidadeReguladora = function()
|
||||
{
|
||||
if( $scope.entidadesReguladoras === undefined )
|
||||
{
|
||||
var diplomas = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
diplomas.getEntidadesReguladoras(function(result)
|
||||
{
|
||||
$scope.entidadesReguladoras = result._return;
|
||||
$scope.$apply();
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createLegislacao.do";
|
||||
}
|
||||
else deferred.resolve([]);
|
||||
});
|
||||
}
|
||||
};
|
||||
$scope.entidadeReguladora( );
|
||||
|
||||
$scope.getPalavrasChave = function(filter)
|
||||
{
|
||||
var deferred = $q.defer();
|
||||
|
||||
var palavrasChave = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
palavrasChave.getPalavrasChave(function(result)
|
||||
{
|
||||
deferred.resolve(result._return);
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createLegislacao.do";
|
||||
}
|
||||
else deferred.resolve([]);
|
||||
}, filter);
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
$scope.tags = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getPalavrasChave( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
$scope.bean._palavrasChave.push( this.selected );
|
||||
this.selected = null;
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._palavrasChave);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._palavrasChave.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.loadCategorias = function() {
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllCategorias(function(x, y) {
|
||||
$scope.categorias.listaCategorias = [];
|
||||
jQuery.merge( $scope.categorias.listaCategorias, x.getReturn() );
|
||||
$scope.$apply();
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createLegislacao.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
});
|
||||
};
|
||||
|
||||
$scope.categorias = {
|
||||
|
||||
listaCategorias: [],
|
||||
listaTemas: [],
|
||||
listaSubtemas: [],
|
||||
categoria: null,
|
||||
tema: null,
|
||||
subtema: null,
|
||||
add: function() {
|
||||
if( ( $scope.categorias.subtema !== null ) && ( $scope.categorias.subtema !== undefined ) && ( $scope.categorias.subtema !== "" ) )
|
||||
{
|
||||
$scope.bean._subtemas.push($scope.categorias.subtema);
|
||||
}
|
||||
else if( ( $scope.categorias.tema !== null ) && ( $scope.categorias.tema !== undefined ) && ( $scope.categorias.tema !== "" ) )
|
||||
{
|
||||
$scope.bean._subtemas.push($scope.categorias.tema);
|
||||
}
|
||||
$scope.categorias.subtema = null;
|
||||
$scope.categorias.tema = null;
|
||||
$scope.categorias.categoria = null;
|
||||
$scope.categorias.listaTemas = [];
|
||||
$scope.categorias.listaSubtemas = [];
|
||||
},
|
||||
remove: function(item) {
|
||||
var position = jQuery.inArray(item, $scope.bean._subtemas);
|
||||
|
||||
if (position !== -1) {
|
||||
$scope.bean._subtemas.splice(position, 1);
|
||||
}
|
||||
},
|
||||
loadTemas: function(item) {
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllTemas(function(x, y) {
|
||||
$scope.categorias.listaTemas = [];
|
||||
jQuery.merge( $scope.categorias.listaTemas, x.getReturn() );
|
||||
$scope.$apply();
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createLegislacao.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, item);
|
||||
},
|
||||
loadSubtemas: function(item) {
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllSubtemas(function(x, y) {
|
||||
$scope.categorias.listaSubtemas = [];
|
||||
jQuery.merge( $scope.categorias.listaSubtemas, x.getReturn() );
|
||||
$scope.$apply();
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createLegislacao.do";
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, item);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.loadCategorias();
|
||||
|
||||
$scope.$watch("categorias.categoria", function(value) {
|
||||
console.log(value);
|
||||
if ( (value !== undefined) && (value !== null) ) {
|
||||
$scope.categorias.loadTemas(value);
|
||||
} else {
|
||||
$scope.categorias.listaTemas = [];
|
||||
$scope.categorias.tema = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch("categorias.tema", function(value) {
|
||||
if ( (value !== undefined) && (value !== null) ) {
|
||||
$scope.categorias.loadSubtemas(value);
|
||||
} else {
|
||||
$scope.categorias.listaSubtemas = [];
|
||||
$scope.categorias.subtema = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.getDiplomas = function(filter)
|
||||
{
|
||||
var deferred = $q.defer();
|
||||
|
||||
var diplomas = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
diplomas.getDiplomas(function(result)
|
||||
{
|
||||
deferred.resolve(result._return);
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createLegislacao.do";
|
||||
}
|
||||
else deferred.resolve([]);
|
||||
}, filter);
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
$scope.related = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getDiplomas( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
$scope.bean._diplomasRelacionados.push( this.selected );
|
||||
this.selected = null;
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._diplomasRelacionados);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._diplomasRelacionados.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.entidades = {
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
$scope.bean._entidadesReguladoras.push( this.selected );
|
||||
this.selected = null;
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._entidadesReguladoras);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._entidadesReguladoras.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.revogados = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getDiplomas( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'revogados.html',
|
||||
controller: 'ModalRevogadosCtrl'
|
||||
});
|
||||
|
||||
modalInstance.result.then(function (selectedItem) {
|
||||
var resultado = new ws_safemode_pt__alteracaoBean();
|
||||
resultado._id = $scope.revogados.selected._id;
|
||||
resultado._designacao = $scope.revogados.selected._designacao;
|
||||
resultado._detalhes = selectedItem;
|
||||
$scope.bean._diplomasRevogados.push( resultado );
|
||||
$scope.revogados.selected = null;
|
||||
}, function () {
|
||||
console.log('');
|
||||
});
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._diplomasRevogados);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._diplomasRevogados.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.republicados = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getDiplomas( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'republicados.html',
|
||||
controller: 'ModalRepublicadosCtrl'
|
||||
});
|
||||
|
||||
modalInstance.result.then(function (selectedItem) {
|
||||
var resultado = new ws_safemode_pt__alteracaoBean();
|
||||
resultado._id = $scope.republicados.selected._id;
|
||||
resultado._designacao = $scope.republicados.selected._designacao;
|
||||
resultado._detalhes = selectedItem;
|
||||
$scope.bean._diplomasRepublicados.push( resultado );
|
||||
$scope.republicados.selected = null;
|
||||
}, function () {
|
||||
console.log('');
|
||||
});
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._diplomasRepublicados);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._diplomasRepublicados.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
$scope.alterados = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getDiplomas( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'alterados.html',
|
||||
controller: 'ModalAlteradosCtrl'
|
||||
});
|
||||
|
||||
modalInstance.result.then(function (selectedItem) {
|
||||
var resultado = new ws_safemode_pt__alteracaoBean();
|
||||
resultado._id = $scope.alterados.selected._id;
|
||||
resultado._designacao = $scope.alterados.selected._designacao;
|
||||
resultado._detalhes = selectedItem;
|
||||
$scope.bean._diplomasAlterados.push( resultado );
|
||||
$scope.alterados.selected = null;
|
||||
}, function () {
|
||||
console.log('');
|
||||
});
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._diplomasAlterados);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._diplomasAlterados.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.data = {
|
||||
numero: null,
|
||||
publicacao: null,
|
||||
publicacao_string: null,
|
||||
file: null,
|
||||
estado: null,
|
||||
tipo: null,
|
||||
observacoes: null,
|
||||
disposicoesTransitorias: null,
|
||||
palavrasChave: null
|
||||
};
|
||||
|
||||
$scope.submit = function( )
|
||||
{
|
||||
jQuery("body").css("cursor", "wait");
|
||||
var diplomas = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
diplomas.addDiploma(function(result)
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
alert("Diploma adicionado com successo.\nA enviar ficheiro pdf...");
|
||||
//Send the pdf file...
|
||||
jQuery( "#createLeg" ).submit();
|
||||
|
||||
}, function(x, y)
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/createLegislacao.do";
|
||||
}
|
||||
else alert("Erro ao criar o diploma, por favor verifique se os dados estão bem preenchidos");
|
||||
}, $scope.bean);
|
||||
};
|
||||
|
||||
$scope.tipo = null;
|
||||
|
||||
$scope.add = function()
|
||||
{
|
||||
$scope.tag.tags.append($scope.tag.selected);
|
||||
};
|
||||
|
||||
jQuery('#dataPublicacaoControl').datepicker({
|
||||
weekStart: 1,
|
||||
viewMode: 0
|
||||
}).on('changeDate', function(ev)
|
||||
{
|
||||
$scope.$apply(function()
|
||||
{
|
||||
console.log($scope.bean);
|
||||
$scope.data.publicacao = ev.date;
|
||||
var day = ev.date.getDate().toString();
|
||||
if (day.length == 1)
|
||||
{
|
||||
day = "0" + day;
|
||||
}
|
||||
var month = ev.date.getMonth() + 1 + "";
|
||||
if (month.length == 1)
|
||||
{
|
||||
month = "0" + month;
|
||||
}
|
||||
var year = ev.date.getFullYear().toString();
|
||||
$scope.bean._data_publicacao = day + "/" + month + "/" + year;
|
||||
});
|
||||
});
|
||||
|
||||
}]);
|
||||
|
||||
app.controller('ModalRevogadosCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance)
|
||||
{
|
||||
|
||||
$scope.selected = {
|
||||
item: ''
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$modalInstance.close($scope.selected.item);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
}]);
|
||||
|
||||
app.controller('ModalRepublicadosCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance)
|
||||
{
|
||||
|
||||
$scope.selected = {
|
||||
item: ''
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$modalInstance.close($scope.selected.item);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
}]);
|
||||
|
||||
app.controller('ModalAlteradosCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance)
|
||||
{
|
||||
|
||||
$scope.selected = {
|
||||
item: ''
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$modalInstance.close($scope.selected.item);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
}]);
|
||||
@ -1,679 +0,0 @@
|
||||
$.noConflict();
|
||||
|
||||
(function($) {
|
||||
$.QueryString = (function(a) {
|
||||
if (a == "") return {};
|
||||
var b = {};
|
||||
for (var i = 0; i < a.length; ++i)
|
||||
{
|
||||
var p=a[i].split('=');
|
||||
if (p.length != 2) continue;
|
||||
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
|
||||
}
|
||||
return b;
|
||||
})(window.location.search.substr(1).split('&'));
|
||||
})(jQuery);
|
||||
|
||||
var app = angular.module('ngEditDiploma', ['ui.bootstrap']);
|
||||
|
||||
app.controller('EditDiplomaCtrl', ['$scope', '$modal', '$q', '$location', function($scope, $modal, $q, $location) {
|
||||
|
||||
//$scope.bean = null;
|
||||
|
||||
$scope.fileData = {
|
||||
fileName: 'Nenhum ficheiro seleccionado',
|
||||
selectedFile: null,
|
||||
alterado: false,
|
||||
fileSelected: false,
|
||||
fileTooltip: 'Editar ficheiro'
|
||||
};
|
||||
|
||||
jQuery("#btn").click(function()
|
||||
{
|
||||
if($scope.fileData.fileSelected === false)
|
||||
{
|
||||
jQuery("#pdf").click();
|
||||
$scope.fileData.alterado = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.fileData.selectedFile = null;
|
||||
$scope.fileData.alterado = true;
|
||||
}
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
$scope.$watch("fileData.selectedFile", function(value)
|
||||
{
|
||||
if( value !== null )
|
||||
{
|
||||
$scope.fileData.fileSelected = true;
|
||||
$scope.fileData.fileName = value.replace(/.*(\/|\\)/, '');
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.fileData.fileSelected = false;
|
||||
$scope.fileData.fileName = 'Nenhum ficheiro seleccionado';
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch("fileData.fileSelected", function(value)
|
||||
{
|
||||
if(value === false)
|
||||
{
|
||||
$scope.fileData.fileTooltip = 'Editar ficheiro';
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.fileData.fileTooltip = 'Remover ficheiro';
|
||||
}
|
||||
});
|
||||
|
||||
$scope.location = jQuery.QueryString["id"];
|
||||
|
||||
$scope.loadCategorias = function() {
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllCategorias(function(x, y) {
|
||||
$scope.categorias.listaCategorias = [];
|
||||
jQuery.merge( $scope.categorias.listaCategorias, x.getReturn() );
|
||||
$scope.$apply();
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
});
|
||||
};
|
||||
|
||||
$scope.categorias = {
|
||||
|
||||
listaCategorias: [],
|
||||
listaTemas: [],
|
||||
listaSubtemas: [],
|
||||
categoria: null,
|
||||
tema: null,
|
||||
subtema: null,
|
||||
add: function() {
|
||||
if( ( $scope.categorias.subtema !== null ) && ( $scope.categorias.subtema !== undefined ) && ( $scope.categorias.subtema !== "" ) )
|
||||
{
|
||||
$scope.bean._subtemas.push($scope.categorias.subtema);
|
||||
}
|
||||
else if( ( $scope.categorias.tema !== null ) && ( $scope.categorias.tema !== undefined ) && ( $scope.categorias.tema !== "" ) )
|
||||
{
|
||||
$scope.bean._subtemas.push($scope.categorias.tema);
|
||||
}
|
||||
$scope.categorias.subtema = null;
|
||||
$scope.categorias.tema = null;
|
||||
$scope.categorias.categoria = null;
|
||||
$scope.categorias.listaTemas = [];
|
||||
$scope.categorias.listaSubtemas = [];
|
||||
},
|
||||
remove: function(item) {
|
||||
var position = jQuery.inArray(item, $scope.bean._subtemas);
|
||||
|
||||
if (position !== -1) {
|
||||
$scope.bean._subtemas.splice(position, 1);
|
||||
}
|
||||
},
|
||||
loadTemas: function(item) {
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllTemas(function(x, y) {
|
||||
$scope.categorias.listaTemas = [];
|
||||
jQuery.merge( $scope.categorias.listaTemas, x.getReturn() );
|
||||
$scope.$apply();
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, item);
|
||||
},
|
||||
loadSubtemas: function(item) {
|
||||
var wsClient = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort( );
|
||||
wsClient.getAllSubtemas(function(x, y) {
|
||||
$scope.categorias.listaSubtemas = [];
|
||||
jQuery.merge( $scope.categorias.listaSubtemas, x.getReturn() );
|
||||
$scope.$apply();
|
||||
}, function(x, y) {
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert( x + " " + y );
|
||||
}, item);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.loadCategorias();
|
||||
|
||||
$scope.$watch("categorias.categoria", function(value) {
|
||||
if ( (value !== undefined) && (value !== null) ) {
|
||||
$scope.categorias.loadTemas(value);
|
||||
} else {
|
||||
$scope.categorias.listaTemas = [];
|
||||
$scope.categorias.tema = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch("categorias.tema", function(value) {
|
||||
if ( (value !== undefined) && (value !== null) ) {
|
||||
$scope.categorias.loadSubtemas(value);
|
||||
} else {
|
||||
$scope.categorias.listaSubtemas = [];
|
||||
$scope.categorias.subtema = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.load = function()
|
||||
{
|
||||
if( $scope.bean === undefined )
|
||||
{
|
||||
var tipos = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
tipos.getDiplomaView(function(result)
|
||||
{
|
||||
$scope.$apply(function()
|
||||
{
|
||||
$scope.bean = new ws_safemode_pt__legislacaoBean();
|
||||
|
||||
var returnBean = result._return;
|
||||
|
||||
$scope.bean._cnpdDirectivasEuropeias = returnBean._cnpdDirectivasEuropeias;
|
||||
$scope.bean._data_publicacao = returnBean._data_publicacao;
|
||||
$scope.bean._diplomasAlterados = returnBean._diplomasAlterados;
|
||||
$scope.bean._diplomasRelacionados = returnBean._diplomasRelacionados;
|
||||
$scope.bean._diplomasRepublicados = returnBean._diplomasRepublicados;
|
||||
$scope.bean._diplomasRevogados = returnBean._diplomasRevogados;
|
||||
$scope.bean._disposicoesTransitorias = returnBean._disposicoesTransitorias;
|
||||
$scope.bean._entidadesReguladoras = returnBean._entidadesReguladoras;
|
||||
$scope.bean._estado = returnBean._estado;
|
||||
$scope.bean._numero = returnBean._numero;
|
||||
$scope.bean._observacoes = returnBean._observacoes;
|
||||
$scope.bean._palavrasChave = returnBean._palavrasChave;
|
||||
$scope.bean._subtemas = returnBean._subtemas;
|
||||
$scope.bean._sumario = returnBean._sumario;
|
||||
$scope.bean._tipo = returnBean._tipo;
|
||||
$scope.bean._id = returnBean._id;
|
||||
|
||||
if(returnBean._temFicheiro)
|
||||
{
|
||||
$scope.fileData.selectedFile = (returnBean._tipo + " " + returnBean._numero + " " + returnBean._data_publicacao.replace("\/","-").replace("\/","-") + ".pdf").split(' ').join('_');
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.fileData.selectedFile = null;
|
||||
}
|
||||
});
|
||||
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( x + " " + y );
|
||||
$scope.bean = new ws_safemode_pt__legislacaoBean();
|
||||
}
|
||||
}, jQuery.QueryString["id"]);
|
||||
}
|
||||
};
|
||||
$scope.load( );
|
||||
|
||||
$scope.tipo = function()
|
||||
{
|
||||
if( $scope.tipos === undefined )
|
||||
{
|
||||
var tipos = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
tipos.getTipos(function(result)
|
||||
{
|
||||
$scope.tipos = result._return;
|
||||
$scope.$apply();
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else $scope.tipos = [];
|
||||
});
|
||||
}
|
||||
};
|
||||
$scope.tipo();
|
||||
|
||||
$scope.estado = function()
|
||||
{
|
||||
if( $scope.estados === undefined )
|
||||
{
|
||||
var estados = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
estados.getEstados(function(result)
|
||||
{
|
||||
$scope.estados = result._return;
|
||||
$scope.$apply();
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else $scope.estados = [];
|
||||
});
|
||||
}
|
||||
};
|
||||
$scope.estado();
|
||||
|
||||
$scope.entidadeReguladora = function()
|
||||
{
|
||||
if( $scope.entidadesReguladoras === undefined )
|
||||
{
|
||||
var diplomas = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
diplomas.getEntidadesReguladoras(function(result)
|
||||
{
|
||||
$scope.entidadesReguladoras = result._return;
|
||||
$scope.$apply();
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else deferred.resolve([]);
|
||||
});
|
||||
}
|
||||
};
|
||||
$scope.entidadeReguladora( );
|
||||
|
||||
$scope.getPalavrasChave = function(filter)
|
||||
{
|
||||
var deferred = $q.defer();
|
||||
|
||||
var palavrasChave = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
palavrasChave.getPalavrasChave(filter, function(result)
|
||||
{
|
||||
deferred.resolve(result._return);
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else deferred.resolve([]);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
$scope.tags = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getPalavrasChave( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
$scope.bean._palavrasChave.push( this.selected );
|
||||
this.selected = null;
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._palavrasChave);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._palavrasChave.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.getDiplomas = function(filter)
|
||||
{
|
||||
var deferred = $q.defer();
|
||||
|
||||
var diplomas = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
diplomas.getDiplomas(function(result)
|
||||
{
|
||||
deferred.resolve(result._return);
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else deferred.resolve([]);
|
||||
}, filter);
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
$scope.related = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getDiplomas( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
$scope.bean._diplomasRelacionados.push( this.selected );
|
||||
this.selected = null;
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._diplomasRelacionados);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._diplomasRelacionados.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.entidades = {
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
$scope.bean._entidadesReguladoras.push( this.selected );
|
||||
this.selected = null;
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._entidadesReguladoras);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._entidadesReguladoras.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.revogados = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getDiplomas( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'revogados.html',
|
||||
controller: 'ModalRevogadosCtrl'
|
||||
});
|
||||
|
||||
modalInstance.result.then(function (selectedItem) {
|
||||
var resultado = new ws_safemode_pt__alteracaoBean();
|
||||
resultado._id = $scope.revogados.selected._id;
|
||||
resultado._designacao = $scope.revogados.selected._designacao;
|
||||
resultado._detalhes = selectedItem;
|
||||
$scope.bean._diplomasRevogados.push( resultado );
|
||||
$scope.revogados.selected = null;
|
||||
}, function () {
|
||||
console.log('');
|
||||
});
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._diplomasRevogados);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._diplomasRevogados.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.republicados = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getDiplomas( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'republicados.html',
|
||||
controller: 'ModalRepublicadosCtrl'
|
||||
});
|
||||
|
||||
modalInstance.result.then(function (selectedItem) {
|
||||
var resultado = new ws_safemode_pt__alteracaoBean();
|
||||
resultado._id = $scope.republicados.selected._id;
|
||||
resultado._designacao = $scope.republicados.selected._designacao;
|
||||
resultado._detalhes = selectedItem;
|
||||
$scope.bean._diplomasRepublicados.push( resultado );
|
||||
$scope.republicados.selected = null;
|
||||
}, function () {
|
||||
console.log('');
|
||||
});
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._diplomasRepublicados);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._diplomasRepublicados.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
$scope.alterados = {
|
||||
tags: function( filter )
|
||||
{
|
||||
return $scope.getDiplomas( filter ).then(function(res)
|
||||
{
|
||||
return res;
|
||||
});
|
||||
},
|
||||
selected: null,
|
||||
addTag: function( )
|
||||
{
|
||||
if(this.selected !== null)
|
||||
{
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'alterados.html',
|
||||
controller: 'ModalAlteradosCtrl'
|
||||
});
|
||||
|
||||
modalInstance.result.then(function (selectedItem) {
|
||||
var resultado = new ws_safemode_pt__alteracaoBean();
|
||||
resultado._id = $scope.alterados.selected._id;
|
||||
resultado._designacao = $scope.alterados.selected._designacao;
|
||||
resultado._detalhes = selectedItem;
|
||||
$scope.bean._diplomasAlterados.push( resultado );
|
||||
$scope.alterados.selected = null;
|
||||
}, function () {
|
||||
console.log('');
|
||||
});
|
||||
}
|
||||
},
|
||||
removeTag: function(tag)
|
||||
{
|
||||
var position = jQuery.inArray(tag, $scope.bean._diplomasAlterados);
|
||||
|
||||
if(position !== -1)
|
||||
{
|
||||
$scope.bean._diplomasAlterados.splice(position, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.data = {
|
||||
numero: null,
|
||||
publicacao: null,
|
||||
publicacao_string: null,
|
||||
file: null,
|
||||
estado: null,
|
||||
tipo: null,
|
||||
observacoes: null,
|
||||
disposicoesTransitorias: null,
|
||||
palavrasChave: null
|
||||
};
|
||||
|
||||
$scope.submit = function( )
|
||||
{
|
||||
jQuery("body").css("cursor", "wait");
|
||||
|
||||
var diplomas = new ws_safemode_pt__LegislacaoWS_impl_ws_safemode_pt__LegislacaoWSImplPort();
|
||||
diplomas.changeDiploma(function(result)
|
||||
{
|
||||
if( $scope.fileData.alterado )
|
||||
{
|
||||
if( $scope.fileData.fileSelected )
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
alert("Diploma alterado com successo.\nA enviar ficheiro pdf...");
|
||||
//Send the pdf file...
|
||||
jQuery( "#createLeg" ).submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
diplomas.removePdf( function(result)
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
alert("Diploma alterado com successo.");
|
||||
window.location = "/safemode/pages/legislacao/listagemDiploma.do?id=" + $scope.bean._id;
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
jQuery("body").css("cursor", "auto");
|
||||
}, $scope.bean._id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery("body").css("cursor", "auto");
|
||||
alert("Diploma alterado com successo.");
|
||||
window.location = "/safemode/pages/legislacao/listagemDiploma.do?id=" + $scope.bean._id;
|
||||
}
|
||||
}, function(x, y)
|
||||
{
|
||||
if( x === 340 )
|
||||
{
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
else alert("Erro ao editar o diploma, por favor verifique se os dados estão bem preenchidos");
|
||||
jQuery("body").css("cursor", "auto");
|
||||
}, $scope.bean);
|
||||
};
|
||||
|
||||
$scope.cancel = function( )
|
||||
{
|
||||
window.location = "/safemode/pages/legislacao/listagemDiploma.do?id=" + $scope.bean._id;
|
||||
};
|
||||
|
||||
$scope.tipo = null;
|
||||
|
||||
$scope.add = function()
|
||||
{
|
||||
$scope.tag.tags.append($scope.tag.selected);
|
||||
};
|
||||
|
||||
jQuery('#dataPublicacaoControl').datepicker({
|
||||
weekStart: 1,
|
||||
viewMode: 0
|
||||
}).on('changeDate', function(ev)
|
||||
{
|
||||
$scope.$apply(function()
|
||||
{
|
||||
console.log($scope.bean);
|
||||
$scope.data.publicacao = ev.date;
|
||||
var day = ev.date.getDate().toString();
|
||||
if (day.length == 1)
|
||||
{
|
||||
day = "0" + day;
|
||||
}
|
||||
var month = ev.date.getMonth() + 1 + "";
|
||||
if (month.length == 1)
|
||||
{
|
||||
month = "0" + month;
|
||||
}
|
||||
var year = ev.date.getFullYear().toString();
|
||||
$scope.bean._data_publicacao = day + "/" + month + "/" + year;
|
||||
});
|
||||
});
|
||||
|
||||
}]);
|
||||
|
||||
app.controller('ModalRevogadosCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance)
|
||||
{
|
||||
|
||||
$scope.selected = {
|
||||
item: ''
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$modalInstance.close($scope.selected.item);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
}]);
|
||||
|
||||
app.controller('ModalRepublicadosCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance)
|
||||
{
|
||||
|
||||
$scope.selected = {
|
||||
item: ''
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$modalInstance.close($scope.selected.item);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
}]);
|
||||
|
||||
app.controller('ModalAlteradosCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance)
|
||||
{
|
||||
|
||||
$scope.selected = {
|
||||
item: ''
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$modalInstance.close($scope.selected.item);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
}]);
|
||||
@ -1,167 +0,0 @@
|
||||
$( window ).load(function( )
|
||||
{
|
||||
$( "#dashboard-form" ).validate(
|
||||
{
|
||||
rules :
|
||||
{
|
||||
fullname :
|
||||
{
|
||||
required : true
|
||||
},
|
||||
password :
|
||||
{
|
||||
required : true,
|
||||
minlength : 5,
|
||||
alphanumeric : true,
|
||||
nowhitespace : true
|
||||
},
|
||||
email :
|
||||
{
|
||||
required : true,
|
||||
email : true
|
||||
}
|
||||
},
|
||||
submitHandler : function( form )
|
||||
{
|
||||
form.submit( );
|
||||
},
|
||||
focusCleanup : true,
|
||||
messages :
|
||||
{
|
||||
fullname :
|
||||
{
|
||||
required : "Por favor introduza o seu nome completo."
|
||||
},
|
||||
password :
|
||||
{
|
||||
required : "Por favor introduza a sua nova palavra passe de utilizador.",
|
||||
minlength : "Por favor introduza uma palavra passe com no mínimo cinco caracteres.",
|
||||
alphanumeric : "Por favor introduza uma palavra passe utilizando apenas números ou letras.",
|
||||
nowhitespace : "Por favor introduza uma palavra passe sem espaços."
|
||||
},
|
||||
email :
|
||||
{
|
||||
email : "Por favor introduza um email válido."
|
||||
}
|
||||
},
|
||||
highlight : function( element )
|
||||
{
|
||||
$( element ).closest( '.form-group' ).addClass( 'has-error' );
|
||||
},
|
||||
unhighlight : function( element )
|
||||
{
|
||||
$( element ).closest( '.form-group' ).removeClass( 'has-error' );
|
||||
},
|
||||
errorElement : 'span',
|
||||
errorClass : 'help-block',
|
||||
errorPlacement : function( error, element )
|
||||
{
|
||||
if( element.parent( '.input-group' ).length )
|
||||
{
|
||||
error.insertAfter( element.parent( ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
error.insertAfter( element );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
$( "#telephone-group" ).click( function( )
|
||||
{
|
||||
$( "#info-phone" ).attr( "title", "Insira o novo número de telefone de contacto do utilizador." );
|
||||
$( "#telephone" ).removeAttr( "readonly" );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",telephone" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
$( "#email-group" ).click( function( )
|
||||
{
|
||||
$( "#info-email" ).attr( "title", "Insira o novo email do utilizador." );
|
||||
$( "#email" ).removeAttr( "readonly" );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",email" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
$( "#fullname-group" ).click( function( )
|
||||
{
|
||||
$( "#info-fullname" ).attr( "title", "Insira o novo nome completo do utilizador." );
|
||||
$( "#fullname" ).removeAttr( "readonly" );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",fullname" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
$( "#password-group" ).click(function( )
|
||||
{
|
||||
$( "#info-password" ).attr("title",
|
||||
"Insira a nova palavra passe do utilizador, com no mínimo cinco caracteres e utilizando apenas números ou letras sem espaços." );
|
||||
$( "#password" ).removeAttr( "readonly" );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",password" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
$( "#telephone" ).change(function( )
|
||||
{
|
||||
if( ( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
} );
|
||||
$( "#email" ).change(function( )
|
||||
{
|
||||
if( ( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
} );
|
||||
$( "#fullname" ).change(function( )
|
||||
{
|
||||
if( ( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
} );
|
||||
$( "#password" ).change(function( )
|
||||
{
|
||||
if( ( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
} );
|
||||
$( "#admin" ).change(function( )
|
||||
{
|
||||
if( ( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
if( $( "#admin" )[ 0 ].checked )
|
||||
{
|
||||
$( "#editor" ).removeAttr( "disabled" );
|
||||
$( "#editor" )[ 0 ].checked = true;
|
||||
}
|
||||
} );
|
||||
$( "#admin-group" ).click( function( )
|
||||
{
|
||||
$( "#admin" ).removeAttr( "disabled" );
|
||||
$( "#info-admin" ).attr( "title", "Preencha o campo se o utilizador deve de ser administrador." );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",admin" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
|
||||
$( "#editor" ).change(function( )
|
||||
{
|
||||
if( ( $( "#submit-button" ).attr( "disabled" ) !== undefined ) )
|
||||
{
|
||||
$( "#submit-button" ).removeAttr( "disabled" );
|
||||
}
|
||||
if( !$( "#editor" )[ 0 ].checked )
|
||||
{
|
||||
$( "#admin" ).removeAttr( "disabled" );
|
||||
$( "#admin" )[ 0 ].checked = false;
|
||||
}
|
||||
} );
|
||||
$( "#editor-group" ).click(function( )
|
||||
{
|
||||
$( "#editor" ).removeAttr( "disabled" );
|
||||
$( "#info-editor" ).attr( "title",
|
||||
"Preencha o campo se o utilizador pode editar a legislação." );
|
||||
var value = $( "#hiddenfield" ).attr( "value" ).concat( ",editor" );
|
||||
$( "#hiddenfield" ).attr( "value", value );
|
||||
} );
|
||||
} );
|
||||
@ -1 +0,0 @@
|
||||
$(window).load(function(){$("#dashboard-form").validate({rules:{fullname:{required:true},password:{required:true,minlength:5,alphanumeric:true,nowhitespace:true},email:{required:true,email:true}},submitHandler:function(a){a.submit()},focusCleanup:true,messages:{fullname:{required:"Por favor introduza o seu nome completo."},password:{required:"Por favor introduza a sua nova palavra passe de utilizador.",minlength:"Por favor introduza uma palavra passe com no mínimo cinco caracteres.",alphanumeric:"Por favor introduza uma palavra passe utilizando apenas números ou letras.",nowhitespace:"Por favor introduza uma palavra passe sem espaços."},email:{email:"Por favor introduza um email válido."}},highlight:function(a){$(a).closest(".form-group").addClass("has-error")},unhighlight:function(a){$(a).closest(".form-group").removeClass("has-error")},errorElement:"span",errorClass:"help-block",errorPlacement:function(a,b){if(b.parent(".input-group").length){a.insertAfter(b.parent())}else{a.insertAfter(b)}}});$("#telephone-group").click(function(){if($("#telephone").attr("readonly")!==undefined){$("#info-phone").attr("title","Insira o novo número de telefone de contacto do utilizador.");$("#telephone").removeAttr("readonly");var a=$("#hiddenfield").attr("value").concat(",telephone");$("#hiddenfield").attr("value",a)}});$("#email-group").click(function(){if($("#email").attr("readonly")!==undefined){$("#info-email").attr("title","Insira o novo email do utilizador.");$("#email").removeAttr("readonly");var a=$("#hiddenfield").attr("value").concat(",email");$("#hiddenfield").attr("value",a)}});$("#fullname-group").click(function(){if($("#fullname").attr("readonly")!==undefined){$("#info-fullname").attr("title","Insira o novo nome completo do utilizador.");$("#fullname").removeAttr("readonly");var a=$("#hiddenfield").attr("value").concat(",fullname");$("#hiddenfield").attr("value",a)}});$("#password-group").click(function(){if($("#password").attr("readonly")!==undefined){$("#info-password").attr("title","Insira a nova palavra passe do utilizador, com no mínimo cinco caracteres e utilizando apenas números ou letras sem espaços.");$("#password").removeAttr("readonly");var a=$("#hiddenfield").attr("value").concat(",password");$("#hiddenfield").attr("value",a)}});$("#telephone").change(function(){if(($("#telephone").attr("readonly")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}});$("#email").change(function(){if(($("#email").attr("readonly")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}});$("#fullname").change(function(){if(($("#fullname").attr("readonly")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}});$("#password").change(function(){if(($("#password").attr("readonly")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}});$("#admin").change(function(){if(($("#admin").attr("disabled")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}if($("#admin")[0].checked){$("#editor").removeAttr("disabled");$("#editor")[0].checked=true}});$("#admin-group").click(function(){if($("#admin").attr("disabled")!==undefined){$("#admin").removeAttr("disabled");$("#info-admin").attr("title","Preencha o campo se o utilizador deve de ser administrador.");var a=$("#hiddenfield").attr("value").concat(",admin");$("#hiddenfield").attr("value",a)}});$("#editor").change(function(){if(($("#editor").attr("disabled")===undefined)&&($("#submit-button").attr("disabled")!==undefined)){$("#submit-button").removeAttr("disabled")}if(!$("#editor")[0].checked){$("#admin").removeAttr("disabled");$("#admin")[0].checked=false}});$("#editor-group").click(function(){if($("#editor").attr("disabled")!==undefined){$("#editor").removeAttr("disabled");$("#info-editor").attr("title","Preencha o campo se o utilizador pode editar a legislação.");var a=$("#hiddenfield").attr("value").concat(",editor");$("#hiddenfield").attr("value",a)}})});
|
||||
@ -1,12 +0,0 @@
|
||||
$( window ).load(function( )
|
||||
{
|
||||
$("#table").children().each(function(index, element)
|
||||
{
|
||||
var last = $(this).children().last();
|
||||
var row = $(this);
|
||||
$(last).click(function()
|
||||
{
|
||||
row.remove();
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -1,68 +0,0 @@
|
||||
$('#info').tooltip();
|
||||
|
||||
$(window).load(function(){
|
||||
$("#login-form").validate(
|
||||
{
|
||||
rules :
|
||||
{
|
||||
username :
|
||||
{
|
||||
required : true,
|
||||
remote : "/safemode/pages/auth/ajax/login-validate-username.do"
|
||||
},
|
||||
password :
|
||||
{
|
||||
required : true
|
||||
}
|
||||
},
|
||||
onfocusout: false,
|
||||
onkeyup: false,
|
||||
onclick: false,
|
||||
focusCleanup: false,
|
||||
submitHandler : function(form)
|
||||
{
|
||||
form.submit();
|
||||
},
|
||||
messages :
|
||||
{
|
||||
username :
|
||||
{
|
||||
required : "Por favor introduza o seu nome de utilizador",
|
||||
remote: "O utilizador indicado não existe."
|
||||
},
|
||||
password :
|
||||
{
|
||||
required : "Por favor introduza a sua password de utilizador",
|
||||
remote: "A palavra-passe ou utilizador indicado é inválido."
|
||||
}
|
||||
},
|
||||
highlight : function(element)
|
||||
{
|
||||
$(element).closest('.form-group').addClass('small-error');
|
||||
},
|
||||
unhighlight : function(element)
|
||||
{
|
||||
$(element).closest('.form-group').removeClass('small-error');
|
||||
},
|
||||
errorElement : 'span',
|
||||
errorClass : 'help-block',
|
||||
errorPlacement : function(error, element)
|
||||
{
|
||||
if (element.parent('.input-group').length)
|
||||
{
|
||||
error.insertAfter(element.parent());
|
||||
}
|
||||
else
|
||||
{
|
||||
error.insertAfter(element);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#username").change(function()
|
||||
{
|
||||
var base = $("#recover").attr("href");
|
||||
$("#recover").attr("href", base + "?username=" + $("#username")[0].value);
|
||||
});
|
||||
|
||||
});
|
||||
@ -1 +0,0 @@
|
||||
$("#info").tooltip();$(window).load(function(){$("#login-form").validate({rules:{username:{required:true,remote:"/safemode/pages/auth/ajax/login-validate-username.do"},password:{required:true,remote:{url:"/safemode/pages/auth/ajax/login-validate-password.do",data:{username:function(){return $("#username").val()}}}}},onfocusout:false,onkeyup:false,onclick:false,focusCleanup:false,submitHandler:function(a){a.submit()},messages:{username:{required:"Por favor introduza o seu nome de utilizador",remote:"O utilizador indicado não existe."},password:{required:"Por favor introduza a sua password de utilizador",remote:"A palavra-passe ou utilizador indicado é inválido."}},highlight:function(a){$(a).closest(".form-group").addClass("small-error")},unhighlight:function(a){$(a).closest(".form-group").removeClass("small-error")},errorElement:"span",errorClass:"help-block",errorPlacement:function(a,b){if(b.parent(".input-group").length){a.insertAfter(b.parent())}else{a.insertAfter(b)}}});$("#username").change(function(){var a=$("#recover").attr("href");$("#recover").attr("href",a+"?username="+$("#username")[0].value)})});
|
||||
@ -1,96 +0,0 @@
|
||||
$( window ).load( function( )
|
||||
{
|
||||
$( "#register-form" ).validate(
|
||||
{
|
||||
rules :
|
||||
{
|
||||
fullname :
|
||||
{
|
||||
required: true
|
||||
},
|
||||
username :
|
||||
{
|
||||
required : true,
|
||||
minlength: 5,
|
||||
remote : "/safemode/pages/users/ajax/validate-register-username.do"
|
||||
},
|
||||
password :
|
||||
{
|
||||
required : true,
|
||||
minlength: 7,
|
||||
alphanumeric: true,
|
||||
nowhitespace: true
|
||||
},
|
||||
email :
|
||||
{
|
||||
required: true,
|
||||
email: true
|
||||
}
|
||||
},
|
||||
submitHandler : function( form )
|
||||
{
|
||||
form.submit();
|
||||
},
|
||||
focusCleanup: false,
|
||||
messages :
|
||||
{
|
||||
fullname :
|
||||
{
|
||||
required: "Por favor introduza o seu nome completo."
|
||||
},
|
||||
username :
|
||||
{
|
||||
required : "Por favor introduza o seu novo nome de utilizador.",
|
||||
minlength: "Por favor introduza um nome de utilizador com no mínimo 5 caracteres.",
|
||||
remote : "O nome de utilizador já existe."
|
||||
},
|
||||
password :
|
||||
{
|
||||
required : "Por favor introduza a sua nova palavra passe de utilizador.",
|
||||
minlength: "Por favor introduza uma palavra passe com no mínimo cinco caracteres.",
|
||||
alphanumeric: "Por favor introduza uma palavra passe utilizando apenas números ou letras.",
|
||||
nowhitespace: "Por favor introduza uma palavra passe sem espaços."
|
||||
},
|
||||
email :
|
||||
{
|
||||
email: "Por favor introduza um email válido.",
|
||||
remote : "O email indicado já está registado."
|
||||
}
|
||||
},
|
||||
highlight : function( element )
|
||||
{
|
||||
$( element ).closest( '.form-group' ).addClass( 'has-error' );
|
||||
},
|
||||
unhighlight : function( element )
|
||||
{
|
||||
$( element ).closest( '.form-group' ).removeClass( 'has-error' );
|
||||
},
|
||||
errorElement : 'span',
|
||||
errorClass : 'help-block',
|
||||
errorPlacement : function( error, element )
|
||||
{
|
||||
if( element.parent( '.input-group' ).length )
|
||||
{
|
||||
error.insertAfter( element.parent( ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
error.insertAfter( element );
|
||||
}
|
||||
}
|
||||
} );
|
||||
$( "#admin" ).change(function( )
|
||||
{
|
||||
if( $( "#admin" )[ 0 ].checked )
|
||||
{
|
||||
$( "#editor" )[ 0 ].checked = true;
|
||||
}
|
||||
} );
|
||||
$( "#editor" ).change(function( )
|
||||
{
|
||||
if( !$( "#editor" )[ 0 ].checked )
|
||||
{
|
||||
$( "#admin" )[ 0 ].checked = false;
|
||||
}
|
||||
} );
|
||||
} );
|
||||
@ -1 +0,0 @@
|
||||
$(window).load(function(){$("#register-form").validate({rules:{fullname:{required:true},username:{required:true,minlength:5,remote:"/safemode/pages/users/ajax/validate-register-username.do"},password:{required:true,minlength:7,alphanumeric:true,nowhitespace:true},email:{required:true,email:true}},submitHandler:function(a){a.submit()},focusCleanup:false,messages:{fullname:{required:"Por favor introduza o seu nome completo."},username:{required:"Por favor introduza o seu novo nome de utilizador.",minlength:"Por favor introduza um nome de utilizador com no mínimo 5 caracteres.",remote:"O nome de utilizador já existe."},password:{required:"Por favor introduza a sua nova palavra passe de utilizador.",minlength:"Por favor introduza uma palavra passe com no mínimo cinco caracteres.",alphanumeric:"Por favor introduza uma palavra passe utilizando apenas números ou letras.",nowhitespace:"Por favor introduza uma palavra passe sem espaços."},email:{email:"Por favor introduza um email válido.",remote:"O email indicado já está registado."}},highlight:function(a){$(a).closest(".form-group").addClass("has-error")},unhighlight:function(a){$(a).closest(".form-group").removeClass("has-error")},errorElement:"span",errorClass:"help-block",errorPlacement:function(a,b){if(b.parent(".input-group").length){a.insertAfter(b.parent())}else{a.insertAfter(b)}}});$("#admin").change(function(){if($("#admin")[0].checked){$("#editor")[0].checked=true}});$("#editor").change(function(){if(!$("#editor")[0].checked){$("#admin")[0].checked=false}})});
|
||||
@ -1,62 +0,0 @@
|
||||
$( window ).load( function( )
|
||||
{
|
||||
|
||||
var inicio = jQuery('#data_pub_inicio').datepicker({
|
||||
weekStart: 1,
|
||||
viewMode: 0
|
||||
});
|
||||
inicio.on('changeDate', function(ev)
|
||||
{
|
||||
console.log(ev.date);
|
||||
|
||||
//...
|
||||
|
||||
var day = ev.date.getDate().toString();
|
||||
if (day.length == 1)
|
||||
{
|
||||
day = "0" + day;
|
||||
}
|
||||
var month = ev.date.getMonth() + 1 + "";
|
||||
if (month.length == 1)
|
||||
{
|
||||
month = "0" + month;
|
||||
}
|
||||
var year = ev.date.getFullYear().toString();
|
||||
var data = day + "/" + month + "/" + year;
|
||||
|
||||
jQuery("#data_pub_inicio").val(data);
|
||||
inicio.datepicker('hide');
|
||||
|
||||
// ev.date == Javascript date object
|
||||
});
|
||||
|
||||
var fim = jQuery('#data_pub_fim').datepicker({
|
||||
weekStart: 1,
|
||||
viewMode: 0
|
||||
});
|
||||
fim.on('changeDate', function(ev)
|
||||
{
|
||||
console.log(ev.date);
|
||||
|
||||
//...
|
||||
|
||||
var day = ev.date.getDate().toString();
|
||||
if (day.length == 1)
|
||||
{
|
||||
day = "0" + day;
|
||||
}
|
||||
var month = ev.date.getMonth() + 1 + "";
|
||||
if (month.length == 1)
|
||||
{
|
||||
month = "0" + month;
|
||||
}
|
||||
var year = ev.date.getFullYear().toString();
|
||||
var data = day + "/" + month + "/" + year;
|
||||
|
||||
jQuery("#data_pub_fim").val(data);
|
||||
fim.datepicker('hide');
|
||||
|
||||
// ev.date == Javascript date object
|
||||
});
|
||||
|
||||
});
|
||||
@ -1,68 +0,0 @@
|
||||
/**
|
||||
* angular-ui-utils - Swiss-Army-Knife of AngularJS tools (with no external dependencies!)
|
||||
* @version v0.1.0 - 2013-12-30
|
||||
* @link http://angular-ui.github.com
|
||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
// READ: http://docs-next.angularjs.org/guide/ie
|
||||
// element tags are statically defined in order to accommodate lazy-loading whereby directives are also unknown
|
||||
|
||||
// The ieshiv takes care of our ui.directives and AngularJS's ng-view, ng-include, ng-pluralize, ng-switch.
|
||||
// However, IF you have custom directives that can be used as html tags (yours or someone else's) then
|
||||
// add list of directives into <code>window.myCustomTags</code>
|
||||
|
||||
// <!--[if lte IE 8]>
|
||||
// <script>
|
||||
// window.myCustomTags = [ 'yourCustomDirective', 'somebodyElsesDirective' ]; // optional
|
||||
// </script>
|
||||
// <script src="build/angular-ui-ieshiv.js"></script>
|
||||
// <![endif]-->
|
||||
|
||||
(function (window, document) {
|
||||
"use strict";
|
||||
|
||||
var tags = [ "ngInclude", "ngPluralize", "ngView", "ngSwitch", "uiCurrency", "uiCodemirror", "uiDate", "uiEvent",
|
||||
"uiKeypress", "uiKeyup", "uiKeydown", "uiMask", "uiMapInfoWindow", "uiMapMarker", "uiMapPolyline",
|
||||
"uiMapPolygon", "uiMapRectangle", "uiMapCircle", "uiMapGroundOverlay", "uiModal", "uiReset",
|
||||
"uiScrollfix", "uiSelect2", "uiShow", "uiHide", "uiToggle", "uiSortable", "uiTinymce"
|
||||
];
|
||||
|
||||
window.myCustomTags = window.myCustomTags || []; // externally defined by developer using angular-ui directives
|
||||
tags.push.apply(tags, window.myCustomTags);
|
||||
|
||||
var toCustomElements = function (str) {
|
||||
var result = [];
|
||||
var dashed = str.replace(/([A-Z])/g, function ($1) {
|
||||
return " " + $1.toLowerCase();
|
||||
});
|
||||
var tokens = dashed.split(" ");
|
||||
|
||||
// If a token is just a single name (i.e. no namespace) then we juse define the elements the name given
|
||||
if (tokens.length === 1) {
|
||||
var name = tokens[0];
|
||||
|
||||
result.push(name);
|
||||
result.push("x-" + name);
|
||||
result.push("data-" + name);
|
||||
} else {
|
||||
var ns = tokens[0];
|
||||
var dirname = tokens.slice(1).join("-");
|
||||
|
||||
// this is finite list and it seemed senseless to create a custom method
|
||||
result.push(ns + ":" + dirname);
|
||||
result.push(ns + "-" + dirname);
|
||||
result.push("x-" + ns + "-" + dirname);
|
||||
result.push("data-" + ns + "-" + dirname);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
for (var i = 0, tlen = tags.length; i < tlen; i++) {
|
||||
var customElements = toCustomElements(tags[i]);
|
||||
for (var j = 0, clen = customElements.length; j < clen; j++) {
|
||||
var customElement = customElements[j];
|
||||
document.createElement(customElement);
|
||||
}
|
||||
}
|
||||
|
||||
})(window, document);
|
||||
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 8.0 KiB |
@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css"></style>
|
||||
<script src="http://localhost:8080/siprp_fichasclinicas/json?js&var=rr"></script>
|
||||
<style type="text/css"></style>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
@ -1,5 +0,0 @@
|
||||
package shst.medicina.fichasclinicas.beans;
|
||||
|
||||
public class FichaEMCurativaEnfBean {
|
||||
|
||||
}
|
||||
@ -1,5 +0,0 @@
|
||||
package shst.medicina.fichasclinicas.beans;
|
||||
|
||||
public class FichaEOcasionalBean {
|
||||
|
||||
}
|
||||
@ -1,5 +0,0 @@
|
||||
package shst.medicina.fichasclinicas.beans;
|
||||
|
||||
public class FichaEPeriodicoBean {
|
||||
|
||||
}
|
||||
@ -1,6 +1,169 @@
|
||||
package shst.medicina.fichasclinicas.logic;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
|
||||
import pt.evolute.data.ProviderSpringBean;
|
||||
import shst.medicina.fichasclinicas.beans.EvoMessageBean;
|
||||
import shst.medicina.fichasclinicas.beans.EvoMessageTypeBean;
|
||||
import shst.medicina.fichasclinicas.beans.EvoResponseBean;
|
||||
import shst.medicina.fichasclinicas.beans.fichasclinicas.FcTipoFichaBeanData;
|
||||
import shst.medicina.fichasclinicas.data.fichasclinicas.FcTipoFichaData;
|
||||
|
||||
import com.evolute.module.utilizadores.data.EvoUsrPermissionData;
|
||||
import com.evolute.module.utilizadores.data.EvoUsrRoleData;
|
||||
import com.evolute.module.utilizadores.data.EvoUsrRolesPermissionsData;
|
||||
import com.evolute.module.utilizadores.data.EvoUsrUserData;
|
||||
import com.evolute.module.utilizadores.data.EvoUsrUsersRolesData;
|
||||
import com.evolute.module.utilizadores.users.provider.UsersDataProvider;
|
||||
import com.evolute.utils.arrays.Virtual2DArray;
|
||||
import com.evolute.utils.error.ErrorLogger;
|
||||
import com.evolute.utils.sql.Expression;
|
||||
import com.evolute.utils.sql.Field;
|
||||
import com.evolute.utils.sql.Select2;
|
||||
|
||||
public class LoginLogic
|
||||
{
|
||||
//public boolean doLogin(String username, String password, )
|
||||
@Autowired(required = true)
|
||||
@Qualifier("defaultProvider")
|
||||
ProviderSpringBean fichasProvidersBean;
|
||||
|
||||
public EvoResponseBean doLogin(HttpServletRequest req, String login, String pass) {
|
||||
|
||||
|
||||
EvoResponseBean rsp = new EvoResponseBean();
|
||||
EvoMessageBean mb = new EvoMessageBean();
|
||||
rsp.addMessage(mb);
|
||||
|
||||
EvoUsrUserData user = null;
|
||||
|
||||
try
|
||||
{
|
||||
user = UsersDataProvider.getProvider().loadUserByUsernamePasswordActive(login, pass, null);
|
||||
if(user != null )
|
||||
{
|
||||
user.setLast_login(new Timestamp(System.currentTimeMillis()));
|
||||
user.save();
|
||||
req.getSession().setAttribute("user", user);
|
||||
|
||||
Authentication ssa = authenticate(login,pass);
|
||||
SecurityContextHolder.getContext().setAuthentication(ssa);
|
||||
|
||||
|
||||
|
||||
|
||||
List<FcTipoFichaData> tfl = fichasProvidersBean.getENTITY_PROVIDER().listLoad(FcTipoFichaData.class, new Field(FcTipoFichaData.DELETED_STAMP).isEqual(null), new String[]{FcTipoFichaData.DESCRICAO}, null);
|
||||
List<FcTipoFichaBeanData> tflBean = new LinkedList<FcTipoFichaBeanData>();
|
||||
for(FcTipoFichaData i : tfl)
|
||||
{
|
||||
FcTipoFichaBeanData ib = new FcTipoFichaBeanData();
|
||||
ib.setMapData(i.getPropertiesValues(new String[]{FcTipoFichaData.ID,FcTipoFichaData.DESCRICAO}));
|
||||
tflBean.add(ib);
|
||||
}
|
||||
|
||||
|
||||
Map<String,Object> loginData = new HashMap<String, Object>();
|
||||
loginData.put("username", user.getName());
|
||||
loginData.put("tipoFichas", tflBean);
|
||||
|
||||
|
||||
rsp.setData(loginData);
|
||||
rsp.setSuccess(true);
|
||||
mb.setType(EvoMessageTypeBean.INFO);
|
||||
mb.setMessageData("login com sucesso");
|
||||
}
|
||||
else
|
||||
{
|
||||
rsp.setData(false);
|
||||
rsp.setSuccess(false);
|
||||
mb.setType(EvoMessageTypeBean.SECURITYEXCEPTION);
|
||||
mb.setMessageData("utilizador e/ou password inválidos");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
rsp.setData(false);
|
||||
rsp.setSuccess(false);
|
||||
mb.setType(EvoMessageTypeBean.ERROR);
|
||||
mb.setMessageData("Erro no processo de validação do login!");
|
||||
|
||||
ErrorLogger.logException(ex, Level.SEVERE);
|
||||
}
|
||||
|
||||
return rsp;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Authentication authenticate(String login, String password)
|
||||
{
|
||||
String[] tables = new String[]{
|
||||
EvoUsrUserData.TABLENAME,
|
||||
EvoUsrUsersRolesData.TABLENAME,
|
||||
EvoUsrRoleData.TABLENAME,
|
||||
EvoUsrRolesPermissionsData.TABLENAME,
|
||||
EvoUsrPermissionData.TABLENAME
|
||||
};
|
||||
|
||||
Integer[] joins = new Integer[]{Select2.JOIN_INNER,
|
||||
Select2.JOIN_INNER,
|
||||
Select2.JOIN_INNER,
|
||||
Select2.JOIN_INNER
|
||||
};
|
||||
|
||||
Expression[] joinsExpressions = new Expression[]{
|
||||
new Field(EvoUsrUsersRolesData.USER_ID_FULL).isEqual(new Field(EvoUsrUserData.ID_FULL)),
|
||||
new Field(EvoUsrRoleData.ID_FULL).isEqual(new Field(EvoUsrUsersRolesData.ROLE_ID_FULL)).and(new Field(EvoUsrRoleData.DELETED_STAMP_FULL).isEqual(null)),
|
||||
new Field(EvoUsrRolesPermissionsData.ROLE_ID_FULL).isEqual(new Field(EvoUsrRoleData.ID_FULL)),
|
||||
new Field(EvoUsrPermissionData.ID_FULL).isEqual(new Field(EvoUsrRolesPermissionsData.PERMISSION_ID_FULL)).and(new Field(EvoUsrPermissionData.DELETED_DATE_FULL).isEqual(null)),
|
||||
|
||||
};
|
||||
|
||||
String[] fields = new String[]{EvoUsrPermissionData.KEY_FULL};
|
||||
|
||||
Expression whereExpression = new Field(EvoUsrUserData.ACTIVE_FULL).isEqual(true)
|
||||
.and(new Field(EvoUsrUserData.DELETED_STAMP_FULL).isEqual(null))
|
||||
.and(new Field(EvoUsrUserData.LOGIN_FULL).isEqual(login));
|
||||
|
||||
Select2 permissionKeysQuery = new Select2(tables, joins, joinsExpressions, fields, whereExpression, null, null, null, null);
|
||||
|
||||
Collection<GrantedAuthority> keys = new LinkedList<GrantedAuthority>();
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
Virtual2DArray result = fichasProvidersBean.getDBMANAGER().getSharedExecuter(this).executeQuery(permissionKeysQuery);
|
||||
for(int i=0;i<result.rowCount();++i)
|
||||
{
|
||||
GrantedAuthority key = new SimpleGrantedAuthority((String) result.get(i,0));
|
||||
keys.add(key);
|
||||
}
|
||||
|
||||
return new UsernamePasswordAuthenticationToken( login, password, keys );
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
RuntimeException re = new RuntimeException("DataBase Communication Error", ex);
|
||||
ErrorLogger.logException(re);
|
||||
throw re;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,53 +1,197 @@
|
||||
package shst.medicina.fichasclinicas.provider;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
import pt.evolute.data.ProviderSpringBean;
|
||||
import shst.medicina.fichasclinicas.data.fichasclinicas.FcFichaData;
|
||||
import shst.medicina.fichasclinicas.data.fichasclinicas.FcTipoFichaData;
|
||||
import shst.medicina.fichasclinicas.data.shst.EmpresasData;
|
||||
import shst.medicina.fichasclinicas.data.shst.EstabelecimentosData;
|
||||
import shst.medicina.fichasclinicas.data.shst.TrabalhadoresData;
|
||||
|
||||
import com.evolute.entity.ProviderInterface;
|
||||
import com.evolute.utils.Singleton;
|
||||
import com.evolute.utils.dataedition.persistence.Persistent;
|
||||
import com.evolute.utils.db.DBManager;
|
||||
import com.evolute.utils.db.Executer;
|
||||
import com.evolute.utils.arrays.Virtual2DArray;
|
||||
import com.evolute.utils.sql.Expression;
|
||||
import com.evolute.utils.sql.Field;
|
||||
import com.evolute.utils.sql.Select;
|
||||
import com.evolute.utils.sql.Select2;
|
||||
|
||||
|
||||
public class FichasClinicasDataProvider
|
||||
{
|
||||
private static FichasClinicasDataProvider instance = null;
|
||||
private static final Object LOCK = new Object();
|
||||
@Autowired(required = true)
|
||||
@Qualifier("defaultProvider")
|
||||
ProviderSpringBean fichasProvidersBean;
|
||||
|
||||
@Autowired(required = true)
|
||||
@Qualifier("siprpProvider")
|
||||
ProviderSpringBean siprpProvidersBean;
|
||||
|
||||
|
||||
public List<EmpresasData> getEmpresas(Integer userID, String filter) throws Exception
|
||||
{
|
||||
|
||||
Expression dataFilter = new Field(EmpresasData.INACTIVO).isDifferent("y").and(new Field(EmpresasData.DATA_CANCELAMENTO).isEqual(null));
|
||||
if(!filter.isEmpty())
|
||||
{
|
||||
dataFilter = dataFilter.and(new Field(EmpresasData.DESIGNACAO_SOCIAL).isILike("%"+filter+"%")) ;
|
||||
}
|
||||
|
||||
/* filtros do utilizador */
|
||||
|
||||
return siprpProvidersBean.getENTITY_PROVIDER().listLoad(EmpresasData.class, dataFilter, new String[]{EmpresasData.DESIGNACAO_SOCIAL}, null);
|
||||
|
||||
}
|
||||
|
||||
public List<EstabelecimentosData> getEstabelecimentos(Integer userID, Integer empresaID, String filter) throws Exception
|
||||
{
|
||||
|
||||
Expression dataFilter = new Field(EstabelecimentosData.INACTIVO).isDifferent("y").and(new Field(EstabelecimentosData.EMPRESA_ID).isEqual(empresaID));
|
||||
if(!filter.isEmpty())
|
||||
{
|
||||
dataFilter = dataFilter.and(new Field(EstabelecimentosData.NOME).isILike("%"+filter+"%")) ;
|
||||
}
|
||||
|
||||
/* filtros do utilizador */
|
||||
|
||||
return siprpProvidersBean.getENTITY_PROVIDER().listLoad(EstabelecimentosData.class, dataFilter, new String[]{EstabelecimentosData.NOME}, null);
|
||||
|
||||
}
|
||||
|
||||
public List<TrabalhadoresData> getTrabalhadores(Integer userID, Integer estabelecimentoID, String filter) throws Exception
|
||||
{
|
||||
|
||||
Expression dataFilter = new Field(TrabalhadoresData.INACTIVO).isDifferent("y")
|
||||
.and(new Field(TrabalhadoresData.ESTABELECIMENTO_ID).isEqual(estabelecimentoID))
|
||||
.and(new Field(TrabalhadoresData.DATA_DEMISSAO).isEqual(null));
|
||||
if(!filter.isEmpty())
|
||||
{
|
||||
dataFilter = dataFilter.and(new Field("PLAIN("+TrabalhadoresData.NOME+")").isILike("%"+filter+"%")) ;
|
||||
}
|
||||
|
||||
/* filtros do utilizador */
|
||||
|
||||
return siprpProvidersBean.getENTITY_PROVIDER().listLoad(TrabalhadoresData.class, dataFilter, new String[]{TrabalhadoresData.NOME}, null);
|
||||
|
||||
}
|
||||
|
||||
public List<FcTipoFichaData> getTiposFicha(Integer userID) throws Exception
|
||||
{
|
||||
|
||||
Expression dataFilter = new Field(FcTipoFichaData.DELETED_STAMP).isEqual(null);
|
||||
|
||||
/* filtros do utilizador */
|
||||
|
||||
return fichasProvidersBean.getENTITY_PROVIDER().listLoad(FcTipoFichaData.class, dataFilter, new String[]{FcTipoFichaData.DESCRICAO}, null);
|
||||
|
||||
}
|
||||
|
||||
public TrabalhadoresData getTrabalhador(Integer userID, Integer trabalhadorID, boolean forceLoad) throws Exception
|
||||
{
|
||||
Expression dataFilter = new Field(TrabalhadoresData.ID).isEqual(trabalhadorID);
|
||||
if(!forceLoad)
|
||||
{
|
||||
dataFilter = dataFilter.and(new Field(TrabalhadoresData.INACTIVO).isDifferent("y")).and(new Field(TrabalhadoresData.DATA_DEMISSAO).isEqual(null));
|
||||
}
|
||||
|
||||
/* filtros do utilizador */
|
||||
|
||||
TrabalhadoresData result = null;
|
||||
List<TrabalhadoresData> trabs = siprpProvidersBean.getENTITY_PROVIDER().listLoad(TrabalhadoresData.class, dataFilter, new String[]{TrabalhadoresData.NOME}, null);
|
||||
if(trabs.size() > 0)
|
||||
{
|
||||
result = trabs.get(0);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private final ProviderInterface<Persistent<?>,Exception> ENTITY_PROVIDER;
|
||||
@SuppressWarnings("unused")
|
||||
private final Executer EXECUTER;
|
||||
public List<FcFichaData> getFichasTrabalhador(Integer userID, Integer trabalhadorID) throws Exception
|
||||
{
|
||||
Expression dataFilter = new Field(FcFichaData.TRABALHADOR_ID).isEqual(trabalhadorID).and(new Field(FcFichaData.DELETED_STAMP).isEqual(null));
|
||||
|
||||
/* filtros do utilizador */
|
||||
//dataFilter = dataFilter.and(new Field(FcFichaData.CREATED_USER_ID).isEqual(userID));
|
||||
|
||||
return fichasProvidersBean.getENTITY_PROVIDER().listLoad(FcFichaData.class, dataFilter, new String[]{FcFichaData.ID}, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private FichasClinicasDataProvider()
|
||||
throws Exception
|
||||
public FcFichaData getFicha(Integer fichaID) throws Exception
|
||||
{
|
||||
ENTITY_PROVIDER = (ProviderInterface<Persistent<?>,Exception>) Singleton.getInstance( Singleton.DEFAULT_OBJECT_PROVIDER );
|
||||
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
|
||||
EXECUTER = dbm.getSharedExecuter( this );
|
||||
return fichasProvidersBean.getENTITY_PROVIDER().load(FcFichaData.class, new Object[]{fichaID,null}, new String[]{FcFichaData.ID,FcFichaData.DELETED_STAMP}, null);
|
||||
}
|
||||
|
||||
public static FichasClinicasDataProvider getInstance()
|
||||
throws Exception
|
||||
public FcFichaData atomSave(FcFichaData fichaBD,Set<com.evolute.entity.evo.EvoDataObject<com.evolute.entity.utils.IntegerPrimaryKey>> others) throws Exception
|
||||
{
|
||||
synchronized (LOCK) {
|
||||
if( instance == null )
|
||||
Object trx = null;
|
||||
try
|
||||
{
|
||||
trx = fichasProvidersBean.getENTITY_PROVIDER().begin();
|
||||
//fichasProvidersBean.getENTITY_PROVIDER().save(fichaBD, trx);
|
||||
fichaBD.setProvider(fichasProvidersBean.getENTITY_PROVIDER());
|
||||
fichaBD.save(trx);
|
||||
for(com.evolute.entity.evo.EvoDataObject<com.evolute.entity.utils.IntegerPrimaryKey> other : others)
|
||||
{
|
||||
instance = new FichasClinicasDataProvider();
|
||||
//fichasProvidersBean.getENTITY_PROVIDER().save(other, trx);
|
||||
other.setProvider(fichasProvidersBean.getENTITY_PROVIDER());
|
||||
other.save(trx);
|
||||
}
|
||||
fichasProvidersBean.getENTITY_PROVIDER().commit(trx);
|
||||
trx = null;
|
||||
return fichaBD;
|
||||
}
|
||||
return instance;
|
||||
catch(Exception ex)
|
||||
{
|
||||
if(trx != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
fichasProvidersBean.getENTITY_PROVIDER().rollback(trx);
|
||||
}
|
||||
catch(Exception i_ex)
|
||||
{
|
||||
;// silent fall
|
||||
}
|
||||
}
|
||||
throw ex;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<FcFichaData> getAllFichasByTrabalhadorId( Integer trabalhadorId )
|
||||
throws Exception
|
||||
|
||||
|
||||
public Map<Integer,Date> getServerDateFichaConclusion(Integer fichaID) throws Exception
|
||||
{
|
||||
return ENTITY_PROVIDER.listLoad( FcFichaData.class,
|
||||
new Field( FcFichaData.TRABALHADOR_ID_FULL ).isEqual( trabalhadorId ).and(
|
||||
new Field( FcFichaData.DELETED_STAMP_FULL ).isEqual( null ) ),
|
||||
new String[]{ FcFichaData.DATA_FULL },
|
||||
null );
|
||||
|
||||
String queryString =
|
||||
"SELECT 0 AS "+FcFichaData.ID+", NOW() AS"+FcFichaData.DATA_CONCLUSAO;
|
||||
if(fichaID != null)
|
||||
{
|
||||
queryString = queryString + " UNION " +
|
||||
"SELECT "+FcFichaData.ID+" , "+FcFichaData.DATA_CONCLUSAO+" FROM "+FcFichaData.TABLENAME+" WHERE "+FcFichaData.ID+" = "+fichaID ;//+" AND "+FcFichaData.DATA_CONCLUSAO+" IS NULL"+
|
||||
//" ORDER BY "+FcFichaData.ID+" DESC";
|
||||
}
|
||||
Virtual2DArray queryResult = fichasProvidersBean.getDBMANAGER().getSharedExecuter(this).executeQuery(new Select(queryString));
|
||||
Map<Integer,Date> rst = new HashMap<Integer, Date>();
|
||||
for(int i = 0 ; i < queryResult.rowCount(); i++)
|
||||
{
|
||||
rst.put((Integer)queryResult.get(i, 0), (Date)queryResult.get(i, 1));
|
||||
}
|
||||
|
||||
return rst;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
package shst.medicina.fichasclinicas.webservices;
|
||||
|
||||
import shst.medicina.fichasclinicas.beans.FichaEAdmissaoInicialBean;
|
||||
import shst.medicina.fichasclinicas.beans.FichaEMCurativaEnfBean;
|
||||
import shst.medicina.fichasclinicas.beans.FichaEOcasionalBean;
|
||||
import shst.medicina.fichasclinicas.beans.FichaEPeriodicoBean;
|
||||
|
||||
public interface IFichasClinicas<T> {
|
||||
|
||||
public T getEmpresas(String filter);
|
||||
|
||||
public T getEstabelecimentos(int empresaID, String filter);
|
||||
|
||||
public T getTrabalhadores(int estabelecimentoID, String filter);
|
||||
|
||||
public T getFichaEAdmissaoInicial(int fichaID, int trabalhadorID);
|
||||
|
||||
public T sendFichaEAdmissaoInicial(FichaEAdmissaoInicialBean ficha);
|
||||
|
||||
public T getFichaEMCurativaEnf(int fichaID, int trabalhadorID);
|
||||
|
||||
public T sendFichaEMCurativaEnf(FichaEMCurativaEnfBean ficha);
|
||||
|
||||
public T getFichaEOcasional(int fichaID, int trabalhadorID);
|
||||
|
||||
public T sendFichaEOcasional(FichaEOcasionalBean ficha);
|
||||
|
||||
public T getFichaEPeriodico(int fichaID, int trabalhadorID);
|
||||
|
||||
public T sendFichaEPeriodico(FichaEPeriodicoBean ficha);
|
||||
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package shst.medicina.fichasclinicas.webservices;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
|
||||
public interface ILogin<T> {
|
||||
|
||||
//T doLogin(Map<String,Object> auth);
|
||||
|
||||
//T checkLogin();
|
||||
|
||||
//T doLogout();
|
||||
|
||||
Response doLogin(HttpServletRequest req, Map<String, Object> auth);
|
||||
|
||||
Response checkLogin(HttpServletRequest req);
|
||||
|
||||
Response doLogout(HttpServletRequest req);
|
||||
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package shst.medicina.fichasclinicas.webservices;
|
||||
|
||||
public interface WebServicesConst
|
||||
{
|
||||
static final String USER_SESSION_STORE_VAR = "user" ;
|
||||
}
|
||||