Commit 2896c944 authored by ephoto_dam's avatar ephoto_dam

Dev Ephoto Dam Field in progress

parent ef892294
......@@ -88,16 +88,14 @@
this.ephoto.connect();
this.ephoto.File.callOnFileReceived(this.getUrl.bind(this));
this.ephoto.File.enableDCore();
this.ephoto.File.enableDCore('json');
this.ephoto.callOnConnect(function() {
let version = self.ephoto.getVersion().split('.');
// Requires API version 6.0 (Ephoto Dam 4.0)
if (version.length !==3 || version[0] < 6) {
alert(Drupal.t('The version of Ephoto Dam is not compatible with this function'));
alert(Drupal.t('The version of Ephoto Dam is not compatible with this feature'));
return;
}
......@@ -110,16 +108,16 @@
},
/**
*
* Select a file versions
*/
selectVersions: function() {
let versions = this._getFieldValues();
if (!versions) {
if (!this._getFieldValues()) {
console.log('Field selection error');
return;
}
this.ephoto.File.callOnFileReceived(this.getUrlsVersions.bind(this));
this.ephoto.File.setButtons( this.ephoto.IMAGE_FILES, [ {
'mode': 'none'
} ] );
......@@ -128,14 +126,27 @@
},
/**
* Get URL of selected file versions
*
* @param {null} None value
* @param {object} DublinCore values
*/
getUrlsVersions: function() {
var version_support = this.settings.version_support === '1';
getUrlsVersions: function(empty, dcore) {
//var version_support = this.settings.version_support === '1';
if (dcore === 'fileDoesNotExist') {
console.log('File does not exist');
return;
}
let versions = this._getFieldValues();
let id = parseInt(dcore['dc:identifier'], 10);
console.log(id);
console.log(versions);
},
/**
* Select file
* Select a file
*
* @param {number} Field index
*/
......@@ -151,6 +162,8 @@
if (size === '' || size === 0) return;
this.ephoto.File.callOnFileReceived(this.getUrl.bind(this));
this.ephoto.File.setButtons( this.ephoto.IMAGE_FILES, [ {
'mode': 'link',
'definition': 'custom',
......
......@@ -126,3 +126,6 @@ msgstr "Prise en charge des versions"
msgid "The \"Size\" field must respect one of the following patterns: \"x{height}\", \"{width}x\", \"{width}x{height}\" or \"{width/height (detect auto)}\". Examples: \"x500\", \"500x\", \"500x500\" or \"500\"."
msgstr "Le champ \"Taille\" doit respecter un des paternes suivant : \"x{hauteur}\", \"{longueur}x\", \"{longueur}x{hauteur}\" ou \"{longueur/hauteur(auto)}\". Exemples: \"x500\", \"500x\", \"500x500\" ou \"500\"."
msgid "The version of Ephoto Dam is not compatible with this feature"
msgstr "La version d'Ephoto Dam n'est pas compatible avec cette fonctionnalité"
\ No newline at end of file
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