Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cadastroweb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Participatorio
cadastroweb
Commits
865644f8
Commit
865644f8
authored
10 years ago
by
Bruno Nocera Zanette
Browse files
Options
Downloads
Patches
Plain Diff
Store all Javascript at the same place
Store all Javascript at the same place
parent
aebf9744
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/webapp/WEB-INF/tags/form/fields/table.tagx
+79
-85
79 additions, 85 deletions
src/main/webapp/WEB-INF/tags/form/fields/table.tagx
with
79 additions
and
85 deletions
src/main/webapp/WEB-INF/tags/form/fields/table.tagx
+
79
−
85
View file @
865644f8
...
...
@@ -70,6 +70,85 @@
document.getElementById(id).id=id+"_stylized";
}
function showRedirect(){
var radioElements = document.getElementsByName("radioButton");
console.log("${path}");
for (var i=0; i < radioElements.length; i++)
if(radioElements[i].checked == true) {
var pathHeader = window.location.href.substring(0,window.location.href.lastIndexOf("${path}"));
if ("${select}" == "false")
window.location.href=pathHeader+"${path}/"+radioElements[i].value;
else {
var str = "${pathShow}";
pathHeader = window.location.href.substring(0,window.location.href.lastIndexOf("programas/"));
window.location.href=pathHeader+str+"/"+radioElements[i].value;
}
}
}
function updateRedirect(){
var radioElements = document.getElementsByName("radioButton");
for (var i=0; i < radioElements.length; i++)
if(radioElements[i].checked == true) {
var pathHeader = window.location.href.substring(0,window.location.href.lastIndexOf("${path}"));
var form = "${path}".indexOf("ocorrenciamunicipais") != -1 ? "?formUpdate" : "?form";
window.location.href=pathHeader+"${path}/"+radioElements[i].value+form;
}
}
function deleteRedirect(){
var radioElements = document.getElementsByName("radioButton");
for (var i=0; i < radioElements.length; i++)
if(radioElements[i].checked == true) {
var pathHeader = window.location.href.substring(0,window.location.href.lastIndexOf("${path}"));
document.deleteForm.action = pathHeader+"${path}/"+radioElements[i].value;
return confirm('${delete_confirm_msg}');
}
}
function post(){
var form = document.getElementById("programa") == null ? document.getElementById("ocorrenciaMunicipal") : document.getElementById("programa");
console.log(form);
form.action = selectRedirect();
form.submit();
}
function selectRedirect(){
var radioElements = document.getElementsByName("radioButton");
var selected ="";
for (var i=0; i < radioElements.length; i++){
if(radioElements[i].checked == true) {
selected += radioElements[i].value + "+";
}
}
selected = selected.substring(0,selected.lastIndexOf("+"));
var progIndex = window.location.pathname.indexOf("/programas");
if(progIndex == -1){
progIndex = window.location.pathname.indexOf("/ocorrenciamunicipais");
var pathHeader = window.location.pathname.substring(0,progIndex)+"/ocorrenciamunicipais";
}else{
var pathHeader = window.location.pathname.substring(0,progIndex)+"/programas";
}
pathHeader = pathHeader.charAt(pathHeader.length - 1) == "/" ? pathHeader.slice(0,pathHeader.length-1) : pathHeader;
if(window.location.pathname.indexOf("pesquisa") != -1){
pathHeader += "/pesquisa";
}
var form = "";
if("${Itinerante}"=="true"){
form = "/formItinerante/";
}else{
form = "/form/";
}
return pathHeader+form+selected;
}
</script>
<table class="table-with-utilbox">
...
...
@@ -287,91 +366,6 @@
</table>
<script type="text/javascript">
function showRedirect(){
var radioElements = document.getElementsByName("radioButton");
console.log("${path}");
for (var i=0; i < radioElements.length; i++)
if(radioElements[i].checked == true) {
var pathHeader = window.location.href.substring(0,window.location.href.lastIndexOf("${path}"));
if ("${select}" == "false")
window.location.href=pathHeader+"${path}/"+radioElements[i].value;
else {
var str = "${pathShow}";
pathHeader = window.location.href.substring(0,window.location.href.lastIndexOf("programas/"));
window.location.href=pathHeader+str+"/"+radioElements[i].value;
}
}
}
function updateRedirect(){
var radioElements = document.getElementsByName("radioButton");
for (var i=0; i < radioElements.length; i++)
if(radioElements[i].checked == true) {
var pathHeader = window.location.href.substring(0,window.location.href.lastIndexOf("${path}"));
var form = "${path}".indexOf("ocorrenciamunicipais") != -1 ? "?formUpdate" : "?form";
window.location.href=pathHeader+"${path}/"+radioElements[i].value+form;
}
}
function deleteRedirect(){
var radioElements = document.getElementsByName("radioButton");
for (var i=0; i < radioElements.length; i++)
if(radioElements[i].checked == true) {
var pathHeader = window.location.href.substring(0,window.location.href.lastIndexOf("${path}"));
document.deleteForm.action = pathHeader+"${path}/"+radioElements[i].value;
return confirm('${delete_confirm_msg}');
}
}
function post(){
var form = document.getElementById("programa") == null ? document.getElementById("ocorrenciaMunicipal") : document.getElementById("programa");
console.log(form);
form.action = selectRedirect();
form.submit();
}
function selectRedirect(){
var radioElements = document.getElementsByName("radioButton");
var selected ="";
for (var i=0; i < radioElements.length; i++){
if(radioElements[i].checked == true) {
selected += radioElements[i].value + "+";
}
}
selected = selected.substring(0,selected.lastIndexOf("+"));
var progIndex = window.location.pathname.indexOf("/programas");
if(progIndex == -1){
progIndex = window.location.pathname.indexOf("/ocorrenciamunicipais");
var pathHeader = window.location.pathname.substring(0,progIndex)+"/ocorrenciamunicipais";
}else{
var pathHeader = window.location.pathname.substring(0,progIndex)+"/programas";
}
pathHeader = pathHeader.charAt(pathHeader.length - 1) == "/" ? pathHeader.slice(0,pathHeader.length-1) : pathHeader;
if(window.location.pathname.indexOf("pesquisa") != -1){
pathHeader += "/pesquisa";
}
var form = "";
if("${Itinerante}"=="true"){
form = "/formItinerante/";
}else{
form = "/form/";
}
return pathHeader+form+selected;
}
</script>
</c:if>
</jsp:root>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment