Browse Source

Add switchoff class / language behavior to fulltext tool

pull/70/head
Jacob Mendt 6 years ago
parent
commit
7708e65f6c
  1. 2
      dlf/plugins/pageview/class.tx_dlf_pageview.php
  2. 2
      dlf/plugins/pageview/tx_dlf_pageview.js
  3. 28
      dlf/plugins/pageview/tx_dlf_pageview_fulltext_control.js
  4. 2
      dlf/plugins/toolbox/tools/fulltext/class.tx_dlf_toolsFulltext.php
  5. 4
      dlf/plugins/toolbox/tools/fulltext/locallang.xml

2
dlf/plugins/pageview/class.tx_dlf_pageview.php

@ -148,7 +148,7 @@ class tx_dlf_pageview extends tx_dlf_plugin {
div: "' . $this->conf['elementId'] . '",
fulltexts: ["' . implode('", "', $this->fulltexts) . '"],
images: ["' . implode('", "', $this->images) . '"],
lang: "de"
lang: "'.$this->lang.'"
})
}
</script>';

2
dlf/plugins/pageview/tx_dlf_pageview.js

@ -433,7 +433,7 @@ dlfViewer.prototype.init = function(){
};
// Adds fulltext behavior
this.fulltextControl = new dlfViewerFullTextControl(this.map)
this.fulltextControl = new dlfViewerFullTextControl(this.map, this.lang);
// keep fulltext feature active
var isFulltextActive = dlfUtils.getCookie("tx-dlf-pageview-fulltext-select"),

28
dlf/plugins/pageview/tx_dlf_pageview_fulltext_control.js

@ -21,8 +21,9 @@ jQuery.fn.scrollTo = function(elem, speed) {
* Encapsulates especially the fulltext behavior
* @constructor
* @param {ol.Map} map
* @param {string} lang
*/
var dlfViewerFullTextControl = function(map){
var dlfViewerFullTextControl = function(map, lang){
/**
* @private
@ -32,6 +33,12 @@ var dlfViewerFullTextControl = function(map){
/**
* @private
* @type {string}
*/
this.lang = lang == 'de' || lang == 'en' ? lang : 'de';
/**
* @private
* @type {ol.layer.Vector}
*/
this.textBlockLayer = new ol.layer.Vector({
@ -237,7 +244,10 @@ dlfViewerFullTextControl.prototype.enableFulltextSelect = function(textBlockFeat
this.map.addLayer(this.highlightLayerTextLine);
// show fulltext container
$("#tx-dlf-fulltextselection").addClass('fulltext-visible');
var title = dlfViewerFullTextControl.dic[this.lang][1];
$("#tx-dlf-tools-fulltext").addClass('fulltext-visible')
.text(title)
.attr('title', title);
}
// add first feature of textBlockFeatures to map
@ -277,7 +287,10 @@ dlfViewerFullTextControl.prototype.disableFulltextSelect = function() {
this.selectLayer.getSource().clear();
this.highlightLayerTextLine.getSource().clear()
$("#tx-dlf-fulltextselection").removeClass('fulltext-visible');
var title = dlfViewerFullTextControl.dic[this.lang][0];
$("#tx-dlf-tools-fulltext").removeClass('fulltext-visible')
.text(title)
.attr('title', title);
};
@ -389,3 +402,12 @@ dlfViewerFullTextControl.style.textlineStyle = function() {
});
};
/**
*
* @type {{en: string[], de: string[]}}
*/
dlfViewerFullTextControl.dic = {
'en': ['Activate Fulltext', 'Deactivate Fulltext'],
'de': ['Volltexte an', 'Volltexte aus']
};

2
dlf/plugins/toolbox/tools/fulltext/class.tx_dlf_toolsFulltext.php

@ -93,7 +93,7 @@ class tx_dlf_toolsFulltext extends tx_dlf_plugin {
$fullTextFile = $this->doc->physicalPagesInfo[$this->doc->physicalPages[$this->piVars['page']]]['files'][$this->conf['fileGrpFulltext']];
if (!empty($fullTextFile)) {
$markerArray['###FULLTEXT_SELECT###'] = '<a class="select" id="tx-dlf-tools-fulltext" title="'.$this->pi_getLL('fulltext-select', '', TRUE).'" onclick="tx_dlf_viewer.toggleFulltextSelect();">'.$this->pi_getLL('fulltext-select', '', TRUE).'</a>';
$markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="'.$this->pi_getLL('fulltext-select', '', TRUE).'" onclick="tx_dlf_viewer.toggleFulltextSelect();">'.$this->pi_getLL('fulltext-select', '', TRUE).'</a>';
} else {
$markerArray['###FULLTEXT_SELECT###'] = $this->pi_getLL('fulltext-select', '', TRUE);
}

4
dlf/plugins/toolbox/tools/fulltext/locallang.xml

@ -28,10 +28,10 @@
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="fulltext-select">Select Fulltext</label>
<label index="fulltext-select">Activate Fulltext</label>
</languageKey>
<languageKey index="de" type="array">
<label index="fulltext-select">Volltext markieren</label>
<label index="fulltext-select">Volltexte an</label>
</languageKey>
</data>
</T3locallang>

Loading…
Cancel
Save