diff --git a/client/src/main/webapp/js/breadcrumbs.js b/client/src/main/webapp/js/breadcrumbs.js
index d5eb84e037..fad69111dd 100644
--- a/client/src/main/webapp/js/breadcrumbs.js
+++ b/client/src/main/webapp/js/breadcrumbs.js
@@ -15,7 +15,7 @@ K5.eventsHandler.addHandler(function(type, data) {
if ((splitted[0] === "api") && (splitted[1] === "item")) {
var pid = splitted[2];
delayedEvent.pid=pid;
- if (K5.initialized) {
+ if (K5.initialized && K5.i18n.ctx.dictionary) {
K5.gui["breadcrumbs"].refresh(pid);
delayedEvent.enabled = false;
} else {
@@ -23,9 +23,18 @@ K5.eventsHandler.addHandler(function(type, data) {
}
}
}
+ if (type === "i18n/dictionary ") {
+ if (K5.initialized) {
+ if ((delayedEvent.enabled) && (K5.api.ctx["item"] && K5.api.ctx["item"][delayedEvent.pid])) {
+ K5.gui["breadcrumbs"].refresh(delayedEvent.pid);
+ }
+ }
+ }
if (type === "application/init/end") {
- if ((delayedEvent.enabled) && (K5.api.ctx["item"] && K5.api.ctx["item"][delayedEvent.pid])) {
+ if (K5.i18n.ctx.dictionary) {
+ if ((delayedEvent.enabled) && (K5.api.ctx["item"] && K5.api.ctx["item"][delayedEvent.pid])) {
K5.gui["breadcrumbs"].refresh(delayedEvent.pid);
+ }
}
}
diff --git a/client/src/main/webapp/js/i18n.js b/client/src/main/webapp/js/i18n.js
index c189a4fe8f..5c4cc257a0 100644
--- a/client/src/main/webapp/js/i18n.js
+++ b/client/src/main/webapp/js/i18n.js
@@ -14,9 +14,10 @@ function I18N(application){
I18N.prototype= {
ctx:{},
- /** tests if given key is present in the context */
- isKeyReady: function(keys) {
- return lookUpKey(keys, this.ctx);
+
+ /** tests if given key is present in the context */
+ isKeyReady: function(keys) {
+ return lookUpKey(keys, this.ctx);
},
@@ -39,7 +40,7 @@ I18N.prototype= {
- askForText:function(nm, lang, whenready) {
+ askForText:function(nm, lang, whenready) {
$.getJSON("texts.vm?text=" + nm+"&lang="+lang, _.bind(function(data) {
if (!K5.i18n.isKeyReady("texts")) {
this.ctx['texts']={};
diff --git a/client/src/main/webapp/js/item.js b/client/src/main/webapp/js/item.js
index c17c2f5f99..f28c464ec7 100644
--- a/client/src/main/webapp/js/item.js
+++ b/client/src/main/webapp/js/item.js
@@ -115,7 +115,7 @@ function _eventProcess(pid) {
//_metadatainit();
- K5.gui.selected["disabledDisplay"] = false;
+ K5.gui.selected["disabledDisplay"] = true;
});
K5.gui["viewers"].forbiddenCheck(viewer.object,okfunc,failfunc);
diff --git a/client/src/main/webapp/js/item/ctxbtnsutils.js b/client/src/main/webapp/js/item/ctxbtnsutils.js
index e07b1b9a94..8e262a2357 100644
--- a/client/src/main/webapp/js/item/ctxbtnsutils.js
+++ b/client/src/main/webapp/js/item/ctxbtnsutils.js
@@ -15,6 +15,13 @@ function _ctxbuttonsrefresh(viewer) {
if (jQuery.inArray('all', a) > -1) {
$("#contextbuttons").append($(this).clone());
}
+
+
+ // all context
+ if (jQuery.inArray('share', a) > -1) {
+ $("#contextbuttons").append($(this).clone());
+ }
+
// only selected
if (jQuery.inArray('selected', a) > -1) {
if (K5.gui.clipboard.isCurrentSelected()) {
@@ -40,7 +47,7 @@ function _ctxbuttonsrefresh(viewer) {
}
// add to favorites
- if (jQuery.inArray('favorite', a) > -1) {
+ if (jQuery.inArray('favorite', a) > -1 ) {
var addf = false;
if (K5.authentication.profileDisplay != null) {
addf = !K5.authentication.profileDisplay.isCurrentPidInFavorites();
diff --git a/client/src/main/webapp/js/results.js b/client/src/main/webapp/js/results.js
index 894b5f2a1e..29532837a6 100644
--- a/client/src/main/webapp/js/results.js
+++ b/client/src/main/webapp/js/results.js
@@ -87,7 +87,7 @@ Results.prototype = {
}
},
getDocs: function() {
- $('.loading').show();
+ $('.opacityloading').show();
$.get("raw_results.vm?" + $("#search_form").serialize(), _.bind(function(data) {
//console.log(data);
$('#search_results_docs .more_docs').remove();
@@ -98,7 +98,7 @@ Results.prototype = {
this.srResize();
K5.eventsHandler.trigger("results/loaded", json);
}
- $('.loading').hide();
+ $('.opacityloading').hide();
this.resultsLoaded = true;
}, this));
},
diff --git a/client/src/main/webapp/js/viewers/forbidden.js b/client/src/main/webapp/js/viewers/forbidden.js
index b1cace7f8d..0c69d1414b 100644
--- a/client/src/main/webapp/js/viewers/forbidden.js
+++ b/client/src/main/webapp/js/viewers/forbidden.js
@@ -30,6 +30,8 @@ Forbidden.prototype.open = function(rect) {
this.disabledDisplay = true;
K5.i18n.k5translate('#forbidden');
+
+ K5.eventsHandler.trigger("application/menu/ctxchanged", null);
}
Forbidden.prototype.clearContainer = function() {
@@ -37,37 +39,65 @@ Forbidden.prototype.clearContainer = function() {
}
Forbidden.prototype.addContextButtons= function() {
- $("#contextbuttons").html("");
- $("#item_menu>div").each(function() {
- if ($(this).data("ctx")) {
- var a = $(this).data("ctx").split(";");
- if (jQuery.inArray('all', a) > -1 || jQuery.inArray('forbidden', a) > -1) {
- $("#contextbuttons").append($(this).clone());
- }
-
- if (jQuery.inArray('selected', a) > -1) {
- if (K5.gui.clipboard.isCurrentSelected()) {
- $("#contextbuttons").append($(this).clone());
- }
- }
+ $("#contextbuttons").html("");
+ $("#item_menu>div")
+ .each(
+ function() {
+ if ($(this).data("ctx")) {
+ var a = $(this).data("ctx").split(";");
+ if (viewer) {
+ if (jQuery.inArray(viewer, a) > -1) {
+ $("#contextbuttons").append($(this).clone());
+ }
+ }
- if (jQuery.inArray('notselected', a) > -1) {
- if (!K5.gui.clipboard.isCurrentSelected()) {
- $("#contextbuttons").append($(this).clone());
- }
- }
+ // all context
+ if (jQuery.inArray('all', a) > -1) {
+ $("#contextbuttons").append($(this).clone());
+ }
+
- // only clipboard
- if (jQuery.inArray('clipboardnotempty', a) > -1) {
- if (K5.gui.clipboard.getSelected().length > 0) {
- $("#contextbuttons").append($(this).clone());
- }
- }
- }
- });
+ // next context
+ if (jQuery.inArray('next', a) > -1) {
+ if (K5.api.ctx["item"][selected]["siblings"]) {
+ var data = K5.api.ctx["item"][selected]["siblings"];
+ var arr = data[0]['siblings'];
+ var index = _.reduce(arr, function(memo,
+ value, index) {
+ return (value.selected) ? index : memo;
+ }, -1);
+ if (index < arr.length - 1) {
+ $("#contextbuttons").append(
+ $(this).clone());
+ }
+ }
+ }
- if (!K5.gui["selected"].hasParent()) {
- $("#contextbuttons>div.parent").hide();
- }
+ // prev context
+ if (jQuery.inArray('prev', a) > -1) {
+ if (K5.api.ctx["item"][selected]["siblings"]) {
+ var data = K5.api.ctx["item"][selected]["siblings"];
+ var arr = data[0]['siblings'];
+ var index = _.reduce(arr, function(memo,
+ value, index) {
+ return (value.selected) ? index : memo;
+ }, -1);
+ if (index > 0) {
+ $("#contextbuttons").append(
+ $(this).clone());
+ }
+ }
+ }
+
+ if (jQuery.inArray('parent', a) > -1) {
+ var pid = K5.api.ctx["item"]["selected"];
+ var data = K5.api.ctx["item"][pid];
+ var itemContext = data.context[0]; // jinak?
+ if (itemContext.length > 1) {
+ $("#contextbuttons").append($(this).clone());
+ }
+ }
+ }
+ });
}
diff --git a/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/pdf/utils/Images.java b/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/pdf/utils/Images.java
index 5d554cd80e..90e837bd20 100644
--- a/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/pdf/utils/Images.java
+++ b/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/pdf/utils/Images.java
@@ -79,8 +79,8 @@ public static Float ratio(Document document, float percentage,
public static void imageNotAvailable(Document document, TextsService textsService, Provider
localesProvider, Font font) throws IOException, DocumentException {
- String text = textsService.getText("image_not_available",localesProvider.get());
- text = text != null ? text : "image_not_available";
+ String text = textsService.getText("security_fail",localesProvider.get());
+ text = text != null ? text : "security_fail";
Chunk chunk = new Chunk(text, font);
Paragraph na = new Paragraph();
na.add(chunk);