Skip to content

Commit

Permalink
audio digital response
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio.tellez authored and sergio.tellez committed Jun 1, 2018
1 parent 418242b commit 4103799
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
});
}
</script>
<%=scriptHeader%>
<%=divVisor%>
<section id="detalle">
<div id="idetail" class="detallelist">
Expand Down
4 changes: 4 additions & 0 deletions SWB/src/main/webapp/swbadmin/jsp/rnc/viewer/audiodigital.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
List<Title> titles = new ArrayList<>();
List<String> creators = new ArrayList<>();
StringBuilder divVisor = new StringBuilder();
StringBuilder scriptHeader = new StringBuilder();
StringBuilder scriptCallVisor = new StringBuilder();
List<DigitalObject> digitalobjects = new ArrayList<>();
Entry entry = (Entry)request.getAttribute("entry");
SWBParamRequest paramRequest = (SWBParamRequest)request.getAttribute("paramRequest");
WebSite site = paramRequest.getWebPage().getWebSite();
if (null != entry) {
if (null != entry.getDigitalObject()) {
creators = entry.getCreator();
Expand All @@ -27,6 +29,7 @@
audios = null != digitalobjects ? digitalobjects.size() : 0;
if (!titles.isEmpty()) title = titles.get(0).getValue();
if (audios > 0) {
scriptHeader.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"/work/models/").append(site.getId()).append("/audio/css/audio.css\" />");
divVisor.append("<script>")
.append(" $(document).ready(function(){")
.append(" $(\"#play-pause\").click(function(){")
Expand Down Expand Up @@ -56,6 +59,7 @@
}
}
%>
<%=scriptHeader%>
<%=divVisor%>
<div id="idetail" class="detallelist">
<div class="explora">
Expand Down
95 changes: 58 additions & 37 deletions SWB/src/main/webapp/swbadmin/jsp/rnc/viewer/videodetail.jsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%--
Document : zoomdetail.jsp
Document : videodetail.jsp
Created on : 22/05/2018, 11:48:36 AM
Author : sergio.tellez
--%>
Expand All @@ -26,30 +26,38 @@
Entry entry = (Entry)request.getAttribute("entry");
SWBParamRequest paramRequest = (SWBParamRequest)request.getAttribute("paramRequest");
WebSite site = paramRequest.getWebPage().getWebSite();
SWBResourceURL digitURL = paramRequest.getRenderUrl().setMode("DIGITAL");
digitURL.setCallMethod(SWBParamRequest.Call_DIRECT);
if (null != entry) {
iEntry = entry.getPosition();
if (null != entry.getDigitalObject()) {
iEntry = entry.getPosition();
if (null != entry.getDigitalObject()) {
creators = entry.getCreator();
titles = entry.getRecordtitle();
digitalobjects = entry.getDigitalObject();
vids = null != digitalobjects ? digitalobjects.size() : 0;
digital = vids >= iDigit ? digitalobjects.get(iDigit-1) : new DigitalObject();
if (null != digital.getUrl() && (digital.getUrl().endsWith(".mp4") || digital.getUrl().endsWith(".avi"))) {
if (null != digital.getUrl()) {
String mime = null != digital.getMediatype() ? digital.getMediatype().getMime() : "";
if (digital.getUrl().endsWith(".mp4")) mime = "video/mp4";
scriptHeader.append("<script src=\"https://cdn.plyr.io/2.0.18/plyr.js\"></script>");
scriptHeader.append("<script>plyr.setup();</script>");
scriptHeader.append("<script>plyr.setup();</script>");
scriptHeader.append("<script type=\"text/javascript\" src=\"/work/models/").append(site.getId()).append("/js/viewer-video.js\"></script>");
scriptHeader.append("<link rel='stylesheet' type='text/css' media='screen' href='/work/models/").append(site.getId()).append("/css/viewer-video-2.css'/>");
divVisor.append("<video id=\"video\" width=\"97%\" poster=\"").append(entry.getResourcethumbnail()).append("\" controls controlsList=\"nodownload\">");
divVisor.append(" <source src=\"").append(digital.getUrl()).append("\" type=\"").append(entry.getType()).append("\">");
divVisor.append(" <p>Tu navegador no soporta video en HTML5</p>");
divVisor.append("<video id=\"video\" width=\"97%\" poster=\"").append(entry.getResourcethumbnail()).append("\" controls controlsList=\"nodownload\">");
divVisor.append(" <source src=\"").append(digital.getUrl()).append("\" type=\"").append(mime).append("\">");
divVisor.append(" <p>Tu navegador no soporta video en HTML5</p>");
divVisor.append("</video>");
divVisor.append("<div id=\"video-controls\" class=\"row\">")
divVisor.append("<div id=\"video-controls\" class=\"row\">")
.append(" <div class=\"col-11 col-md-7 video-players\">")
.append(" <div class=\"col-12 video-botones\">")
.append(" <button type=\"button\" id=\"prev\" class=\"prev\"><span class=\"ion-ios-skipbackward\"></span></button>")
.append(" <button type=\"button\" id=\"play-pause\" class=\"play\"><span class=\"ion-ios-play\"></span></button>")
.append(" <button type=\"button\" id=\"next\" class=\"next\"><span class=\"ion-ios-skipforward\"></span></button>")
.append(" </div>")
.append(" <div class=\"col-12 video-botones\">");
if (iDigit > 1)
divVisor.append(" <button type=\"button\" id=\"prev\" class=\"prev\"><span class=\"ion-ios-skipbackward\"></span></button>");
divVisor.append(" <button type=\"button\" id=\"play-pause\" class=\"play\"><span class=\"ion-ios-play\"></span></button>");
if (iDigit < vids) {
String next = "onclick=\"nextObj('"+entry.getId()+"',"+iDigit+");\"";
divVisor.append(" <button type=\"button\" id=\"next\" class=\"next\"").append(next).append("><span class=\"ion-ios-skipforward\"></span></button>");
}
divVisor.append(" </div>")
.append(" <div class=\"col-12 video-range\">")
.append(" <span class=\"video-time oswM\">0:00:00</span>")
.append(" <input type=\"range\" id=\"seek-bar\" value=\"0\">")
Expand Down Expand Up @@ -78,10 +86,10 @@
.append(" });")
.append(" });")
.append("</script>");
type = entry.getResourcetype().size() > 0 ? entry.getResourcetype().get(0) : "";
datestart = entry.getPeriodcreated().getDatestart();
type = entry.getResourcetype().size() > 0 ? entry.getResourcetype().get(0) : "";
datestart = entry.getPeriodcreated().getDatestart();
creator = creators.size() > 0 ? creators.get(0) : "";
period = null != datestart ? datestart.getValue() : "";
period = null != datestart ? datestart.getValue() : "";
if (!titles.isEmpty()) title = titles.get(0).getValue();
}
}
Expand All @@ -101,15 +109,15 @@
}
function loadDoc(id) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
jQuery("#addCollection-tree").html(this.responseText);
jQuery("#addCollection-tree").html(this.responseText);
$("#addCollection" ).dialog( "open" );
}else if (this.readyState == 4 && this.status == 403) {
jQuery("#dialog-message-tree").text("Regístrate o inicia sesión para crear tus colecciones.");
jQuery("#dialog-message-tree").text("Regístrate o inicia sesión para crear tus colecciones.");
$("#dialog-message-tree" ).dialog( "open" );
}
};
};
xhttp.open("GET", "/swb/<%=site.getId()%>/favorito?id="+id, true);
xhttp.send();
}
Expand All @@ -118,14 +126,27 @@
}
function addnew(uri) {
dismiss();
dojo.xhrPost({
dojo.xhrPost({
url: uri,
load: function(data) {
dojo.byId('newCollection').innerHTML=data;
$('#newCollection').modal('show');
$('#newCollection').modal('show');
}
});
});
}
function nextObj(iEntry, iDigit) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
alert(this.responseText);
jQuery("#idetail").html(this.responseText);
}else if (this.readyState == 4 && this.status == 403) {
console.log(this.responseText);
}
};
xhttp.open("POST", '<%=digitURL%>?id='+iEntry+'&n='+iDigit, true);
xhttp.send();
}
</script>
<%=scriptCallVisor%>
<section id="detalle">
Expand All @@ -134,12 +155,12 @@
<h3 class="oswB"><%=title%></h3>
<p class="oswL"><%=creator%></p>
</div>
<div class="explora">
<div class="explora">
<div class="explora2">
<div class="explo1">
© <%=paramRequest.getLocaleString("usrmsg_view_detail_all_rights")%>
</div>
<div class="explo2 row">
<div class="explo2 row">
<div class="col-3">
<span class="ion-social-facebook"></span>
</div>
Expand All @@ -150,24 +171,24 @@
<a href="#" onclick="loadDoc('<%=entry.getId()%>');"><span class="ion-heart"></span></a> <%=entry.getResourcestats().getViews()%>
</div>
</div>
<div class="explo3 row">
<div class="explo3 row">
<div class="col-6">
</div>
<div class="col-6">
</div>
</div>
</div>
</div>
</div>
<%=divVisor%>
</div>
</section>
<section id="detalleinfo">
<div class="container">
<div class="row">
<div class="row">
<div class="col-12 col-sm-6 col-md-3 col-lg-3 order-md-1 order-sm-2 order-2 mascoleccion">
<div>
<p class="tit2"><%=paramRequest.getLocaleString("usrmsg_view_detail_more_collection")%></p>
<div>
<div>
<img src="/work/models/repositorio/img/agregado-01.jpg" class="img-responsive">
<p><%=paramRequest.getLocaleString("usrmsg_view_detail_name_work")%></p>
<p>Autor Lorem Ipsum</p>
Expand All @@ -182,7 +203,7 @@
</div>
</div>
<div class="col-12 col-sm-12 col-md-6 col-lg-6 order-md-2 order-sm-1 order-1 ficha ">
<h3 class="oswM"><%=title%></h3>
<h3 class="oswM"><%=title%></h3>
<% if (null != entry && null != entry.getDescription() && !entry.getDescription().isEmpty()) { %>
<p><%=entry.getDescription().get(0)%></p>
<% } %>
Expand All @@ -193,34 +214,34 @@
<th colspan="2"><%=paramRequest.getLocaleString("usrmsg_view_detail_data_sheet")%></th>
</tr>
<tr>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_artist")%></td>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_artist")%></td>
<td><%=creator%></td>
</tr>
<tr>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_date")%></td>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_date")%></td>
<td><%=period%></td>
</tr>
<tr>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_type_object")%></td>
<td><%=type%></td>
</tr>
<tr>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_identifier")%></td>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_identifier")%></td>
<td><%=entry.getIdentifiers()%></td>
</tr>
<tr>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_institution")%></td>
<td>Lorem ipsum</td>
</tr>
<tr>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_technique")%></td>
<td><%=paramRequest.getLocaleString("usrmsg_view_detail_technique")%></td>
<td>Lorem ipsum</td>
</tr>
</table>
<p class="vermas"><a href="#"><%=paramRequest.getLocaleString("usrmsg_view_detail_show_more")%> <span class="ion-plus-circled"></span></a></p>
</div>
<div class="col-12 col-sm-6 col-md-3 col-lg-3 order-md-3 order-sm-3 order-3 clave">
<div class="redes">
<div class="redes">
<span class="ion-social-facebook"></span>
<span class="ion-social-twitter"></span>
</div>
Expand All @@ -230,7 +251,7 @@
<%
int i = 0;
for (String key : entry.getKeywords()) {
i++;
i++;
out.println("<a href=\"#\">"+key+"</a>");
if (i < entry.getKeywords().size()) out.println(" / ");
}
Expand Down
Loading

0 comments on commit 4103799

Please sign in to comment.