wip: remove prod js modules dependencies

This commit is contained in:
Florian BLOUET
2016-03-08 15:39:32 +01:00
parent cf1fd82a5b
commit b2eb3abe0d
31 changed files with 179 additions and 4430 deletions

View File

@@ -39,8 +39,11 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
$sender = $user->getDisplayName(); $sender = $user->getDisplayName();
$ret = [ $ret = [
'text' => $this->app->trans('%user% vous a envoye un %before_link% panier %after_link%', ['%user%' => $sender, '%before_link%' => '<a href="#" onclick="recordPreviewModule.openPreview(\'BASK\',1,\'' 'text' => $this->app->trans('%user% vous a envoye un %before_link% panier %after_link%', ['%user%' => $sender, '%before_link%' => '<a href="#"
. $data['ssel_id'] . '\');return false;">', '%after_link%' => '</a>']) data-kind="BASK"
data-position="1"
data-id="'. $data['ssel_id'] . '"
class="open-preview-action">', '%after_link%' => '</a>'])
, 'class' => ($unread == 1 ? 'reload_baskets' : '') , 'class' => ($unread == 1 ? 'reload_baskets' : '')
]; ];

View File

@@ -53,8 +53,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
$basket_name = $this->app->trans('Une selection'); $basket_name = $this->app->trans('Une selection');
} }
$bask_link = '<a href="#" onclick="recordPreviewModule.openPreview(\'BASK\',1,\'' $bask_link = '<a href="#" data-kind="BASK" data-position="1" data-id="'. $ssel_id . '" class="open-preview-action">'
. $ssel_id . '\');return false;">'
. $basket_name . '</a>'; . $basket_name . '</a>';
$ret = [ $ret = [

View File

@@ -73,7 +73,7 @@ gulp.task('build-prod-js', function(){
config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js', config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js',
config.paths.vendors + 'jquery-file-upload/js/jquery.fileupload.js', config.paths.vendors + 'jquery-file-upload/js/jquery.fileupload.js',
config.paths.vendors + 'geonames-server-jquery-plugin/jquery.geonames.js', config.paths.vendors + 'geonames-server-jquery-plugin/jquery.geonames.js',
config.paths.src + 'prod/js/core/lists.js', //config.paths.src + 'prod/js/core/lists.js',
config.paths.src + 'prod/js/core/selectable.js', config.paths.src + 'prod/js/core/selectable.js',
config.paths.src + 'prod/js/core/alert.js', config.paths.src + 'prod/js/core/alert.js',
@@ -87,13 +87,13 @@ gulp.task('build-prod-js', function(){
// config.paths.src + 'prod/js/components/cgu.js', // config.paths.src + 'prod/js/components/cgu.js',
// config.paths.src + 'prod/js/components/preferences.js', // config.paths.src + 'prod/js/components/preferences.js',
config.paths.src + 'prod/js/components/record/editable-record.js', config.paths.src + 'prod/js/components/record/editable-record.js',
config.paths.src + 'prod/js/components/push/push.js', //config.paths.src + 'prod/js/components/push/push.js',
config.paths.src + 'prod/js/prod.js', config.paths.src + 'prod/js/prod.js',
config.paths.src + 'prod/js/components/upload/upload.js', config.paths.src + 'prod/js/components/upload/upload.js',
// config.paths.src + 'prod/js/components/video-editor.js', // config.paths.src + 'prod/js/components/video-editor.js',
config.paths.src + 'vendors/jquery-sprintf/js/jquery.sprintf.1.0.3.js', config.paths.src + 'vendors/jquery-sprintf/js/jquery.sprintf.1.0.3.js',
config.paths.src + 'prod/js/components/preview/preview.js', //config.paths.src + 'prod/js/components/preview/preview.js',
config.paths.src + 'prod/js/components/editor/record-editor.js', //config.paths.src + 'prod/js/components/editor/record-editor.js',
config.paths.src + 'prod/js/jquery.color.animation.js', config.paths.src + 'prod/js/jquery.color.animation.js',
config.paths.src + 'vendors/jquery-image-enhancer/js/jquery.image_enhancer.js', config.paths.src + 'vendors/jquery-image-enhancer/js/jquery.image_enhancer.js',
config.paths.vendors + 'jquery-treeview/jquery.treeview.js', config.paths.vendors + 'jquery-treeview/jquery.treeview.js',

File diff suppressed because it is too large Load Diff

View File

@@ -1,464 +0,0 @@
// var p4 = p4 || {};
var recordPreviewModule = (function (p4) {
var prevAjax, prevAjaxrunning;
prevAjaxrunning = false;
p4.slideShow = false;
$(document).ready(function () {
$('#PREVIEWIMGDESC').tabs();
$('#PREVIEWBOX .gui_vsplitter', p4.edit.editBox).draggable({
axis: 'x',
containment: 'parent',
drag: function (event, ui) {
var x = $(ui.position.left)[0];
if (x < 330 || x > (bodySize.x - 400)) {
return false;
}
var v = $(ui.position.left)[0];
$("#PREVIEWLEFT").width(v);
$("#PREVIEWRIGHT").css("left", $(ui.position.left)[0]);
recordPreviewModule.resizePreview();
}
});
});
/**
*
* @param env
* @param pos - relative position in current page
* @param contId
* @param reload
*/
function openPreview(env, pos, contId, reload) {
if (contId == undefined)
contId = '';
var roll = 0;
var justOpen = false;
if (!p4.preview.open) {
commonModule.showOverlay();
$('#PREVIEWIMGCONT').disableSelection();
justOpen = true;
if (!( navigator.userAgent.match(/msie/i))) {
$('#PREVIEWBOX').css({
'display': 'block',
'opacity': 0
}).fadeTo(500, 1);
} else {
$('#PREVIEWBOX').css({
'display': 'block',
'opacity': 1
});
}
p4.preview.open = true;
p4.preview.nCurrent = 5;
$('#PREVIEWCURRENT, #PREVIEWOTHERSINNER, #SPANTITLE').empty();
resizePreview();
if (env == 'BASK')
roll = 1;
}
if (reload === true)
roll = 1;
$('#tooltip').css({
'display': 'none'
});
$('#PREVIEWIMGCONT').empty();
var options_serial = p4.tot_options;
var query = p4.tot_query;
var navigation = p4.navigation;
// keep relative position for answer train:
var relativePos = pos;
// update real absolute position with pagination:
var absolutePos = parseInt(navigation.perPage,10) * (parseInt(navigation.page, 10) - 1) + parseInt(pos,10);
// if comes from story, work with relative positionning
if (env == 'REG') {
// @TODO - if event comes from workzone (basket|story),
// we can use the relative position in order to display the doubleclicked records
// except we can't know the original event in this implementation
absolutePos = 0;
}
prevAjax = $.ajax({
type: "POST",
url: "../prod/records/",
dataType: 'json',
data: {
env: env,
pos: absolutePos,
cont: contId,
roll: roll,
options_serial: options_serial,
query: query
},
beforeSend: function () {
if (prevAjaxrunning)
prevAjax.abort();
if (env == 'RESULT')
$('#current_result_n').empty().append(parseInt(pos) + 1);
prevAjaxrunning = true;
$('#PREVIEWIMGDESC, #PREVIEWOTHERS').addClass('loading');
},
error: function (data) {
prevAjaxrunning = false;
$('#PREVIEWIMGDESC, #PREVIEWOTHERS').removeClass('loading');
posAsk = null;
},
timeout: function () {
prevAjaxrunning = false;
$('#PREVIEWIMGDESC, #PREVIEWOTHERS').removeClass('loading');
posAsk = null;
},
success: function (data) {
_cancelPreview();
prevAjaxrunning = false;
posAsk = null;
if (data.error) {
$('#PREVIEWIMGDESC, #PREVIEWOTHERS').removeClass('loading');
alert(data.error);
if (justOpen)
closePreview();
return;
}
posAsk = data.pos - 1;
$('#PREVIEWIMGCONT').empty().append(data.html_preview);
$('#PREVIEWIMGCONT .thumb_wrapper')
.width('100%').height('100%').image_enhance({zoomable: true});
$('#PREVIEWIMGDESCINNER').empty().append(data.desc);
$('#HISTORICOPS').empty().append(data.history);
$('#popularity').empty().append(data.popularity);
if ($('#popularity .bitly_link').length > 0) {
BitlyCB.statsResponse = function (data) {
var result = data.results;
if ($('#popularity .bitly_link_' + result.userHash).length > 0) {
$('#popularity .bitly_link_' + result.userHash).append(' (' + result.clicks + ' clicks)');
}
};
BitlyClient.stats($('#popularity .bitly_link').html(), 'BitlyCB.statsResponse');
}
p4.preview.current = {};
p4.preview.current.width = parseInt($('#PREVIEWIMGCONT input[name=width]').val());
p4.preview.current.height = parseInt($('#PREVIEWIMGCONT input[name=height]').val());
p4.preview.current.tot = data.tot;
p4.preview.current.pos = relativePos;
if ($('#PREVIEWBOX img.record.zoomable').length > 0) {
$('#PREVIEWBOX img.record.zoomable').draggable();
}
$('#SPANTITLE').empty().append(data.title);
$("#PREVIEWTITLE_COLLLOGO").empty().append(data.collection_logo);
$("#PREVIEWTITLE_COLLNAME").empty().append(data.collection_name);
_setPreview();
if (env != 'RESULT') {
if (justOpen || reload) {
_setCurrent(data.current);
}
_viewCurrent($('#PREVIEWCURRENT li.selected'));
}
else {
if (!justOpen) {
$('#PREVIEWCURRENT li.selected').removeClass('selected');
$('#PREVIEWCURRENTCONT li.current' + absolutePos).addClass('selected');
}
if (justOpen || ($('#PREVIEWCURRENTCONT li.current' + absolutePos).length === 0) || ($('#PREVIEWCURRENTCONT li:last')[0] == $('#PREVIEWCURRENTCONT li.selected')[0]) || ($('#PREVIEWCURRENTCONT li:first')[0] == $('#PREVIEWCURRENTCONT li.selected')[0])) {
_getAnswerTrain(pos, data.tools, query, options_serial);
}
_viewCurrent($('#PREVIEWCURRENT li.selected'));
}
if (env == 'REG' && $('#PREVIEWCURRENT').html() === '') {
_getRegTrain(contId, pos, data.tools);
}
_setOthers(data.others);
_setTools(data.tools);
$('#tooltip').css({
'display': 'none'
});
$('#PREVIEWIMGDESC, #PREVIEWOTHERS').removeClass('loading');
if (!justOpen || (p4.preview.mode != env))
resizePreview();
p4.preview.mode = env;
$('#EDIT_query').focus();
$('#PREVIEWOTHERSINNER .otherBaskToolTip').tooltip();
return;
}
});
}
function closePreview() {
p4.preview.open = false;
commonModule.hideOverlay();
$('#PREVIEWBOX').fadeTo(500, 0);
$('#PREVIEWBOX').queue(function () {
$(this).css({
'display': 'none'
});
_cancelPreview();
$(this).dequeue();
});
}
function startSlide() {
if (!p4.slideShow) {
p4.slideShow = true;
}
if (p4.slideShowCancel) {
p4.slideShowCancel = false;
p4.slideShow = false;
$('#start_slide').show();
$('#stop_slide').hide();
}
if (!p4.preview.open) {
p4.slideShowCancel = false;
p4.slideShow = false;
$('#start_slide').show();
$('#stop_slide').hide();
}
if (p4.slideShow) {
$('#start_slide').hide();
$('#stop_slide').show();
getNext();
setTimeout("startSlide()", 3000);
}
}
function stopSlide() {
p4.slideShowCancel = true;
$('#start_slide').show();
$('#stop_slide').hide();
}
function getNext() {
if (p4.preview.mode == 'REG' && parseInt(p4.preview.current.pos) === 0)
$('#PREVIEWCURRENTCONT li img:first').trigger("click");
else {
if (p4.preview.mode == 'RESULT') {
posAsk = parseInt(p4.preview.current.pos) + 1;
posAsk = (posAsk >= parseInt(p4.tot) || isNaN(posAsk)) ? 0 : posAsk;
recordPreviewModule.openPreview('RESULT', posAsk, '', false);
}
else {
if (!$('#PREVIEWCURRENT li.selected').is(':last-child'))
$('#PREVIEWCURRENT li.selected').next().children('img').trigger("click");
else
$('#PREVIEWCURRENT li:first-child').children('img').trigger("click");
}
}
}
function getPrevious() {
if (p4.preview.mode == 'RESULT') {
posAsk = parseInt(p4.preview.current.pos) - 1;
posAsk = (posAsk < 0) ? ((parseInt(p4.tot) - 1)) : posAsk;
recordPreviewModule.openPreview('RESULT', posAsk, '', false);
}
else {
if (!$('#PREVIEWCURRENT li.selected').is(':first-child'))
$('#PREVIEWCURRENT li.selected').prev().children('img').trigger("click");
else
$('#PREVIEWCURRENT li:last-child').children('img').trigger("click");
}
}
function _setPreview() {
if (!p4.preview.current)
return;
var zoomable = $('img.record.zoomable');
if (zoomable.length > 0 && zoomable.hasClass('zoomed'))
return;
var h = parseInt(p4.preview.current.height);
var w = parseInt(p4.preview.current.width);
var t = 20;
var de = 0;
var margX = 0;
var margY = 0;
if ($('#PREVIEWIMGCONT .record_audio').length > 0) {
margY = 100;
de = 60;
}
var ratioP = w / h;
var ratioD = parseInt(p4.preview.width) / parseInt(p4.preview.height);
if (ratioD > ratioP) {
//je regle la hauteur d'abord
if ((parseInt(h) + margY) > parseInt(p4.preview.height)) {
h = Math.round(parseInt(p4.preview.height) - margY);
w = Math.round(h * ratioP);
}
}
else {
if ((parseInt(w) + margX) > parseInt(p4.preview.width)) {
w = Math.round(parseInt(p4.preview.width) - margX);
h = Math.round(w / ratioP);
}
}
t = Math.round((parseInt(p4.preview.height) - h - de) / 2);
var l = Math.round((parseInt(p4.preview.width) - w) / 2);
$('#PREVIEWIMGCONT .record').css({
width: w,
height: h,
top: t,
left: l
}).attr('width', w).attr('height', h);
}
function _setCurrent(current) {
if (current !== '') {
var el = $('#PREVIEWCURRENT');
el.removeClass('loading').empty().append(current);
$('ul', el).width($('li', el).length * 80);
$('img.prevRegToolTip', el).tooltip();
$.each($('img.openPreview'), function (i, el) {
var jsopt = $(el).attr('jsargs').split('|');
$(el).removeAttr('jsargs');
$(el).removeClass('openPreview');
$(el).bind('click', function () {
_viewCurrent($(this).parent());
// convert abssolute to relative position
var absolutePos = jsopt[1];
var relativePos = parseInt(absolutePos, 10) - parseInt(p4.navigation.perPage, 10) * (parseInt(p4.navigation.page, 10) - 1);
// keep relative position for answer train:
recordPreviewModule.openPreview(jsopt[0], relativePos, jsopt[2],false);
});
});
}
}
function _viewCurrent(el) {
if (el.length === 0) {
return;
}
$('#PREVIEWCURRENT li.selected').removeClass('selected');
el.addClass('selected');
$('#PREVIEWCURRENTCONT').animate({'scrollLeft': ($('#PREVIEWCURRENT li.selected').position().left + $('#PREVIEWCURRENT li.selected').width() / 2 - ($('#PREVIEWCURRENTCONT').width() / 2 ))});
return;
}
function reloadPreview() {
$('#PREVIEWCURRENT li.selected img').trigger("click");
}
function _getAnswerTrain(pos, tools, query, options_serial) {
// keep relative position for answer train:
var relativePos = pos;
// update real absolute position with pagination:
var absolutePos = parseInt(p4.navigation.perPage,10) * (parseInt(p4.navigation.page, 10) - 1) + parseInt(pos,10);
$('#PREVIEWCURRENTCONT').fadeOut('fast');
$.ajax({
type: "POST",
url: "/prod/query/answer-train/",
dataType: 'json',
data: {
pos: absolutePos,
options_serial: options_serial,
query: query
},
success: function (data) {
_setCurrent(data.current);
_viewCurrent($('#PREVIEWCURRENT li.selected'));
_setTools(tools);
return;
}
});
}
function _getRegTrain(contId, pos, tools) {
$.ajax({
type: "POST",
url: "/prod/query/reg-train/",
dataType: 'json',
data: {
cont: contId,
pos: pos
},
success: function (data) {
_setCurrent(data.current);
_viewCurrent($('#PREVIEWCURRENT li.selected'));
if (typeof(tools) != 'undefined')
_setTools(tools);
return;
}
});
}
function _cancelPreview() {
$('#PREVIEWIMGDESCINNER').empty();
$('#PREVIEWIMGCONT').empty();
p4.preview.current = false;
}
function _setOthers(others) {
$('#PREVIEWOTHERSINNER').empty();
if (others !== '') {
$('#PREVIEWOTHERSINNER').append(others);
$('#PREVIEWOTHERS table.otherRegToolTip').tooltip();
}
}
function _setTools(tools) {
$('#PREVIEWTOOL').empty().append(tools);
if (!p4.slideShowCancel && p4.slideShow) {
$('#start_slide').hide();
$('#stop_slide').show();
} else {
$('#start_slide').show();
$('#stop_slide').hide();
}
}
function resizePreview() {
p4.preview.height = $('#PREVIEWIMGCONT').height();
p4.preview.width = $('#PREVIEWIMGCONT').width();
_setPreview();
}
return {
openPreview: openPreview,
closePreview: closePreview,
startSlide: startSlide,
stopSlide: stopSlide,
getNext: getNext,
getPrevious: getPrevious,
reloadPreview: reloadPreview,
resizePreview: resizePreview
}
})(p4);

View File

@@ -1,708 +0,0 @@
var pushModule = (function (window, p4) {
var Feedback = function ($container, context) {
this.container = $($container);
this.Context = context;
this.selection = new Selectable(
$('.user_content .badges', this.container),
{
selector: '.badge'
}
);
var $this = this;
this.container.on('click', '.content .options .select-all', function (event) {
$this.selection.selectAll();
});
this.container.on('click', '.content .options .unselect-all', function (event) {
$this.selection.empty();
});
$('.UserTips', this.container).tooltip();
this.container.on('click', 'a.user_adder', function (event) {
var $this = $(this);
$.ajax({
type: "GET",
url: $this.attr('href'),
dataType: 'html',
beforeSend: function () {
var options = {
size: 'Medium',
title: $this.html()
};
dialogModule.dialog.create(options, 2).getDomElement().addClass('loading');
},
success: function (data) {
dialogModule.dialog.get(2).getDomElement().removeClass('loading').empty().append(data);
return;
},
error: function () {
dialogModule.dialog.get(2).close();
return;
},
timeout: function () {
dialogModule.dialog.get(2).close();
return;
}
});
return false;
});
this.container.on('click', '.recommended_users', function (event) {
var usr_id = $('input[name="usr_id"]', $(this)).val();
$this.loadUser(usr_id, $this.selectUser);
return false;
});
this.container.on('click', '.recommended_users_list', function (event) {
var content = $('#push_user_recommendations').html();
var options = {
size: 'Small',
title: $(this).attr('title')
};
$dialog = dialogModule.dialog.create(options, 2);
$dialog.setContent(content);
$dialog.getDomElement().find('a.adder').bind('click', function () {
$(this).addClass('added');
var usr_id = $(this).closest('tr').find('input[name="usr_id"]').val();
$this.loadUser(usr_id, $this.selectUser);
return false;
});
$dialog.getDomElement().find('a.adder').each(function (i, el) {
var usr_id = $(this).closest('tr').find('input[name="usr_id"]').val();
if ($('.badge_' + usr_id, $this.container).length > 0) {
$(this).addClass('added');
}
});
return false;
});
//this.container.on('submit', '#PushBox form[name="FeedBackForm"]', function (event) {
$('#PushBox form[name="FeedBackForm"]').bind('submit', function () {
var $this = $(this);
$.ajax({
type: $this.attr('method'),
url: $this.attr('action'),
dataType: 'json',
data: $this.serializeArray(),
beforeSend: function () {
},
success: function (data) {
if (data.success) {
humane.info(data.message);
dialogModule.dialog.close(1);
p4.WorkZone.refresh();
}
else {
humane.error(data.message);
}
return;
},
error: function () {
return;
},
timeout: function () {
return;
}
});
return false;
});
$('.FeedbackSend', this.container).bind('click', function () {
if ($('.badges .badge', $container).length === 0) {
alert(language.FeedBackNoUsersSelected);
return;
}
var buttons = {};
buttons[language.send] = function () {
if ($.trim($('input[name="name"]', $dialog.getDomElement()).val()) === '') {
var options = {
size: 'Alert',
closeButton: true,
title: language.warning
}
var $dialogAlert = dialogModule.dialog.create(options, 3);
$dialogAlert.setContent(language.FeedBackNameMandatory);
return false;
}
$dialog.close();
$('input[name="name"]', $FeedBackForm).val($('input[name="name"]', $dialog.getDomElement()).val());
$('input[name="duration"]', $FeedBackForm).val($('select[name="duration"]', $dialog.getDomElement()).val());
$('textarea[name="message"]', $FeedBackForm).val($('textarea[name="message"]', $dialog.getDomElement()).val());
$('input[name="recept"]', $FeedBackForm).prop('checked', $('input[name="recept"]', $dialog.getDomElement()).prop('checked'));
$('input[name="force_authentication"]', $FeedBackForm).prop('checked', $('input[name="force_authentication"]', $dialog.getDomElement()).prop('checked'));
$FeedBackForm.trigger('submit');
};
var options = {
size: 'Medium',
buttons: buttons,
loading: true,
title: language.send,
closeOnEscape: true,
cancelButton: true
};
var $dialog = dialogModule.dialog.create(options, 2);
var $FeedBackForm = $('form[name="FeedBackForm"]', $container);
var html = _.template($("#feedback_sendform_tpl").html());
$dialog.setContent(html);
$('input[name="name"]', $dialog.getDomElement()).val($('input[name="name"]', $FeedBackForm).val());
$('textarea[name="message"]', $dialog.getDomElement()).val($('textarea[name="message"]', $FeedBackForm).val());
$('.' + $this.Context, $dialog.getDomElement()).show();
$('form', $dialog.getDomElement()).submit(function () {
return false;
});
});
$('.user_content .badges', this.container).disableSelection();
// toggle download feature for users
this.container.on('click', '.user_content .badges .badge .toggle', function (event) {
var $this = $(this);
$this.toggleClass('status_off status_on');
$this.find('input').val($this.hasClass('status_on') ? '1' : '0');
return false;
});
// toggle feature state of selected users
this.container.on('click', '.general_togglers .general_toggler', function (event) {
var feature = $(this).attr('feature');
var $badges = $('.user_content .badge.selected', this.container);
var toggles = $('.status_off.toggle_' + feature, $badges);
if (toggles.length === 0) {
var toggles = $('.status_on.toggle_' + feature, $badges);
}
if (toggles.length === 0) {
humane.info('No user selected');
}
toggles.trigger('click');
return false;
});
this.container.on('click', '.user_content .badges .badge .deleter', function (event) {
var $elem = $(this).closest('.badge');
$elem.fadeOut(function () {
$elem.remove();
});
return false;
});
this.container.on('click', '.list_manager', function (event) {
$('#PushBox').hide();
$('#ListManager').show();
return false;
});
this.container.on('click', 'a.list_loader', function (event) {
var url = $(this).attr('href');
var callbackList = function (list) {
for (var i in list.entries) {
this.selectUser(list.entries[i].User);
}
};
$this.loadList(url, callbackList);
return false;
});
$('form.list_saver', this.container).bind('submit', function () {
var $form = $(this);
var $input = $('input[name="name"]', $form);
var users = p4.Feedback.getUsers();
if (users.length === 0) {
humane.error('No users');
return false;
}
p4.Lists.create($input.val(), function (list) {
$input.val('');
list.addUsers(users);
});
return false;
});
$('input[name="users-search"]', this.container).autocomplete({
minLength: 2,
source: function (request, response) {
$.ajax({
url: '/prod/push/search-user/',
dataType: "json",
data: {
query: request.term
},
success: function (data) {
response(data);
}
});
},
focus: function (event, ui) {
$('input[name="users-search"]').val(ui.item.label);
},
select: function (event, ui) {
if (ui.item.type === 'USER') {
$this.selectUser(ui.item);
} else if (ui.item.type === 'LIST') {
for (var e in ui.item.entries) {
$this.selectUser(ui.item.entries[e].User);
}
}
return false;
}
})
.data("ui-autocomplete")._renderItem = function (ul, item) {
var html = "";
if (item.type === 'USER') {
html = _.template($("#list_user_tpl").html(), {
item: item
});
} else if (item.type === 'LIST') {
html = _.template($("#list_list_tpl").html(), {
item: item
});
}
return $(html).data("ui-autocomplete-item", item).appendTo(ul);
};
return this;
};
Feedback.prototype = {
selectUser: function (user) {
if (typeof user !== 'object') {
if (window.console) {
console.log('trying to select a user with wrong datas');
}
}
if ($('.badge_' + user.usr_id, this.container).length > 0) {
humane.info('User already selected');
return;
}
var html = _.template($("#" + this.Context.toLowerCase() + "_badge_tpl").html(), {
user: user
});
p4.Feedback.appendBadge(html);
},
loadUser: function (usr_id, callback) {
var $this = this;
$.ajax({
type: 'GET',
url: '/prod/push/user/' + usr_id + '/',
dataType: 'json',
data: {
usr_id: usr_id
},
success: function (data) {
if (typeof callback === 'function') {
callback.call($this, data);
}
}
});
},
loadList: function (url, callback) {
var $this = this;
$.ajax({
type: 'GET',
url: url,
dataType: 'json',
success: function (data) {
if (typeof callback === 'function') {
callback.call($this, data);
}
}
});
},
appendBadge: function (badge) {
$('.user_content .badges', this.container).append(badge);
},
addUser: function ($form, callback) {
var $this = this;
$.ajax({
type: 'POST',
url: '/prod/push/add-user/',
dataType: 'json',
data: $form.serializeArray(),
success: function (data) {
if (data.success) {
humane.info(data.message);
$this.selectUser(data.user);
callback();
}
else {
humane.error(data.message);
}
}
});
},
getSelection: function () {
return this.selection;
},
getUsers: function () {
return $('.user_content .badge', this.container).map(function () {
return $('input[name="id"]', $(this)).val();
});
}
};
var ListManager = function ($container) {
this.list = null;
this.container = $container;
$container.on('click', '.back_link', function() {
$('#PushBox').show();
$('#ListManager').hide();
return false;
});
$container.on('click', 'a.list_sharer', function() {
var $this = $(this),
options = {
size: 'Small',
closeButton: true,
title: $this.attr('title')
},
$dialog = dialogModule.dialog.create(options, 2);
$dialog.load($this.attr('href'), 'GET');
return false;
});
$container.on('click', 'a.user_adder', function() {
var $this = $(this);
$.ajax({
type: "GET",
url: $this.attr('href'),
dataType: 'html',
beforeSend: function () {
var options = {
size: 'Medium',
title: $this.html()
};
dialogModule.dialog.create(options, 2).getDomElement().addClass('loading');
},
success: function (data) {
dialogModule.dialog.get(2).getDomElement().removeClass('loading').empty().append(data);
return;
},
error: function () {
dialogModule.dialog.get(2).close();
return;
},
timeout: function () {
dialogModule.dialog.get(2).close();
return;
}
});
return false;
});
var initLeft = function () {
$('a.list_refresh', $container).bind('click', function (event) {
var callback = function (datas) {
$('.all-lists', $container).removeClass('loading').append(datas);
initLeft();
};
$('.all-lists', $container).empty().addClass('loading');
p4.Lists.get(callback, 'html');
return false;
});
$('a.list_adder', $container).bind('click', function (event) {
var makeDialog = function (box) {
var buttons = {};
buttons[language.valider] = function () {
var callbackOK = function () {
$('a.list_refresh', $container).trigger('click');
dialogModule.dialog.get(2).close();
};
var name = $('input[name="name"]', dialogModule.dialog.get(2).getDomElement()).val();
if ($.trim(name) === '') {
alert(language.listNameCannotBeEmpty);
return;
}
p4.Lists.create(name, callbackOK);
};
var options = {
cancelButton: true,
buttons: buttons,
size: '700x170'
};
dialogModule.dialog.create(options, 2).setContent(box);
};
var html = _.template($("#list_editor_dialog_add_tpl").html());
makeDialog(html);
return false;
});
$('li.list a.list_link', $container).bind('click', function (event) {
var $this = $(this);
$this.closest('.lists').find('.list.selected').removeClass('selected');
$this.parent('li.list').addClass('selected');
$.ajax({
type: 'GET',
url: $this.attr('href'),
dataType: 'html',
success: function (data) {
$('.editor', $container).removeClass('loading').append(data);
initRight();
},
beforeSend: function () {
$('.editor', $container).empty().addClass('loading');
}
});
return false;
});
};
var initRight = function () {
var $container = $('#ListManager .editor');
$('form[name="list-editor-search"]', $container).bind('submit', function () {
var $this = $(this);
var dest = $('.list-editor-results', $container);
$.ajax({
url: $this.attr('action'),
type: $this.attr('method'),
dataType: "html",
data: $this.serializeArray(),
beforeSend: function () {
dest.empty().addClass('loading');
},
success: function (datas) {
dest.empty().removeClass('loading').append(datas);
}
});
return false;
});
$('form[name="list-editor-search"] select, form[name="list-editor-search"] input[name="ListUser"]', $container).bind('change', function () {
$(this).closest('form').trigger('submit');
});
$('.EditToggle', $container).bind('click', function () {
$('.content.readonly, .content.readwrite', $('#ListManager')).toggle();
return false;
});
$('.Refresher', $container).bind('click', function () {
$('#ListManager ul.lists .list.selected a').trigger('click');
return false;
});
$('form[name="SaveName"]', $container).bind('submit', function () {
var $this = $(this);
$.ajax({
type: $this.attr('method'),
url: $this.attr('action'),
dataType: 'json',
data: $this.serializeArray(),
beforeSend: function () {
},
success: function (data) {
if (data.success) {
humane.info(data.message);
$('#ListManager .lists .list_refresh').trigger('click');
}
else {
humane.error(data.message);
}
return;
},
error: function () {
return;
},
timeout: function () {
return;
}
});
return false;
});
$('button.deleter', $container).bind('click', function (event) {
var list_id = $(this).data("list-id");
var makeDialog = function (box) {
var buttons = {};
buttons[language.valider] = function () {
var callbackOK = function () {
$('#ListManager .all-lists a.list_refresh').trigger('click');
dialogModule.dialog.get(2).close();
};
var List = new document.List(list_id);
List.remove(callbackOK);
};
var options = {
cancelButton: true,
buttons: buttons,
size: 'Alert'
};
dialogModule.dialog.create(options, 2).setContent(box);
};
var html = _.template($("#list_editor_dialog_delete_tpl").html());
makeDialog(html);
return false;
});
};
initLeft();
$('.badges a.deleter', this.container).on('click', function () {
var badge = $(this).closest('.badge');
var usr_id = badge.find('input[name="id"]').val();
var callback = function (list, datas) {
$('.counter.current, .list.selected .counter', $('#ListManager')).each(function () {
$(this).text(parseInt($(this).text()) - 1);
});
badge.remove();
};
p4.ListManager.getList().removeUser(usr_id, callback);
return false;
});
};
ListManager.prototype = {
workOn: function (list_id) {
this.list = new document.List(list_id);
},
getList: function () {
return this.list;
},
appendBadge: function (datas) {
$('#ListManager .badges').append(datas);
}
};
function reloadBridge(url) {
var options = $('#dialog_publicator form[name="current_datas"]').serializeArray();
var dialog = dialogModule.dialog.get(1);
dialog.load(url, 'POST', options);
}
// instance wil be stored in p4.Feedback
return {
Feedback: Feedback,
ListManager: ListManager,
reloadBridge: reloadBridge
}
}(window, p4));

View File

@@ -1,253 +0,0 @@
var p4 = p4 || {};
(function (window, p4, $) {
var Lists = function () {
};
var List = function (id) {
if (parseInt(id) <= 0) {
throw 'Invalid list id';
}
this.id = id;
};
Lists.prototype = {
create: function (name, callback) {
var $this = this;
$.ajax({
type: 'POST',
url: '/prod/lists/list/',
dataType: 'json',
data: {name: name},
success: function (data) {
if (data.success) {
humane.info(data.message);
if (typeof callback === 'function') {
var list = new List(data.list_id);
callback(list);
}
}
else {
humane.error(data.message);
}
}
});
},
get: function (callback, type) {
var $this = this;
type = typeof type === 'undefined' ? 'json' : type;
$.ajax({
type: 'GET',
url: '/prod/lists/all/',
dataType: type,
data: {},
success: function (data) {
if (type == 'json') {
if (data.success) {
humane.info(data.message);
if (typeof callback === 'function') {
callback(data.result);
}
}
else {
humane.error(data.message);
}
}
else {
if (typeof callback === 'function') {
callback(data);
}
}
}
});
}
}
List.prototype = {
addUsers: function (arrayUsers, callback) {
if (!arrayUsers instanceof Array) {
throw 'addUsers takes array as argument';
}
var $this = this;
var data = {usr_ids: $(arrayUsers).toArray()};
$.ajax({
type: 'POST',
url: '/prod/lists/list/' + $this.id + '/add/',
dataType: 'json',
data: data,
success: function (data) {
if (data.success) {
humane.info(data.message);
if (typeof callback === 'function') {
callback($this, data);
}
}
else {
humane.error(data.message);
}
}
});
},
addUser: function (usr_id, callback) {
this.addUsers([usr_id], callback);
},
remove: function (callback) {
var $this = this;
$.ajax({
type: 'POST',
url: '/prod/lists/list/' + this.id + '/delete/',
dataType: 'json',
data: {},
success: function (data) {
if (data.success) {
humane.info(data.message);
if (typeof callback === 'function') {
callback($this);
}
}
else {
humane.error(data.message);
}
}
});
},
update: function (name, callback) {
var $this = this;
$.ajax({
type: 'POST',
url: '/prod/lists/list/' + this.id + '/update/',
dataType: 'json',
data: { name: name },
success: function (data) {
if (data.success) {
humane.info(data.message);
if (typeof callback === 'function') {
callback($this);
}
}
else {
humane.error(data.message);
}
}
});
},
removeUser: function (usr_id, callback) {
var $this = this;
$.ajax({
type: 'POST',
url: '/prod/lists/list/' + this.id + '/remove/' + usr_id + '/',
dataType: 'json',
data: {},
success: function (data) {
if (data.success) {
humane.info(data.message);
if (typeof callback === 'function') {
callback($this, data);
}
}
else {
humane.error(data.message);
}
}
});
},
shareWith: function (usr_id, role, callback) {
var $this = this;
$.ajax({
type: 'POST',
url: '/prod/lists/list/' + this.id + '/share/' + usr_id + '/',
dataType: 'json',
data: {role: role},
success: function (data) {
if (data.success) {
humane.info(data.message);
if (typeof callback === 'function') {
callback($this);
}
}
else {
humane.error(data.message);
}
}
});
},
unshareWith: function (callback) {
var $this = this;
$.ajax({
type: 'POST',
url: '/prod/lists/list/' + this.id + '/unshare/' + usr_id + '/',
dataType: 'json',
data: {},
success: function (data) {
if (data.success) {
humane.info(data.message);
if (typeof callback === 'function') {
callback($this);
}
}
else {
humane.error(data.message);
}
}
});
},
get: function (callback) {
var $this = this;
$.ajax({
type: 'GET',
url: '/prod/lists/list/' + this.id + '/',
dataType: 'json',
data: {},
success: function (data) {
if (data.success) {
humane.info(data.message);
if (typeof callback === 'function') {
callback($this, data);
}
}
else {
humane.error(data.message);
}
}
});
}
}
p4.Lists = new Lists();
document.List = List;
})(document, p4, jQuery);

View File

@@ -23,72 +23,6 @@ var prodModule = (function (p4, humane) {
}; };
p4.active_zone = false; p4.active_zone = false;
/*function _resizeAll() {
var body = $('body');
bodySize.y = body.height();
bodySize.x = body.width();
var headBlockH = $('#headBlock').outerHeight();
var bodyY = bodySize.y - headBlockH - 2;
var bodyW = bodySize.x - 2;
//$('#desktop').height(bodyY).width(bodyW);
if (p4.preview.open)
recordPreviewModule.resizePreview();
if ($('#idFrameC').data('ui-resizable')) {
$('#idFrameC').resizable('option', 'maxWidth', (480));
$('#idFrameC').resizable('option', 'minWidth', 300);
}
answerSizer();
linearizeUi();
}
function answerSizer() {
var el = $('#idFrameC').outerWidth();
if (!$.support.cssFloat) {
// $('#idFrameC .insidebloc').width(el - 56);
}
var widthA = Math.round(bodySize.x - el - 10);
$('#rightFrame').width(widthA);
$('#rightFrame').css('left', $('#idFrameC').width());
}
function linearizeUi() {
var list = $('#answers .list');
if (list.length > 0) {
var fllWidth = $('#answers').innerWidth();
fllWidth -= 16;
var stdWidth = 460;
var diff = 28;
var n = Math.round(fllWidth / (stdWidth));
var w = Math.floor(fllWidth / n) - diff;
if (w < 360 && n > 1)
w = Math.floor(fllWidth / (n - 1)) - diff;
$('#answers .list').width(w);
}
else {
var minMargin = 5;
var margin = 0;
var el = $('#answers .diapo:first');
var diapoWidth = el.outerWidth() + (minMargin * 2);
var fllWidth = $('#answers').innerWidth();
fllWidth -= 26;
var n = Math.floor(fllWidth / (diapoWidth));
margin = Math.floor((fllWidth % diapoWidth) / (2 * n));
margin = margin + minMargin;
$('#answers .diapo').css('margin', '5px ' + (margin) + 'px');
}
}*/
function doSpecialSearch(qry, allbase) { function doSpecialSearch(qry, allbase) {
if (allbase) { if (allbase) {
prodApp.appEvents.emit('search.doToggleDatabase', true); prodApp.appEvents.emit('search.doToggleDatabase', true);
@@ -108,7 +42,7 @@ var prodModule = (function (p4, humane) {
p4.WorkZone.removeElementFromBasket(el, confirm); p4.WorkZone.removeElementFromBasket(el, confirm);
} }
function openRecordEditor(type, value) { /*function openRecordEditor(type, value) {
$('#idFrameE').empty().addClass('loading'); $('#idFrameE').empty().addClass('loading');
commonModule.showOverlay(2); commonModule.showOverlay(2);
@@ -154,171 +88,9 @@ var prodModule = (function (p4, humane) {
}); });
return; return;
} }*/
function openShareModal(bas, rec) {
var dialog = dialogModule.dialog.create({
title: language['share']
});
dialog.load("../prod/share/record/" + bas + "/" + rec + "/", "GET");
}
function openPrintModal(value) {
_onOpenPrintModal("lst=" + value);
}
function _onOpenPrintModal(value) {
if ($("#DIALOG").data("ui-dialog")) {
$("#DIALOG").dialog('destroy');
}
$('#DIALOG').attr('title', language.print)
.empty().addClass('loading')
.dialog({
resizable: false,
closeOnEscape: true,
modal: true,
width: '800',
height: '500',
open: function (event, ui) {
$(this).dialog("widget").css("z-index", "1999");
},
close: function (event, ui) {
$(this).dialog("widget").css("z-index", "auto");
}
})
.dialog('open');
$.ajax({
type: "POST",
url: '../prod/printer/?' + value,
dataType: 'html',
beforeSend: function () {
},
success: function (data) {
$('#DIALOG').removeClass('loading').empty()
.append(data);
return;
}
});
}
function openToolModal(datas, activeTab) {
var dialog = dialogModule.dialog.create({
size: 'Medium',
title: language.toolbox,
loading: true
});
$.get("../prod/tools/"
, datas
, function (data) {
dialog.setContent(data);
dialog.setOption('contextArgs', datas);
var tabs = $('.tabs', dialog.getDomElement()).tabs();
// activate tab if exists:
if( activeTab !== undefined ) {
tabs.tabs('option', 'active', activeTab);
}
return;
}
);
}
function openDownloadModal(value, key) {
if( key !== undefined ) {
value = key+'='+value
}
_onOpenDownloadModal(value);
}
// @TODO duplicate with external module
function _onOpenDownloadModal(datas) {
var dialog = dialogModule.dialog.create({title: language['export']});
$.post("../prod/export/multi-export/", datas, function (data) {
dialog.setContent(data);
$('.tabs', dialog.getDomElement()).tabs();
$('.close_button', dialog.getDomElement()).bind('click', function () {
dialog.close();
});
return false;
});
}
function deleteConfirmation(type, el) {
el = $(el);
switch (type) {
case "IMGT":
case "CHIM":
var lst = '';
if (type === 'IMGT')
lst = p4.Results.Selection.serialize();
if (type === 'CHIM')
lst = p4.WorkZone.Selection.serialize();
_deleteRecords(lst);
return;
break;
case "SSTT":
var buttons = {};
buttons[language.valider] = function (e) {
prodApp.appEvents.emit('baskets.doDeleteBasket', el);
};
$('#DIALOG').empty().append(language.confirmDel).attr('title', language.attention).dialog({
autoOpen: false,
resizable: false,
modal: true,
draggable: false
}).dialog('open').dialog('option', 'buttons', buttons);
$('#tooltip').hide();
return;
break;
case "STORY":
lst = el.val();
_deleteRecords(lst);
break;
}
}
function _deleteRecords(lst) {
if (lst.split(';').length === 0) {
alert(language.nodocselected);
return false;
}
var $dialog = dialogModule.dialog.create({
size: 'Small',
title: language.deleteRecords
});
$.ajax({
type: "POST",
url: "../prod/records/delete/what/",
dataType: 'html',
data: {lst: lst},
success: function (data) {
$dialog.setContent(data);
}
});
return false;
}
function toggleTopic(id) { function toggleTopic(id) {
var o = $('#TOPIC_UL' + id); var o = $('#TOPIC_UL' + id);
@@ -328,119 +100,7 @@ var prodModule = (function (p4, humane) {
$('#TOPIC_TRI' + id + ' ,#TOPIC_UL' + id).removeClass('opened').addClass('closed'); $('#TOPIC_TRI' + id + ' ,#TOPIC_UL' + id).removeClass('opened').addClass('closed');
} }
function _triggerShortcuts() {
$('#keyboard-stop').bind('click', function () {
var display = $(this).get(0).checked ? '0' : '1';
userModule.setPref('keyboard_infos', display);
});
var buttons = {};
buttons[language.fermer] = function () {
$("#keyboard-dialog").dialog('close');
};
$('#keyboard-dialog').dialog({
closeOnEscape: false,
resizable: false,
draggable: false,
modal: true,
width: 600,
height: 400,
overlay: {
backgroundColor: '#000',
opacity: 0.7
},
open: function (event, ui) {
$(this).dialog("widget").css("z-index", "1400");
},
close: function () {
$(this).dialog("widget").css("z-index", "auto");
if ($('#keyboard-stop').get(0).checked) {
var dialog = $('#keyboard-dialog');
if (dialog.data("ui-dialog")) {
dialog.dialog('destroy');
}
dialog.remove();
}
}
}).dialog('option', 'buttons', buttons).dialog('open');
$('#keyboard-dialog').scrollTop(0);
return false;
}
function _answerSelector(el) {
if (el.hasClass('all_selector')) {
p4.Results.Selection.selectAll();
}
else {
if (el.hasClass('none_selector')) {
p4.Results.Selection.empty();
}
else {
if (el.hasClass('starred_selector')) {
}
else {
if (el.hasClass('video_selector')) {
p4.Results.Selection.empty();
p4.Results.Selection.select('.type-video');
}
else {
if (el.hasClass('image_selector')) {
p4.Results.Selection.empty();
p4.Results.Selection.select('.type-image');
}
else {
if (el.hasClass('document_selector')) {
p4.Results.Selection.empty();
p4.Results.Selection.select('.type-document');
}
else {
if (el.hasClass('audio_selector')) {
p4.Results.Selection.empty();
p4.Results.Selection.select('.type-audio');
}
}
}
}
}
}
}
}
/*function _saveWindows() {
var key = '';
var value = '';
if ($('#idFrameE').is(':visible') && $('#EDITWINDOW').is(':visible')) {
key = 'edit_window';
value = $('#idFrameE').outerWidth() / $('#EDITWINDOW').innerWidth();
}
else {
key = 'search_window';
value = $('#idFrameC').outerWidth() / bodySize.x;
}
userModule.setPref(key, value);
}
*/
return { return {
openRecordEditor: openRecordEditor,
openPrintModal: openPrintModal,
openShareModal: openShareModal,
openToolModal: openToolModal,
openDownloadModal: openDownloadModal,
deleteConfirmation: deleteConfirmation,
doSpecialSearch: doSpecialSearch, doSpecialSearch: doSpecialSearch,
addToBasket: addToBasket, addToBasket: addToBasket,
removeFromBasket: removeFromBasket, removeFromBasket: removeFromBasket,

View File

@@ -44,14 +44,14 @@
<td> <td>
<div class="context-menu context-menu-theme-vista"> <div class="context-menu context-menu-theme-vista">
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner export-record-action"
onclick="prodModule.openDownloadModal('ssel={{basket.getId()}}');">{{ 'action::exporter' | trans }} data-kind="basket" data-id="{{basket.getId()}}">{{ 'action::exporter' | trans }}
</div> </div>
</div> </div>
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
<div title="" class="context-menu-item menu3-custom-item"> <div title="" class="context-menu-item menu3-custom-item">
<div onclick="prodModule.openRecordEditor('SSTT','{{basket.getId()}}');" style="" <div data-kind="basket" data-id="{{basket.getId()}}"
class="context-menu-item-inner">{{ 'edit' | trans }} class="context-menu-item-inner edit-record-action">{{ 'edit' | trans }}
</div> </div>
</div> </div>
{% endif %} {% endif %}
@@ -138,8 +138,8 @@
<td> <td>
<div class="context-menu context-menu-theme-vista"> <div class="context-menu context-menu-theme-vista">
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner export-record-action"
onclick="prodModule.openDownloadModal('ssel={{basket.getId()}}');">{{ 'action::exporter' | trans }} data-kind="basket" data-id="{{basket.getId()}}">{{ 'action::exporter' | trans }}
</div> </div>
</div> </div>
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
@@ -166,14 +166,12 @@
{% endif %} {% endif %}
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner archive-basket-action" data-basket-id="{{ basket.getId() }}" >
onclick="prodApp.appEvents.emit('baskets.doArchiveBasket', {{ basket.getId() }});return false;">
{{ 'Archive' | trans }} {{ 'Archive' | trans }}
</div> </div>
</div> </div>
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" id="SSTTREMOVER_{{basket.getId()}}" <div class="context-menu-item-inner delete-basket-action" id="SSTTREMOVER_{{basket.getId()}}" data-context="SSTT">
onclick="prodModule.deleteConfirmation('SSTT',this);return false;">
{{ 'action : supprimer' | trans }} {{ 'action : supprimer' | trans }}
</div> </div>
</div> </div>
@@ -226,14 +224,15 @@
<td> <td>
<div class="context-menu context-menu-theme-vista"> <div class="context-menu context-menu-theme-vista">
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner export-record-action"
onclick="prodModule.openDownloadModal('lst={{story.getRecord(app).get_serialize_key()}}');">{{ 'action::exporter' | trans }} data-kind="record" data-id="{{story.getRecord(app).get_serialize_key()}}">{{ 'action::exporter' | trans }}
</div> </div>
</div> </div>
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
<div title="" class="context-menu-item menu3-custom-item"> <div title="" class="context-menu-item menu3-custom-item">
<div onclick="prodModule.openRecordEditor('IMGT','{{story.getRecord(app).get_serialize_key()}}');" style="" <div class="context-menu-item-inner edit-record-action"
class="context-menu-item-inner">{{ 'action::editer' | trans }} data-kind="record" data-id="{{story.getRecord(app).get_serialize_key()}}"
>{{ 'action::editer' | trans }}
</div> </div>
</div> </div>
{% endif %} {% endif %}
@@ -277,8 +276,11 @@
{% import 'common/thumbnail.html.twig' as thumbnail %} {% import 'common/thumbnail.html.twig' as thumbnail %}
<div ondblclick="{% if wz_scope == 'groupings' %}recordPreviewModule.openPreview('REG',{{ ord }},'{{container.get_sbas_id()}}_{{container.get_record_id()}}');{% else %}recordPreviewModule.openPreview('BASK',{{ ord }},{{container.getId()}});{% endif %}" <div class="CHIM diapo CHIM_{{record.get_serialize_key()}} open-preview-action"
class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;" data-kind="{% if wz_scope == 'groupings' %}REG{% else %}BASK{% endif %}"
data-position="{{ ord }}"
data-id="{% if wz_scope == 'groupings' %}{{container.get_sbas_id()}}_{{container.get_record_id()}}{% else %}{{container.getId()}}{% endif %}"
style="height:{{box_height}}px;"
id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}"> id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}">
<input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/> <input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/>
{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_title_display') == '1' %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_title_display') == '1' %}

View File

@@ -3,7 +3,8 @@
{% if error_message is empty %} {% if error_message is empty %}
<script type="text/javascript"> <script type="text/javascript">
window.opener.pushModule.reloadBridge("{{ path("prod_bridge_manager") }}"); window.opener.prodApp.appEvents.emit('push.reload',{{ path("prod_bridge_manager") }});
// pushModule.reloadBridge("{{ path("prod_bridge_manager") }}");
window.close(); window.close();
</script> </script>

View File

@@ -84,332 +84,6 @@
{# SCRIPT - HORIZONTAL TABS #} {# SCRIPT - HORIZONTAL TABS #}
<script type ="text/javascript"> <script type ="text/javascript">
$(function() { $(function() {
var pub_tabs = $("#pub_tabs");
var container = $('#dialog_publicator');
var managerUrl = container.data("url");
function popme(url) {
var newwindow=window.open(url,'logger','height=500,width=800');
if (window.focus)
{
newwindow.focus();
}
return false;
}
function panel_load($panel)
{
$(".new_bridge_button", $panel).bind("click", function(){
var url = $(this).parent('form').find('input[name="url"]').val();
popme(url);
return false;
});
$('.error_box, .notice_box', $panel).delay(10000).fadeOut();
$('.back_link', $panel).bind('click', function(){
if ($('#pub_tabs').data("ui-tabs")) {
$('#pub_tabs').tabs('load',$('#pub_tabs').tabs('option', 'active'));
}
return false;
});
$('.bridge_action', $panel).bind('click', function(){
var $this = $(this);
$.ajax({
type : 'GET',
url : $(this).attr('href'),
beforeSend : function(){
var container = $('.container-bridge', $panel);
container.empty();
if( ! $this.hasClass('bridge_logout')) {
container.addClass('loading');
}
},
success : function(datas){
$('.container-bridge', $panel).removeClass('loading').append(datas);
panel_load($panel);
},
error:function(){
$panel.removeClass("loading");
},
timeout:function(){
$panel.removeClass("loading");
}
});
return false;
});
$(".delete-account" , $panel).bind("click", function(){
account_id = $(this).val();
var buttons = {};
buttons[language.valider] = function() {
$.ajax({
type: "POST",
dataType: "json",
url: "/prod/bridge/adapter/" + account_id + "/delete/",
data: {},
success: function(datas){
if(datas.success) {
confirmBox.close();
pushModule.reloadBridge(managerUrl);
} else {
confirmBox.close();
var alertBox = dialogModule.dialog.create({
size : 'Alert',
closeOnEscape : true,
closeButton:true
}, 2);
alertBox.setContent(datas.message);
}
}
});
};
var confirmBox = dialogModule.dialog.create({
size : 'Alert',
closeOnEscape : true,
closeButton:true,
cancelButton: true,
buttons: buttons
}, 2);
confirmBox.setContent("{{'You are about to delete this account. Would you like to continue ?'|trans|e('js') }}");
});
$('.form_submitter', $panel).bind('click', function(){
var $form = $(this).closest('form');
var method = $form.attr('method');
method = $.inArray(method.toLowerCase(), ['post', 'get']) ? method : 'POST';
$.ajax({
type : method,
url : $form.attr('action'),
data : $form.serializeArray(),
beforeSend : function(){
$panel.empty().addClass('loading');
},
success : function(datas){
$panel.removeClass('loading').append(datas);
panel_load($panel);
},
error:function(){
$panel.removeClass("loading");
},
timeout:function(){
$panel.removeClass("loading");
}
});
return false;
});
$(".bridge_all_selector", $panel).bind("click", function() {
var checkboxes = $('.bridge_element_selector', $panel);
var $this = $(this);
checkboxes.each(function(i, checkbox){
if($(checkbox).is(':checked') !== $this.is(':checked'))
{
var event = jQuery.Event("click");
event.selector_all = true;
$(checkbox).trigger(event);
}
});
});
$('.bridge_element_selector', $panel)
.bind('click', function(event){
var $this = $(this);
if(event.selector_all)
{
$this.prop('checked', $(".bridge_all_selector", $panel).is(':checked'));
}
$('form[name="bridge_selection"] input[name="elements_list"]', $panel).val(
$.makeArray($('.bridge_element_selector:checked', $panel).map(function(i, el){
return ($(el).val());
})).join(';')
);
if($this.is(':checked'))
$this.closest('.element').addClass('selected');
else
$this.closest('.element').removeClass('selected');
if(!event.selector_all)
{
var bool = !($(".bridge_element_selector:checked", $panel).length !== $(".bridge_element_selector", $panel).length);
$(".bridge_all_selector", $panel).prop('checked', bool);
}
else
{
if(event.stopPropagation)
event.stopPropagation();
return false;
}
});
$('a.form_multiple_submitter', $panel).bind('click', function(){
var $form = $(this).closest('form');
var elements = $('form[name="bridge_selection"] input[name="elements_list"]', $panel).val();
if($.trim(elements) === '')
var n_elements = 0;
else
var n_elements = elements.split(';').length;
if(n_elements === 0 && $form.hasClass('action_works_standalone') === false)
{
alert('No records selected');
return false;
}
if(n_elements === 1 && $form.hasClass('action_works_single_element') === false)
{
alert('This action works only with a single records');
return false;
}
if(n_elements > 1 && $form.hasClass('action_works_many_element') === false)
{
alert('This action works only with many records');
return false;
}
$('input[name="elements_list"]', $form).val(elements);
$.ajax({
type : 'GET',
url : $form.attr('action'),
data : $form.serializeArray(),
beforeSend : function(){
$panel.empty().addClass('loading');
},
success : function(datas){
$panel.removeClass('loading').append(datas);
panel_load($panel);
},
error:function(){
$panel.removeClass("loading");
},
timeout:function(){
$panel.removeClass("loading");
}
});
return false;
});
}
pub_tabs.tabs({
beforeLoad: function( event, ui ) {
ui.tab.html_tab = ui.tab.find('span').html();
ui.tab.find('span').html("<i>{{ 'Loading'|trans }}...</i>");
},
load: function(event, ui)
{
ui.tab.find('span').empty().append(ui.tab.html_tab);
$panel = $(ui.panel);
$('.container-bridge', $panel).removeClass('loading');
$panel.addClass("PNB");
$panel.wrapInner("<div class='PNB10 container-bridge' />");
panel_load($panel);
}
,beforeActivate: function(event, ui)
{
if($(ui.tab).hasClass('account'))
{
var container = $('.container-bridge', ui.panel);
container.empty();
$('.container', ui.panel).addClass('loading');
}
}
}).addClass('ui-tabs-vertical ui-helper-clearfix');
$('.ui-tabs-nav', pub_tabs).removeClass('ui-corner-all');
$(".new_bridge_button", pub_tabs).bind("click", function(){
var url = $(this).parent('form').find('input[name="url"]').val();
popme(url);
return false;
});
$("ul li a.account", pub_tabs).bind("click", function(){
$('#dialog_publicator form[name="current_datas"] input[name="account_id"]').val($('input[name="account_id"]', this).val());
});
$("ul li.ui-tabs-selected a.account", pub_tabs).trigger("click");
$('#publicator_selection .PNB10:first').selectable();
$('#publicator_selection button.act_upload').bind('click', function(){
var $this = $(this);
var $form = $this.closest('form');
$('input[name=lst]', $form).val(
$.makeArray(
$('#publicator_selection .diapo.ui-selected').map(function(i, el){
return $(el).attr('id').split('_').slice(2,4).join('_');
})
).join(';')
);
var account_id = $('form[name="current_datas"] input[name="account_id"]').val();
$('input[name="account_id"]', $form).val(account_id);
var $panel = $('#pub_tabs .ui-tabs-panel:visible');
$.ajax({
type : 'GET',
url : '/prod/bridge/upload/',
data : $form.serializeArray(),
beforeSend : function(){
$panel.empty().addClass('loading');
},
success : function(datas){
$panel.removeClass('loading').append(datas);
panel_load($panel);
},
error:function(){
$panel.removeClass("loading");
},
timeout:function(){
$panel.removeClass("loading");
}
});
return false;
});
$("li", pub_tabs).removeClass('ui-corner-top').addClass('ui-corner-left');
$("#api_connexion").click(function(){
if (container.data("ui-dialog")) {
container.dialog("close");
}
});
{% if route.get_count_element_received() == 0 %} {% if route.get_count_element_received() == 0 %}
alert('{{ "Vous n\'avez selectionne aucun element"|trans|e('js') }}'); alert('{{ "Vous n\'avez selectionne aucun element"|trans|e('js') }}');
if (container.data("ui-dialog")) { if (container.data("ui-dialog")) {

View File

@@ -39,7 +39,7 @@
{% endif %} {% endif %}
{% else %} {% else %}
<label>{{ 'Role' | trans }}</label> <label>{{ 'Role' | trans }}</label>
<select name="role"> <select name="role" data-list-id="{{ list.getId() }}" data-user-id="{{ owner.getUser().getId() }}">
<option {% if owner.getRole() == constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_USER') %}selected {% endif %} value="{{ constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_USER') }}"> <option {% if owner.getRole() == constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_USER') %}selected {% endif %} value="{{ constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_USER') }}">
{{ 'Access' | trans }} {{ 'Access' | trans }}
</option> </option>
@@ -54,7 +54,7 @@
</td> </td>
<td style="width:15px"> <td style="width:15px">
{% if app.getAuthenticatedUser().getId() == owner.getUser().getId() %} {% if app.getAuthenticatedUser().getId() == owner.getUser().getId() %}
<a href="#" class="deleter"> <a href="#" class="deleter listmanager-share-delete-user-action" data-list-id="{{ list.getId() }}" data-user-id="{{ owner.getUser().getId() }}">
<img src="/assets/prod/images/Push/close_badge.png" title="{{ 'Remove' | trans }}"/> <img src="/assets/prod/images/Push/close_badge.png" title="{{ 'Remove' | trans }}"/>
</a> </a>
{% endif %} {% endif %}
@@ -70,137 +70,4 @@
</div> </div>
{% include "prod/templates/push.html.twig" %} {% include "prod/templates/push.html.twig" %}
<script type="text/javascript">
$(document).ready(function(){
var $container = $('#ListShare'),
$completer_form = $('form[name="list_share_user"]', $container),
$owners_form = $('form[name="owners"]', $container),
$autocompleter = $('input[name="user"]', $completer_form),
$dialog = dialogModule.dialog.get(2); //p4.Dialog.get(2);
$completer_form.bind('submit', function(){
return false;
});
$('select[name="role"]', $owners_form).bind('change', function(){
var usr_id = $(this).closest('.owner').find('input[name="usr_id"]').val(),
role = $(this).val();
shareWith(usr_id, role);
return false;
});
$('.deleter', $container).bind('click', function(){
var owner = $(this).closest('.owner');
var usr_id = owner.find('input[name="usr_id"]').val();
unShareWith(usr_id, function(data){
owner.remove();
});
return false;
});
function shareWith(usr_id, role)
{
var role = typeof role === 'undefined' ? 1 : role;
$.ajax({
type: 'POST',
url: '/prod/lists/list/{{ list.getId() }}/share/' + usr_id + '/',
dataType: 'json',
data : {role : role},
beforeSend:function(){
},
success: function(data){
if(data.success)
{
humane.info(data.message);
}
else
{
humane.error(data.message);
}
$dialog.refresh();
return;
},
error: function(){
return;
},
timeout: function(){
return;
}
});
}
function unShareWith(usr_id, callback)
{
$.ajax({
type: 'POST',
url: '/prod/lists/list/{{ list.getId() }}/unshare/' + usr_id + '/',
dataType: 'json',
data : {},
beforeSend:function(){
},
success: function(data){
if(data.success)
{
humane.info(data.message);
callback(data);
}
else
{
humane.error(data.message);
}
$dialog.refresh();
return;
},
error: function(){
return;
},
timeout: function(){
return;
}
});
}
$autocompleter.autocomplete({
minLength: 2,
source: function( request, response ) {
$.ajax({
url: '/prod/push/search-user/',
dataType: "json",
data: {
query: request.term
},
success: function( data ) {
response( data );
}
});
},
select: function( event, ui ) {
if(ui.item.type === 'USER')
{
shareWith(ui.item.usr_id);
}
return false;
}
})
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
if(item.type === 'USER') {
html = _.template($("#list_user_tpl").html(), {
item: item
});
return $(html).data( "ui-autocomplete-item", item ).appendTo(ul);
}
};
});
</script>
{% endif %} {% endif %}

View File

@@ -97,79 +97,6 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<script>
$(document).ready(function(){
var $editor = $('#list-editor-search-results');
$('a.next, a.prev', $editor).bind('click', function(){
var page = $(this).attr('value');
$('input[name="page"]', $form).val(page);
$form.trigger('submit');
return false;
});
var $form = $('#ListManager .editor').find('form[name="list-editor-search"]');
$('input[name="page"]', $form).val('');
$('th.sortable', $editor).bind('click', function(){
var $this = $(this);
var sort = $('input', $this).val();
if((sort == $('input[name="srt"]', $form).val())
&& ($('input[name="ord"]', $form).val() == 'asc'))
{
var ord = 'desc';
}
else
{
var ord = 'asc';
}
$('input[name="srt"]', $form).val(sort);
$('input[name="ord"]', $form).val(ord);
$form.trigger('submit');
})
.bind('mouseover', function(){$(this).addClass('hover');})
.bind('mouseout', function(){$(this).removeClass('hover');});
$('tbody tr', $editor).bind('click', function(){
var $this = $(this);
var usr_id = $('input[name="usr_id"]', $this).val();
var counters = $('#ListManager .counter.current, #ListManager .lists .list.selected .counter');
if($this.hasClass('selected'))
{
$this.removeClass('selected');
p4.ListManager.getList().removeUser(usr_id);
counters.each(function(i,el){
var n = parseInt($(el).text());
$(el).text(n - 1);
});
}
else
{
$this.addClass('selected');
p4.ListManager.getList().addUser(usr_id);
counters.each(function(i,el){
var n = parseInt($(el).text());
$(el).text(n + 1);
});
}
});
});
</script>
{% endmacro %} {% endmacro %}
@@ -178,7 +105,7 @@
<div class="badge"> <div class="badge">
<input type="hidden" value="{{ entry.getUser().getId() }}" name="id"> <input type="hidden" value="{{ entry.getUser().getId() }}" name="id">
{% if role >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if role >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<a class="deleter" href="#"> <a class="deleter listmanager-delete-list-user-action" href="#" data-list-id="" data-user-id="{{ entry.getUser().getId() }}">
<img src="/assets/prod/images/Push/close_badge.png"> <img src="/assets/prod/images/Push/close_badge.png">
</a> </a>
{% endif %} {% endif %}

View File

@@ -17,7 +17,10 @@
</td> </td>
<td style="text-align:right;white-space:nowrap;"> <td style="text-align:right;white-space:nowrap;">
{% if list.getOwner(app.getAuthenticatedUser()).getRole() == constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() == constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %}
<a href="{{ path('prod_lists_list_share', { 'list_id' : list.getId() }) }}" title="{{ 'Share the list' | trans }}" class="list_sharer"> <a href="{{ path('prod_lists_list_share', { 'list_id' : list.getId() }) }}" title="{{ 'Share the list' | trans }}"
class="list_sharer push-list-share-action"
data-list-id="{{ list.getId() }}">
<img src="/assets/prod/images/Push/list-icon.png" /> <img src="/assets/prod/images/Push/list-icon.png" />
{{ "Set sharing permission" | trans }} {{ "Set sharing permission" | trans }}
</a> </a>
@@ -25,7 +28,7 @@
</td> </td>
{% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %}
<td style="text-align:right;white-space:nowrap;width:150px;"> <td style="text-align:right;white-space:nowrap;width:150px;">
<button class="deleter btn btn-inverse" data-list-id="{{ list.getId() }}"> <button class="deleter btn btn-inverse listmanager-delete-list-action" data-list-id="{{ list.getId() }}">
{{ 'Delete' | trans }} {{ 'Delete' | trans }}
</button> </button>
</td> </td>
@@ -159,15 +162,3 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
<script type="text/javascript">
$(document).ready(function(){
p4.ListManager.workOn({{ list.getId() }});
$("#ListManager .readonly .badge .deleter").click(function(){
var badge = $(this).closest(".badge");
var usr_id = badge.find('input[name="id"]').val();
p4.ListManager.getList().removeUser(usr_id, function(list, data){
badge.remove();
});
});
});
</script>

View File

@@ -2,17 +2,17 @@
<div class="PNB10 lists"> <div class="PNB10 lists">
<h1>{{ 'Lists' | trans }}</h1> <h1>{{ 'Lists' | trans }}</h1>
<span class="action"> <span class="action">
<a href="{{ path('prod_lists_list') }}" class="list_adder link"> <a href="{{ path('prod_lists_list') }}" class="list_adder link push-add-list-action">
{{ "Add" | trans }} {{ "Add" | trans }}
</a> </a>
<a href="{{ path('prod_lists_all') }}" class="list_refresh link"> <a href="{{ path('prod_lists_all') }}" class="list_refresh link push-refresh-list-action">
{{ "Refresh" | trans }} {{ "Refresh" | trans }}
</a> </a>
</span> </span>
<ul class="lists"> <ul class="lists">
{% for list in lists %} {% for list in lists %}
<li class="list" style="padding:2px;"> <li class="list" style="padding:2px;">
<a href="{{ path('prod_push_list_edit', { 'list_id' : list.getId() }) }}" class="list_link"> <a href="#" class="list_link list-edit-action" data-list-id="{{ list.getId() }}">
{% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<img src="/assets/prod/images/Push/list-icon.png" /> <img src="/assets/prod/images/Push/list-icon.png" />
{% else %} {% else %}

View File

@@ -264,10 +264,15 @@
{% include "prod/templates/push.html.twig" %} {% include "prod/templates/push.html.twig" %}
<script type="text/javascript"> {#<script type="text/javascript">
$(document).ready(function(){ prodApp.appEvents.emit('push.doInitialize', {
p4.Feedback = new pushModule.Feedback($('#PushBox'), '{{ context }}'); feedback: {
p4.ListManager = new pushModule.ListManager($('#ListManager')); containerId: '#PushBox',
context: '{{ context }}'
},
listManager: {
containerId: '#ListManager',
}
}); });
</script> </script>#}
{% endif %} {% endif %}

View File

@@ -625,6 +625,30 @@ $(document).ready(function(){
} }
{% if selectionLength == 1%} {% if selectionLength == 1%}
function openToolModal(datas, activeTab) {
var dialog = dialogModule.dialog.create({
size: 'Medium',
title: language.toolbox,
loading: true
});
$.get("../prod/tools/"
, datas
, function (data) {
dialog.setContent(data);
dialog.setOption('contextArgs', datas);
var tabs = $('.tabs', dialog.getDomElement()).tabs();
// activate tab if exists:
if( activeTab !== undefined ) {
tabs.tabs('option', 'active', activeTab);
}
return;
}
);
}
$('#tools-sharing .stateChange_button').bind('click',function(event){ $('#tools-sharing .stateChange_button').bind('click',function(event){
var $btn = $(event.currentTarget), var $btn = $(event.currentTarget),
state = true; state = true;
@@ -641,7 +665,7 @@ $(document).ready(function(){
}).done(function(data) { }).done(function(data) {
// self reload tab with current active tab: // self reload tab with current active tab:
var activeTab = tabs.tabs('option', 'active'); var activeTab = tabs.tabs('option', 'active');
prodModule.openToolModal($dialog.getOption('contextArgs'), activeTab); openToolModal($dialog.getOption('contextArgs'), activeTab);
}).error(function(err) { }).error(function(err) {
alert('forbidden action') alert('forbidden action')
}); });

View File

@@ -27,73 +27,6 @@
</span> </span>
</div> </div>
</form> </form>
<script type="text/javascript">
var $dialog = dialogModule.dialog.get(1);
var $dialogBox = $dialog.getDomElement();
var $closeButton = $("button.ui-dialog-titlebar-close", $dialogBox.parent());
var $cancelButton = $("button.cancel", $dialogBox);
$cancelButton.bind("click", function(){
$dialog.close();
});
$("button.submiter", $dialogBox).bind("click", function(){
var $this = $(this);
var form = $(this).closest("form");
var loader = form.find("form-action-loader");
$.ajax({
type: form.attr("method"),
url: form.attr("action"),
data: form.serializeArray(),
dataType: "json",
beforeSend:function(){
$this.prop('disabled', true);
$closeButton.prop('disabled', true);
$cancelButton.prop('disabled', true);
$dialog.setOption('closeOnEscape', false);
loader.show();
},
success: function(data){
$dialog.close();
$.each(data,function(i,n){
var imgt = $('#IMGT_'+n),
chim = $('.CHIM_'+n),
stories = $('.STORY_'+n);
$('.doc_infos', imgt).remove();
imgt.unbind("click").removeAttr("ondblclick").removeClass("selected").draggable("destroy").removeClass("IMGT").find("img").unbind();
imgt.find(".thumb img").attr("src","/assets/common/images/icons/deleted.png").css({
width:'100%',
height:'auto',
margin: '0 10px',
top: '0'
});
chim.parent().slideUp().remove();
imgt.find(".status,.title,.bottom").empty();
p4.Results.Selection.remove(n);
if(stories.length > 0)
{
p4.WorkZone.refresh();
}
else
{
p4.WorkZone.Selection.remove(n);
}
});
prodApp.appEvents.emit('search.doRefreshSelection')
},
complete: function(){
$this.prop('disabled', false);
$closeButton.prop('disabled', false);
$cancelButton.prop('disabled', false);
$dialog.setOption('closeOnEscape', true);
loader.hide();
}
});
});
</script>
{% elseif nbReceived == 0 %} {% elseif nbReceived == 0 %}
<div class="well-small" style="text-align:center;"> <div class="well-small" style="text-align:center;">
<span class="label label-important">{{ "No document selected" | trans }}</span> <span class="label label-important">{{ "No document selected" | trans }}</span>

View File

@@ -35,7 +35,9 @@
<div class='titre'> <div class='titre'>
{{ record.get_original_name() }} {{ record.get_original_name() }}
</div> </div>
<img class="edit_IMGT" id="idEditDiapoImg_{{ i }}" style="position:absolute; top:{{ top|round }}%; width:{{ width }}; height:{{ height }}; left:{{ left|round }}%;" onclick="recordEditorModule.edit_clk_editimg(event, {{ i }});" src="{{ thumbnail }}" /> <img class="edit_IMGT select-record-action" id="idEditDiapoImg_{{ i }}"
style="position:absolute; top:{{ top|round }}%; width:{{ width }}; height:{{ height }}; left:{{ left|round }}%;"
data-index="{{ i }}" src="{{ thumbnail }}" />
<div style='position:absolute; top:0px; left:0px; height:20px'> <div style='position:absolute; top:0px; left:0px; height:20px'>
<img class="require_alert" src="/assets/common/images/icons/alert.png" style="display:none;cursor:help;" title="{{ 'edit::Certains champs doivent etre remplis pour valider cet editing' | trans }}"> <img class="require_alert" src="/assets/common/images/icons/alert.png" style="display:none;cursor:help;" title="{{ 'edit::Certains champs doivent etre remplis pour valider cet editing' | trans }}">
</div> </div>
@@ -55,7 +57,9 @@
<td> <td>
<div class="context-menu context-menu-theme-vista"> <div class="context-menu context-menu-theme-vista">
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" onclick="recordEditorModule.setRegDefault('{{i}}','{{record.get_record_id()}}');">{{ 'edit: chosiir limage du regroupement' | trans }}</div> <div class="context-menu-item-inner set-grouping-image-action"
data-index="{{i}}"
data-record-id="{{record.get_record_id()}}">{{ 'edit: chosiir limage du regroupement' | trans }}</div>
</div> </div>
</div> </div>
</td> </td>
@@ -71,7 +75,7 @@
{% endmacro %} {% endmacro %}
{% macro HTML_fieldlist(recordsRequest, fields) %} {% macro HTML_fieldlist(recordsRequest, fields) %}
<div class="edit_field" id="EditFieldBox_status" onclick="return(recordEditorModule.edit_mdwn_status(event));" > <div class="edit_field edit-status-action" id="EditFieldBox_status">
{% trans %}prod::editing::fields: status{% endtrans %} {% trans %}prod::editing::fields: status{% endtrans %}
</div> </div>
{% set cssfile = '000000' %} {% set cssfile = '000000' %}
@@ -81,7 +85,9 @@
{% for field in fields %} {% for field in fields %}
{% set i = field.get_id() %} {% set i = field.get_id() %}
{% if field.is_readonly() is empty %} {% if field.is_readonly() is empty %}
<div class="edit_field" id="EditFieldBox_{{i}}" onclick="return(recordEditorModule.edit_mdwn_fld(event, {{i}}, '{{field.get_name()}}'));" > <div class="edit_field edit-field-action" id="EditFieldBox_{{i}}"
data-id="{{i}}"
data-name="{{field.get_name()}}">
<i id="editSGtri_{{i}}" style="visibility:hidden;" class="icon-caret-right"></i> <i id="editSGtri_{{i}}" style="visibility:hidden;" class="icon-caret-right"></i>
<span class="icon-stack fieldTips" tooltipsrc="{{ path('prod_tooltip_metadata', { 'sbas_id' : field.get_databox().get_sbas_id(), 'field_id' : field.get_id() }) }}"> <span class="icon-stack fieldTips" tooltipsrc="{{ path('prod_tooltip_metadata', { 'sbas_id' : field.get_databox().get_sbas_id(), 'field_id' : field.get_id() }) }}">
<i class="icon-circle icon-stack-base"></i> <i class="icon-circle icon-stack-base"></i>
@@ -114,19 +120,6 @@
{% set actionable = recordsRequest|length %} {% set actionable = recordsRequest|length %}
{% set not_actionable = recordsRequest.received|length - actionable %} {% set not_actionable = recordsRequest.received|length - actionable %}
<script type="text/javascript">
p4.edit.T_statbits = {{ JSonStatus|raw }};
p4.edit.T_fields = {{ JSonFields|raw }};
p4.edit.T_records = {{ JSonRecords|raw }};
p4.edit.T_sgval = {{ JSonSuggValues|raw }};
p4.edit.T_id = p4.edit.T_pos = {{ JSonIds|raw }};
p4.edit.T_mval = [];
</script>
<div id="EDIT_ALL"> <div id="EDIT_ALL">
<div class="content-wrapper"> <div class="content-wrapper">
@@ -169,28 +162,32 @@
<div class="edit-zone-title PNB"> <div class="edit-zone-title PNB">
<table style='position:relative; top:5px; table-layout:fixed; width:100%'> <table style='position:relative; top:5px; table-layout:fixed; width:100%'>
<tr> <tr>
<td style='width:30px; text-align:right'> <td style='width:30px; text-align:right'>
<input type='button' value='&#9668;' class='btn btn-inverse' onclick="recordEditorModule.edit_chgFld(event, -1);return(false);" /> <input type='button' value='&#9668;' class='btn btn-inverse field-navigate-action'
</td> data-direction="backward"/>
</td>
<td id="idFieldNameEdit"></td> <td id="idFieldNameEdit"></td>
<td style='width:30px; text-align:left'> <td style='width:30px; text-align:left'>
<input type='button' value='&#9658;' class='btn btn-inverse' onclick="recordEditorModule.edit_chgFld(event, 1);return(false);" /> <input type='button' value='&#9658;' class='btn btn-inverse field-navigate-action'
data-direction="forward"/>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="EDIT_EDIT" class="PNB"> <div id="EDIT_EDIT" class="PNB">
<div id="ZTextMonoValued"> <div id="ZTextMonoValued">
<textarea id="idEditZTextArea" onmousedown="return(recordEditorModule.edit_mdwn_ta(event));" onmouseup="return(recordEditorModule.edit_mup_ta(event, this));" onkeyup="return(recordEditorModule.edit_kup_ta(event, this));" onKeyDown="return(recordEditorModule.edit_kdwn(event, this));"></textarea> <textarea id="idEditZTextArea" ></textarea>
<div id="idEditDateZone"></div> <div id="idEditDateZone"></div>
</div> </div>
<div id="ZTextMultiValued"> <div id="ZTextMultiValued">
<form onsubmit="recordEditorModule.edit_addmval($('#EditTextMultiValued', p4.edit.editBox).val(), null);return(false);" style="position:absolute; height:30px; left:2px; right:2px;"> <form class="add-multivalued-field-action"
data-input-id="EditTextMultiValued"
style="position:absolute; height:30px; left:2px; right:2px;">
<div style="position:absolute; top:0px; left:0px; right:70px; height:17px;"> <div style="position:absolute; top:0px; left:0px; right:70px; height:17px;">
<input type='text' style="font-size:15px; position:absolute; top:0px; left:0px; width:100%; height:100%;" id="EditTextMultiValued" value="" /> <input type='text' style="font-size:15px; position:absolute; top:0px; left:0px; width:100%; height:100%;" id="EditTextMultiValued" value="" />
</div> </div>
<div style="position:absolute; top:6px; width:60px; right:0px; height:11px;"> <div style="position:absolute; top:6px; width:60px; right:0px; height:11px;">
<img id="EditButAddMultiValued" style="cursor:pointer" src="/assets/common/images/icons/plus16.png" onclick="recordEditorModule.edit_addmval($('#EditTextMultiValued', p4.edit.editBox).val(), null);" /> <img id="EditButAddMultiValued add-multivalued-field-action" style="cursor:pointer" src="/assets/common/images/icons/plus16.png" />
</div> </div>
</form> </form>
<div id="ZTextMultiValued_values"></div> <div id="ZTextMultiValued_values"></div>
@@ -207,7 +204,8 @@
{% for n, stat in status %} {% for n, stat in status %}
<tr> <tr>
<td style="padding-left:10px"> <td style="padding-left:10px">
<span style="cursor:pointer" onclick="recordEditorModule.edit_clkstatus(event, {{n}}, 0);"> <span class="toggle-status-field-action" data-state="false" data-bit="{{n}}"
style="cursor:pointer" >
<div id="idCheckboxStatbit0_{{n}}" class="gui_ckbox_0"></div> <div id="idCheckboxStatbit0_{{n}}" class="gui_ckbox_0"></div>
{% if stat['img_off'] %} {% if stat['img_off'] %}
<img src="{{stat['img_off']}}" title="{{stat['label0']}}" style="width:16px;height:16px;vertical-align:bottom" /> <img src="{{stat['img_off']}}" title="{{stat['label0']}}" style="width:16px;height:16px;vertical-align:bottom" />
@@ -216,7 +214,8 @@
</span> </span>
</td> </td>
<td style="padding-left:20px"> <td style="padding-left:20px">
<span style="cursor:pointer" onclick="recordEditorModule.edit_clkstatus(event, {{n}}, 1);"> <span class="toggle-status-field-action" data-state="true" data-bit="{{n}}"
style="cursor:pointer" >
<div id="idCheckboxStatbit1_{{n}}" class="gui_ckbox_0"></div> <div id="idCheckboxStatbit1_{{n}}" class="gui_ckbox_0"></div>
{% if stat['img_on'] %} {% if stat['img_on'] %}
<img src="{{stat['img_on']}}" title="{{stat['label1']}}" style="width:16px;height:16px;vertical-align:bottom" /> <img src="{{stat['img_on']}}" title="{{stat['label1']}}" style="width:16px;height:16px;vertical-align:bottom" />
@@ -231,9 +230,9 @@
</div> </div>
</div> </div>
<div id="idDivButtons" class="PNB"> <div id="idDivButtons" class="PNB">
<input id="ok" type="button" value="{{ 'boutton::remplacer' | trans }}" class="btn btn-inverse" onclick="recordEditorModule.edit_validField(event, 'ok');return(false);"> <input id="ok" type="button" value="{{ 'boutton::remplacer' | trans }}" class="btn btn-inverse commit-field-action" data-mode="ok">
<input id="fusion" type="button" value="{{ 'boutton::ajouter' | trans }}" class="btn btn-inverse" onclick="recordEditorModule.edit_validField(event, 'fusion');return(false);"> <input id="fusion" type="button" value="{{ 'boutton::ajouter' | trans }}" class="btn btn-inverse commit-field-action" data-mode="fusion">
<input id="cancel" type="button" value="{{ 'boutton::annuler' | trans }}" class="btn btn-inverse" onclick="recordEditorModule.edit_validField(event, 'cancel');return(false);"> <input id="cancel" type="button" value="{{ 'boutton::annuler' | trans }}" class="btn btn-inverse commit-field-action" data-mode="cancel">
</div> </div>
<div id="idExplain" class="PNB"></div> <div id="idExplain" class="PNB"></div>
</div> </div>
@@ -252,7 +251,7 @@
</ul> </ul>
{% if thesaurus %} {% if thesaurus %}
<div id='TH_Ofull'> <div id='TH_Ofull'>
<div class='thesaurus' ondblclick='return(recordEditorModule.edit_dblclickThesaurus(event));' onclick='return(recordEditorModule.edit_clickThesaurus(event));'> <div class='thesaurus edit-thesaurus-action'>
<p id='TH_T.{{ databox.get_sbas_id() }}.T'> <p id='TH_T.{{ databox.get_sbas_id() }}.T'>
<u id='TH_P.{{ databox.get_sbas_id() }}.T'>+</u><a id='GL_W.{{ databox.get_sbas_id() }}.T' style='FONT-WEIGHT: bold;'>{{ databox.get_label(app['locale']) }}</a> <u id='TH_P.{{ databox.get_sbas_id() }}.T'>+</u><a id='GL_W.{{ databox.get_sbas_id() }}.T' style='FONT-WEIGHT: bold;'>{{ databox.get_label(app['locale']) }}</a>
</p> </p>
@@ -297,7 +296,7 @@
<tr> <tr>
<td valign="top">{{ 'prod::editing:remplace: options de remplacement' | trans }}</td> <td valign="top">{{ 'prod::editing:remplace: options de remplacement' | trans }}</td>
<td> <td>
<input type="checkbox" class="checkbox" id="EditSROptionRX" value="regexp" onchange="recordEditorModule.changeReplaceMode(this);"> <input type="checkbox" class="checkbox" id="EditSROptionRX" value="regexp" class="toggle-replace-mode-action">
{{ 'prod::editing:remplace::option : utiliser une expression reguliere' | trans }} {{ 'prod::editing:remplace::option : utiliser une expression reguliere' | trans }}
{% set help_link = 'https://secure.wikimedia.org/wikipedia/en/wiki/Regular_expression' %} {% set help_link = 'https://secure.wikimedia.org/wikipedia/en/wiki/Regular_expression' %}
{% if app['locale'] == 'de' %} {% if app['locale'] == 'de' %}
@@ -351,8 +350,8 @@
</div> </div>
<div id="buttonEditing"> <div id="buttonEditing">
<input type='button' value="{{ 'boutton::valider' | trans }}" class="btn btn-inverse btn-small" onclick="recordEditorModule.edit_applyMultiDesc(event);" /> <input type='button' value="{{ 'boutton::valider' | trans }}" class="btn btn-inverse btn-small apply-multi-desc-action" />
<input type='button' value="{{ 'boutton::annuler' | trans }}" class="btn btn-inverse btn-small" onclick="recordEditorModule.edit_cancelMultiDesc(event);" /> <input type='button' value="{{ 'boutton::annuler' | trans }}" class="btn btn-inverse btn-small cancel-multi-desc-action" />
</div> </div>
</div> </div>
@@ -424,6 +423,21 @@
{% elseif not_actionable == 1 %} {% elseif not_actionable == 1 %}
alert("{{ 'prod::editing: 1 document ne peut etre edite car vos droits sont induffisants' | trans | e('js') }}"); alert("{{ 'prod::editing: 1 document ne peut etre edite car vos droits sont induffisants' | trans | e('js') }}");
{% endif %} {% endif %}
recordEditorModule.startThisEditing({{ databox.get_sbas_id }},{% if recordsRequest.isSingleStory() %}'GRP'{% else %}'LST'{% endif %},"",''); prodApp.appEvents.emit('recordEditor.start', {
databoxId: {{ databox.get_sbas_id }},
mode: {% if recordsRequest.isSingleStory() %}'GRP'{% else %}'LST'{% endif %},
state: {
T_statbits: {{ JSonStatus|raw }},
T_fields: {{ JSonFields|raw }},
T_records: {{ JSonRecords|raw }},
T_sgval: {{ JSonSuggValues|raw }},
T_id: {{ JSonIds|raw }},
T_pos: {{ JSonIds|raw }},
T_mval: []
}
});
{% endif %} {% endif %}
</script> </script>

View File

@@ -668,7 +668,7 @@
<div class="PNB" style="width:180px;left:auto;"> <div class="PNB" style="width:180px;left:auto;">
<div class="PNB10 ui-corner-all" style="height:20px;"> <div class="PNB10 ui-corner-all" style="height:20px;">
<button type="button" onclick="recordPreviewModule.closePreview();" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close" role="button" aria-disabled="false" title="close"> <button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close close-preview-action" role="button" aria-disabled="false" title="close">
<span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span><span class="ui-button-text">close</span> <span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span><span class="ui-button-text">close</span>
</button> </button>
</div> </div>

View File

@@ -3,8 +3,11 @@
<ul> <ul>
<li class="title">{{ 'Apparait aussi dans ces reportages' | trans }}</li> <li class="title">{{ 'Apparait aussi dans ces reportages' | trans }}</li>
{% for par in parents %} {% for par in parents %}
<li onclick="recordPreviewModule.openPreview('REG',0,'{{par.get_serialize_key()}}', true); return(false);" <li data-kind="REG"
class="otherRegToolTip" {% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : par.get_sbas_id(), 'record_id' : par.get_record_id(), 'context' : 'basket' }) }}" {% endif %}> data-position="0"
data-id="{{par.get_serialize_key()}}"
data-reload="true"
class="otherRegToolTip open-preview-action" {% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : par.get_sbas_id(), 'record_id' : par.get_record_id(), 'context' : 'basket' }) }}" {% endif %}>
<img src="{{par.get_thumbnail().get_url()}}" style="width:25px;height:25px;"/> <img src="{{par.get_thumbnail().get_url()}}" style="width:25px;height:25px;"/>
<span class="title" title="{{ par.get_title() }}"> {{ par.get_title() }} </span> <span class="title" title="{{ par.get_title() }}"> {{ par.get_title() }} </span>
</li> </li>
@@ -16,8 +19,11 @@
<ul> <ul>
<li class="title">{{ 'Apparait aussi dans ces paniers' | trans }}</li> <li class="title">{{ 'Apparait aussi dans ces paniers' | trans }}</li>
{% for basket in baskets %} {% for basket in baskets %}
<li onclick="recordPreviewModule.openPreview('BASK',0,'{{basket.getId()}}',true); return(false);" <li data-kind="BASK"
class="otherBaskToolTip" title="{{basket.getDescription()}}"> data-position="0"
data-id="{{basket.getId()}}"
data-reload="true"
class="otherBaskToolTip open-preview-action" title="{{basket.getDescription()}}">
{#<img style="vertical-align:middle" src="/assets/common/images/icons/basket.png" width="16">#} {#<img style="vertical-align:middle" src="/assets/common/images/icons/basket.png" width="16">#}
{% if basket.getValidation() %} {% if basket.getValidation() %}

View File

@@ -49,10 +49,10 @@
</div> </div>
<div class="cont_infos"> <div class="cont_infos">
<div> <div>
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="recordPreviewModule.getPrevious();"/> <img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" class="preview-navigate-action" data-direction="backward"/>
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="recordPreviewModule.getNext();"/><br/> <img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" class="preview-navigate-action" data-direction="forward"/><br/>
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span> <span class="preview-start-slideshow-action" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
<span onclick="recordPreviewModule.stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span> <span class="preview-stop-slideshow-action" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
</div> </div>
</div> </div>
<div id="PREVIEWTOOL"> <div id="PREVIEWTOOL">

View File

@@ -5,7 +5,7 @@
{% if can_edit %} {% if can_edit %}
<div class="edit_button" style="text-align:right"> <div class="edit_button" style="text-align:right">
<a href="#" onclick="prodModule.openRecordEditor('IMGT','{{ record.get_serialize_key }}');"> <a href="#" class="edit-record-action" data-kind="record" data-id="{{ record.get_serialize_key }}">
<img style="vertical-align:middle" src="/assets/common/images/icons/ppen_history.png" width="16" class="btn-image"/> <img style="vertical-align:middle" src="/assets/common/images/icons/ppen_history.png" width="16" class="btn-image"/>
{{ 'action : editer' | trans }} {{ 'action : editer' | trans }}
</a> </a>

View File

@@ -47,10 +47,10 @@
</div> </div>
<div class="cont_infos"> <div class="cont_infos">
<div> <div>
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="recordPreviewModule.getPrevious();"/> <img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" class="preview-navigate-action" data-direction="backward"/>
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="recordPreviewModule.getNext();"/><br/> <img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" class="preview-navigate-action" data-direction="forward"/><br/>
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span> <span class="preview-start-slideshow-action" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
<span onclick="recordPreviewModule.stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span> <span class="preview-stop-slideshow-action" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
</div> </div>
</div> </div>
<div id="PREVIEWTOOL"> <div id="PREVIEWTOOL">

View File

@@ -25,7 +25,10 @@
%} %}
<div id="PREVMAINREG" class="PNB10"> <div id="PREVMAINREG" class="PNB10">
<img onclick="recordPreviewModule.openPreview('REG',0,'{{story.get_serialize_key}}')" <img data-kind="REG"
data-position="0"
data-id="{{story.get_serialize_key}}"
class="open-preview-action"
src="{{url}}" src="{{url}}"
style=" style="
width:{{fit_size.width}}px; width:{{fit_size.width}}px;
@@ -80,10 +83,10 @@
</div> </div>
<div class="cont_infos"> <div class="cont_infos">
<div> <div>
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="recordPreviewModule.getPrevious();"/> <img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" class="preview-navigate-action" data-direction="backward"/>
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="recordPreviewModule.getNext();"/><br/> <img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" class="preview-navigate-action" data-direction="forward"/><br/>
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span> <span class="preview-start-slideshow-action" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
<span onclick="recordPreviewModule.stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span> <span class="preview-stop-slideshow-action" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
</div> </div>
</div> </div>
<div id="PREVIEWTOOL"> <div id="PREVIEWTOOL">

View File

@@ -43,10 +43,10 @@
</div> </div>
<div class="cont_infos"> <div class="cont_infos">
<div> <div>
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="recordPreviewModule.getPrevious();"/> <img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" class="preview-navigate-action" data-direction="backward">
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="recordPreviewModule.getNext();"/><br/> <img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" class="preview-navigate-action" data-direction="forward"><br/>
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }} </span> <span class="preview-start-slideshow-action" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }} </span>
<span onclick="recordPreviewModule.stopSlide()" id="stop_slide"> {{ 'preview:: arreter le diaporama' | trans }} </span> <span class="preview-stop-slideshow-action" id="stop_slide"> {{ 'preview:: arreter le diaporama' | trans }} </span>
</div> </div>
</div> </div>
<div id="PREVIEWTOOL"></div> <div id="PREVIEWTOOL"></div>

View File

@@ -1,10 +1,10 @@
<div id="PREVIEWCURRENTCONT" class="PNB10"> <div id="PREVIEWCURRENTCONT" class="PNB10">
<div style="margin:2px 0;"> <div style="margin:2px 0;">
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:20px;" onclick="recordPreviewModule.getPrevious();"/> <img src="/assets/common/images/icons/light_left.gif" style="margin-right:20px;" class="preview-navigate-action" data-direction="backward"/>
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span> <span class="preview-start-slideshow-action" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
<span onclick="recordPreviewModule.stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span> <span class="preview-stop-slideshow-action" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:20px;" onclick="recordPreviewModule.getNext();"/><br/> <img src="/assets/common/images/icons/light_right.gif" style="margin-left:20px;" class="preview-navigate-action" data-direction="forward"/><br/>
</div> </div>
</div> </div>
<div id="PREVIEWTOOL" style="top:0;bottom:auto;"> <div id="PREVIEWTOOL" style="top:0;bottom:auto;">

View File

@@ -17,12 +17,12 @@
</a> </a>
{% endif %} {% endif %}
<div onclick="prodModule.openPrintModal('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"> <div class="print-record-action" data-kind="record" data-id="{{record.get_sbas_id()}}_{{record.get_record_id()}}">
<img src="/assets/common/images/icons/print_history.png" height="16" width="16" class="btn-image" title="'{{ 'action : print' | trans }}"> <img src="/assets/common/images/icons/print_history.png" height="16" width="16" class="btn-image" title="'{{ 'action : print' | trans }}">
</div> </div>
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldhd') or app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldpreview') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldhd') or app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldpreview') %}
<div onclick="prodModule.openDownloadModal('{{record.get_sbas_id()}}_{{record.get_record_id()}}', 'lst');return(false);"> <div class="export-record-action" data-kind="record" data-id="{{record.get_sbas_id()}}_{{record.get_record_id()}}">
<img src="/assets/common/images/icons/disktt_history.png" height="16" width="16" class="btn-image" title="{{ 'action : exporter' | trans }}"> <img src="/assets/common/images/icons/disktt_history.png" height="16" width="16" class="btn-image" title="{{ 'action : exporter' | trans }}">
{# <img style="vertical-align:middle" src="/assets/common/images/icons/basket.png" width="16">#} {# <img style="vertical-align:middle" src="/assets/common/images/icons/basket.png" width="16">#}

View File

@@ -5,8 +5,10 @@
<div style="width:{{ images_size+30 }}px;" <div style="width:{{ images_size+30 }}px;"
sbas="{{ record.databoxId }}" sbas="{{ record.databoxId }}"
id="{{'PUBLI_' ~ entry.id ~ '_' ~ record.id }}" id="{{'PUBLI_' ~ entry.id ~ '_' ~ record.id }}"
class="IMGT diapo type-{{ record.type }}" class="IMGT diapo type-{{ record.type }} open-preview-action"
onDblClick="recordPreviewModule.openPreview('FEED',{{ record.getNumber }},{{ entry.id }});" data-kind="FEED"
data-position="{{ record.getNumber }}"
data-id="{{ entry.id }}"
> >
<div style="padding: 4px;"> <div style="padding: 4px;">
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;"> <div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">

View File

@@ -4,8 +4,11 @@
<div style="width:{{ settings.images_size + 30}}px;" <div style="width:{{ settings.images_size + 30}}px;"
sbas="{{ record.databoxId }}" sbas="{{ record.databoxId }}"
id="{{ prefix|default('IMGT') }}_{{ record.id }}" id="{{ prefix|default('IMGT') }}_{{ record.id }}"
class="IMGT diapo {% if record.story %}grouping{% endif %} type-{{ record.type }}" class="IMGT diapo {% if record.story %}grouping{% endif %} type-{{ record.type }} open-preview-action"
onDblClick="recordPreviewModule.openPreview('{{ record.story ? 'REG' : 'RESULT' }}', '{{ record.position|default(0) }}', '{{ record.id }}');"> data-kind="{{ record.story ? 'REG' : 'RESULT' }}"
data-position="{{ record.position|default(0) }}"
data-id="{{ record.id }}"
>
<div style="padding: 4px;"> <div style="padding: 4px;">
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;"> <div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
<div class="title" style="max-height:100%" title="{{ record.title(app.locale) }}"> <div class="title" style="max-height:100%" title="{{ record.title(app.locale) }}">
@@ -110,15 +113,14 @@
{% endif %} {% endif %}
{% if granted_on_collection(record.baseId, 'candwnldpreview') or granted_on_collection(record.baseId, 'candwnldhd') %} {% if granted_on_collection(record.baseId, 'candwnldpreview') or granted_on_collection(record.baseId, 'candwnldhd') %}
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner export-record-action" data-kind="record" data-id="{{record.id}}">
onclick="prodModule.openDownloadModal('{{record.id}}','lst');return(false);">
{{ 'action : exporter' | trans }} {{ 'action : exporter' | trans }}
</div> </div>
</div> </div>
{% endif %} {% endif %}
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner print-record-action"
onclick="prodModule.openPrintModal('{{record.id}}');return(false);"> data-kind="record" data-id="{{record.id}}">
{{ 'action : print' | trans }} {{ 'action : print' | trans }}
</div> </div>
</div> </div>
@@ -127,8 +129,7 @@
and granted_on_databox(record.databoxId, 'bas_chupub')) %} and granted_on_databox(record.databoxId, 'bas_chupub')) %}
{% if record.story is empty %} {% if record.story is empty %}
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner share-record-action" data-db="{{record.baseId}}" data-record-id="{{record.recordId}}">
onclick="prodModule.openShareModal('{{record.baseId}}','{{record.recordId}}');">
{{ 'reponses:: partager' | trans }} {{ 'reponses:: partager' | trans }}
</div> </div>
</div> </div>

View File

@@ -599,9 +599,9 @@ function Xclick(e)
if((type=='T'||type=='C') && tid.substr(1, 4)=="X_P") // TX_P ou CX_P if((type=='T'||type=='C') && tid.substr(1, 4)=="X_P") // TX_P ou CX_P
{ {
var ul = li.children('ul').eq(0); var ul = li.children('ul').eq(0);
if(ul.css("display")=='none' || is_ctrl_key(e)) if(ul.css("display")=='none' || prodApp.utils.is_ctrl_key(e))
{ {
if(is_ctrl_key(e)) if(prodApp.utils.is_ctrl_key(e))
{ {
ul.text("{{ 'prod::thesaurusTab:tree:loading' | trans }}"); ul.text("{{ 'prod::thesaurusTab:tree:loading' | trans }}");
li.removeAttr('loaded'); li.removeAttr('loaded');