Commit d42e19f2 authored by Rémi GAUTHIER's avatar Rémi GAUTHIER

[weblab-metaview] OW2-2 Display confirmation modal when adding new

source
parent a9dbfd1c
......@@ -74,4 +74,11 @@ meta.editButton=Edit
portlet.meta.configuration = Displayed metadata
meta.save_config = Save
portlet.no_meta = No meta-data to display
portlet.leave = You are going to leave the WebLab Platform, are you sure you want to access external networks ?
\ No newline at end of file
portlet.leave = You are going to leave the WebLab Platform, are you sure you want to access external networks ?
portlet.sources.button.add=Add
portlet.sources.button.cancel=Cancel
portlet.sources.useAsSourceContent=Add this link to the source management list?
portlet.sources.useAsSourceTitle=Source addition
\ No newline at end of file
......@@ -76,4 +76,11 @@ meta.save_config = Enregister
thumbnail.image.alt = Aperçu de
portlet.no_meta = Aucune métadonnée à afficher
portlet.leave = Vous allez quitter la Palteforme WebLab, tes vous sr de vouloir accder des rseaux externes ?
\ No newline at end of file
portlet.leave = Vous allez quitter la Palteforme WebLab, êtes vous sûr de vouloir accéder à des réseaux externes ?
portlet.sources.button.add=Ajouter
portlet.sources.button.cancel=Annuler
portlet.sources.useAsSourceContent=Ajouter ce lien dans la liste des sources de collecte?
portlet.sources.useAsSourceTitle=Ajout de source
......@@ -7,6 +7,7 @@
<header-portlet-css>/css/metadata_edit.css</header-portlet-css>
<header-portlet-css>/css/jquery.datepick.css</header-portlet-css>
<header-portlet-css>/css/ol.css</header-portlet-css>
<header-portlet-javascript>/js/metaview.js</header-portlet-javascript>
<header-portlet-javascript>/js/ol.js</header-portlet-javascript>
<header-portlet-javascript>/js/OpenLayer.config.js</header-portlet-javascript>
<header-portlet-javascript>/js/jquery-ui/jquery-ui-timepicker-addon.js</header-portlet-javascript>
......
jQuery.metaview = {
init : function(urls, messages) {
jQuery.metaview.urls = urls;
jQuery.metaview.messages = messages;
},
useAsSource : function() {
var useAsSourceDialog = jQuery('<div>'
+ jQuery.metaview.messages.useAsSourceContent + '</div>');
var buttonAdd = {
text : jQuery.metaview.messages.addButton,
click : function() {
document.location.href = jQuery.metaview.urls.useAsSourceURL;
}
}
var buttonCancel = {
text : jQuery.metaview.messages.cancelButton,
click : function() {
useAsSourceDialog.dialog("close");
}
}
useAsSourceDialog.dialog({
modal : true,
width : 500,
title : jQuery.metaview.messages.useAsSourceTitle,
buttons : [ buttonCancel, buttonAdd ]
});
}
}
\ No newline at end of file
......@@ -12,6 +12,10 @@
<portlet:resourceURL var="resourceURL" escapeXml="false" id="showMetadata" />
<portlet:resourceURL var="clearErrorURL" escapeXml="false" id="clearErrorAttribute" />
<portlet:actionURL var="useAsSource">
<portlet:param name="action" value="useAsSource" />
</portlet:actionURL>
<c:choose>
<c:when test="${isEmptyModel}">
<div class="portlet-msg-info"><fmt:message key="portlet.no_meta" /></div>
......@@ -46,4 +50,25 @@
});
</script>
</c:otherwise>
</c:choose>
\ No newline at end of file
</c:choose>
<script type="text/javascript">
jQuery(document).ready(function() {
var messages = {
"addButton" : "<fmt:message key='portlet.sources.button.add' />",
"cancelButton" : "<fmt:message key='portlet.sources.button.cancel' />",
"useAsSourceContent" : "<fmt:message key='portlet.sources.useAsSourceContent' />",
"useAsSourceTitle" : "<fmt:message key='portlet.sources.useAsSourceTitle' />",
};
var urls = {
"useAsSourceURL" : '${useAsSource}',
};
jQuery.metaview.init(urls, messages);
});
</script>
\ No newline at end of file
......@@ -59,12 +59,9 @@
</c:set>
<c:if test="${fn:startsWith(source, 'http:') || fn:startsWith(source, 'https:')}">
<c:if test="${userHasAdminRole && allowSourceEventing}">
<portlet:actionURL var="useAsSource">
<portlet:param name="action" value="useAsSource" />
</portlet:actionURL>
<a href="${useAsSource}">
<span style="cursor: pointer;" onclick="jQuery.metaview.useAsSource()">
<img title="<fmt:message key="meta.useAsSource" />" src="${useAsSourceButtonImgSrc}" />
</a>
</span>
</c:if>
</c:if>
<weblab:renderValues style="anchor" cssClass="meta_link warnUserOnClick">${source}</weblab:renderValues>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment