mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
wip: js modularization of prod and cleanup
This commit is contained in:
@@ -97,41 +97,41 @@ class QueryController extends Controller
|
||||
}
|
||||
for ($i = 1; ($i <= 4 && (($i <= $npages) === true)); $i++) {
|
||||
if ($i == $page)
|
||||
$string .= '<input onkeypress="if(event.keyCode == 13 && !isNaN(parseInt(this.value)))gotopage(parseInt(this.value))" type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini" />';
|
||||
$string .= '<input onkeypress="if(event.keyCode == 13 && !isNaN(parseInt(this.value)))searchResultModule.gotopage(parseInt(this.value))" type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini" />';
|
||||
else
|
||||
$string .= "<a onclick='gotopage(" . $i . ");return false;' class='btn btn-primary btn-mini'>" . $i . "</a>";
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . $i . ");return false;' class='btn btn-primary btn-mini'>" . $i . "</a>";
|
||||
}
|
||||
if ($npages > 4)
|
||||
$string .= "<a id='NEXT_PAGE' class='btn btn-primary btn-mini'></a>";
|
||||
$string .= "<a onclick='gotopage(" . ($npages) . ");return false;' class='btn btn-primary btn-mini' id='last'></a>";
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . ($npages) . ");return false;' class='btn btn-primary btn-mini' id='last'></a>";
|
||||
} else {
|
||||
$start = $npages - 4;
|
||||
if (($start) > 0){
|
||||
$string .= "<a onclick='gotopage(1);return false;' class='btn btn-primary btn-mini' id='first'></a>";
|
||||
$string .= "<a onclick='searchResultModule.gotopage(1);return false;' class='btn btn-primary btn-mini' id='first'></a>";
|
||||
$string .= "<a id='PREV_PAGE' class='btn btn-primary btn-mini'></a>";
|
||||
}else
|
||||
$start = 1;
|
||||
for ($i = ($start); $i <= $npages; $i++) {
|
||||
if ($i == $page)
|
||||
$string .= '<input onkeypress="if(event.keyCode == 13 && !isNaN(parseInt(this.value)))gotopage(parseInt(this.value))" type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini" />';
|
||||
$string .= '<input onkeypress="if(event.keyCode == 13 && !isNaN(parseInt(this.value)))searchResultModule.gotopage(parseInt(this.value))" type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini" />';
|
||||
else
|
||||
$string .= "<a onclick='gotopage(" . $i . ");return false;' class='btn btn-primary btn-mini'>" . $i . "</a>";
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . $i . ");return false;' class='btn btn-primary btn-mini'>" . $i . "</a>";
|
||||
}
|
||||
if($page < $npages){
|
||||
$string .= "<a id='NEXT_PAGE' class='btn btn-primary btn-mini'></a>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$string .= "<a onclick='gotopage(1);return false;' class='btn btn-primary btn-mini' id='first'></a>";
|
||||
$string .= "<a onclick='searchResultModule.gotopage(1);return false;' class='btn btn-primary btn-mini' id='first'></a>";
|
||||
|
||||
for ($i = ($page - 2); $i <= ($page + 2); $i++) {
|
||||
if ($i == $page)
|
||||
$string .= '<input onkeypress="if(event.keyCode == 13 && !isNaN(parseInt(this.value)))gotopage(parseInt(this.value))" type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini" />';
|
||||
$string .= '<input onkeypress="if(event.keyCode == 13 && !isNaN(parseInt(this.value)))searchResultModule.gotopage(parseInt(this.value))" type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini" />';
|
||||
else
|
||||
$string .= "<a onclick='gotopage(" . $i . ");return false;' class='btn btn-primary btn-mini'>" . $i . "</a>";
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . $i . ");return false;' class='btn btn-primary btn-mini'>" . $i . "</a>";
|
||||
}
|
||||
|
||||
$string .= "<a onclick='gotopage(" . ($npages) . ");return false;' class='btn btn-primary btn-mini' id='last'></a>";
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . ($npages) . ");return false;' class='btn btn-primary btn-mini' id='last'></a>";
|
||||
}
|
||||
}
|
||||
$string .= '<div style="display:none;"><div id="NEXT_PAGE"></div><div id="PREV_PAGE"></div></div>';
|
||||
|
@@ -39,7 +39,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
|
||||
$sender = $user->getDisplayName();
|
||||
|
||||
$ret = [
|
||||
'text' => $this->app->trans('%user% vous a envoye un %before_link% panier %after_link%', ['%user%' => $sender, '%before_link%' => '<a href="#" onclick="openPreview(\'BASK\',1,\''
|
||||
'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,\''
|
||||
. $data['ssel_id'] . '\');return false;">', '%after_link%' => '</a>'])
|
||||
, 'class' => ($unread == 1 ? 'reload_baskets' : '')
|
||||
];
|
||||
|
@@ -53,7 +53,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
||||
$basket_name = $this->app->trans('Une selection');
|
||||
}
|
||||
|
||||
$bask_link = '<a href="#" onclick="openPreview(\'BASK\',1,\''
|
||||
$bask_link = '<a href="#" onclick="recordPreviewModule.openPreview(\'BASK\',1,\''
|
||||
. $ssel_id . '\');return false;">'
|
||||
. $basket_name . '</a>';
|
||||
|
||||
|
@@ -112,7 +112,7 @@ class queries
|
||||
if(qry=="")
|
||||
qry = "all";
|
||||
|
||||
doSpecialSearch(qry,true);
|
||||
prodModule.doSpecialSearch(qry,true);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ class queries
|
||||
$queries = $app['repo.user-queries']->findBy(['user' => $usrId], ['created' => 'ASC'], 25, 0);
|
||||
|
||||
foreach ($queries as $query) {
|
||||
$history .= '<li onclick="doSpecialSearch(\'' . str_replace(["'", '"'], ["\'", '"'], $query->getQuery()) . '\')">' . $query->getQuery() . '</li>';
|
||||
$history .= '<li onclick="prodModule.doSpecialSearch(\'' . str_replace(["'", '"'], ["\'", '"'], $query->getQuery()) . '\')">' . $query->getQuery() . '</li>';
|
||||
}
|
||||
|
||||
$history .= '<ul>';
|
||||
@@ -246,7 +246,7 @@ class queries
|
||||
$l = '<span class=\'topic_' . $depth . '\'>' . $l . '</span>';
|
||||
if ($subtopic->query) {
|
||||
$q = str_replace(["\\", "\"", "'", "\r", "\n"], ["\\\\", """, "\\'", "\\r", "\\n"], $subtopic->query);
|
||||
$q = '<a href="javascript:void();" onClick="doSpecialSearch(\'' . $q . '\',true);">' . $l . '</a>';
|
||||
$q = '<a href="javascript:void();" onClick="prodModule.doSpecialSearch(\'' . $q . '\',true);">' . $l . '</a>';
|
||||
} else {
|
||||
$q = $l;
|
||||
}
|
||||
@@ -256,13 +256,13 @@ class queries
|
||||
$view = $defaultview;
|
||||
switch ($view) {
|
||||
case 'opened':
|
||||
$out .= ( '<li><a id=\'TOPIC_TRI' . $tid . '\' class="opened" href="javascript:void();" onclick="clktri(\'' . $tid . '\');return(false);"></a> ' . $q . '</li>' . "\n");
|
||||
$out .= ( '<li><a id=\'TOPIC_TRI' . $tid . '\' class="opened" href="javascript:void();" onclick="prodModule.toggleTopic(\'' . $tid . '\');return(false);"></a> ' . $q . '</li>' . "\n");
|
||||
$out .= ( "<ul id='TOPIC_UL$tid' class='opened'>\n");
|
||||
$out .= self::drawTopics($subtopic->topics, $depth + 1, $tid, $defaultview);
|
||||
$out .= ( "</ul>\n<div style='height:1px;'></div>\n");
|
||||
break;
|
||||
case 'closed':
|
||||
$out .= ( '<li><a id=\'TOPIC_TRI' . $tid . '\' class="closed" href="javascript:void();" onclick="clktri(\'' . $tid . '\');return(false);"></a> ' . $q . '</li>' . "\n");
|
||||
$out .= ( '<li><a id=\'TOPIC_TRI' . $tid . '\' class="closed" href="javascript:void();" onclick="prodModule.toggleTopic(\'' . $tid . '\');return(false);"></a> ' . $q . '</li>' . "\n");
|
||||
$out .= ( "<ul id='TOPIC_UL$tid' class='closed'>\n");
|
||||
$out .= self::drawTopics($subtopic->topics, $depth + 1, $tid, $defaultview);
|
||||
$out .= ( "</ul>\n<div style='height:1px;'></div>\n");
|
||||
|
@@ -83,19 +83,18 @@ gulp.task('build-prod-js', function(){
|
||||
config.paths.src + 'prod/js/components/workzone/workzone.js',
|
||||
config.paths.src + 'prod/js/components/workzone/workzone-basket.js',
|
||||
config.paths.src + 'prod/js/components/workzone/workzone-facets.js',
|
||||
config.paths.src + 'prod/js/components/workzone/workzone-thesaurus.js',
|
||||
config.paths.src + 'prod/js/components/utils.js',
|
||||
config.paths.src + 'prod/js/components/cgu.js',
|
||||
config.paths.src + 'prod/js/components/preferences.js',
|
||||
// config.paths.src + 'prod/js/jquery.form.2.49.js',
|
||||
config.paths.src + 'prod/js/components/record/editable-record.js',
|
||||
// config.paths.src + 'prod/js/jquery.Prod.js',
|
||||
config.paths.src + 'prod/js/jquery.Feedback.js',
|
||||
config.paths.src + 'prod/js/jquery.main-prod.js',
|
||||
config.paths.src + 'prod/js/components/push/push.js',
|
||||
config.paths.src + 'prod/js/prod.js',
|
||||
config.paths.src + 'prod/js/components/upload/upload.js',
|
||||
config.paths.src + 'prod/js/components/video-editor.js',
|
||||
config.paths.src + 'prod/js/publicator.js',
|
||||
config.paths.src + 'vendors/jquery-sprintf/js/jquery.sprintf.1.0.3.js',
|
||||
config.paths.src + 'prod/js/jquery.p4.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/jquery.color.animation.js',
|
||||
config.paths.src + 'vendors/jquery-image-enhancer/js/jquery.image_enhancer.js',
|
||||
|
@@ -791,7 +791,7 @@ var recordEditorModule = (function (p4) {
|
||||
edit_addmval($('#EditTextMultiValued', p4.edit.editBox).val(), null);
|
||||
}
|
||||
else {
|
||||
if (is_ctrl_key(e)) {
|
||||
if (utilsModule.is_ctrl_key(e)) {
|
||||
var t = $("#idEditZTextArea", p4.edit.editBox).val();
|
||||
$("#idEditZTextArea", p4.edit.editBox).val(t + (t ? " ; " : "") + label);
|
||||
}
|
||||
@@ -1105,7 +1105,7 @@ var recordEditorModule = (function (p4) {
|
||||
if (evt && evt.type == "mousedown" && p4.edit.T_records[i]._selected)
|
||||
return;
|
||||
|
||||
if (evt && is_shift_key(evt) && p4.edit.lastClickId != null) {
|
||||
if (evt && utilsModule.is_shift_key(evt) && p4.edit.lastClickId != null) {
|
||||
// shift donc on sel du p4.edit.lastClickId a ici
|
||||
var pos_from = p4.edit.T_pos[p4.edit.lastClickId];
|
||||
var pos_to = p4.edit.T_pos[i];
|
||||
@@ -1126,7 +1126,7 @@ var recordEditorModule = (function (p4) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!evt || !is_ctrl_key(evt)) {
|
||||
if (!evt || !utilsModule.is_ctrl_key(evt)) {
|
||||
// on deselectionne tout avant
|
||||
var id;
|
||||
for (id in p4.edit.T_records) {
|
||||
@@ -1252,7 +1252,7 @@ var recordEditorModule = (function (p4) {
|
||||
$('#EDITWINDOW').hide();
|
||||
hideOverlay(2);
|
||||
if (p4.preview.open)
|
||||
reloadPreview();
|
||||
recordPreviewModule.reloadPreview();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
455
resources/www/prod/js/components/preview/preview.js
Normal file
455
resources/www/prod/js/components/preview/preview.js
Normal file
@@ -0,0 +1,455 @@
|
||||
// var p4 = p4 || {};
|
||||
|
||||
var recordPreviewModule = (function (p4) {
|
||||
var prevAjax, prevAjaxrunning;
|
||||
prevAjaxrunning = false;
|
||||
p4.slideShow = false;
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#PREVIEWIMGDESC').tabs();
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
* @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) {
|
||||
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);
|
||||
|
||||
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;
|
||||
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);
|
||||
// if(p4.preview.current.type == 'video')
|
||||
// {
|
||||
// var h = parseInt(p4.preview.current.flashcontent.height);
|
||||
// var w = parseInt(p4.preview.current.flashcontent.width);
|
||||
// }
|
||||
var t = 20;
|
||||
var de = 0;
|
||||
|
||||
var margX = 0;
|
||||
var margY = 0;
|
||||
|
||||
if ($('#PREVIEWIMGCONT .record_audio').length > 0) {
|
||||
margY = 100;
|
||||
de = 60;
|
||||
}
|
||||
|
||||
|
||||
// if(p4.preview.current.type != 'flash')
|
||||
// {
|
||||
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);
|
||||
}
|
||||
}
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
// h = Math.round(parseInt(p4.preview.height) - margY);
|
||||
// w = Math.round(parseInt(p4.preview.width) - margX);
|
||||
// }
|
||||
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);
|
@@ -1,5 +1,5 @@
|
||||
;
|
||||
(function (window) {
|
||||
|
||||
var pushModule = (function (window, p4) {
|
||||
|
||||
var Feedback = function ($container, context) {
|
||||
this.container = $($container);
|
||||
@@ -690,7 +690,19 @@
|
||||
};
|
||||
|
||||
|
||||
window.Feedback = Feedback;
|
||||
window.ListManager = ListManager;
|
||||
function reloadBridge(url) {
|
||||
var options = $('#dialog_publicator form[name="current_datas"]').serializeArray();
|
||||
var dialog = p4.Dialog.get(1);
|
||||
dialog.load(url, 'POST', options);
|
||||
}
|
||||
|
||||
}(window));
|
||||
|
||||
|
||||
// instance wil be stored in p4.Feedback
|
||||
return {
|
||||
Feedback: Feedback,
|
||||
ListManager: ListManager,
|
||||
reloadBridge: reloadBridge
|
||||
}
|
||||
|
||||
}(window, p4));
|
@@ -1,6 +1,6 @@
|
||||
var p4 = p4 || {};
|
||||
|
||||
(function (p4, window) {
|
||||
var searchResultModule = (function (p4, window) {
|
||||
|
||||
p4.Results = {
|
||||
'Selection': new Selectable($('#answers'), {
|
||||
@@ -10,7 +10,7 @@ var p4 = p4 || {};
|
||||
$('#answercontextwrap table:visible').hide();
|
||||
},
|
||||
selectStop: function (event, selection) {
|
||||
viewNbSelect();
|
||||
searchModule.viewNbSelect();
|
||||
},
|
||||
callbackSelection: function (element) {
|
||||
var elements = $(element).attr('id').split('_');
|
||||
@@ -20,5 +20,13 @@ var p4 = p4 || {};
|
||||
})
|
||||
};
|
||||
|
||||
return;
|
||||
function gotopage(pag) {
|
||||
$('#searchForm input[name="sel"]').val(p4.Results.Selection.serialize());
|
||||
$('#formAnswerPage').val(pag);
|
||||
$('#searchForm').submit();
|
||||
}
|
||||
|
||||
return {
|
||||
gotopage: gotopage
|
||||
};
|
||||
}(p4, window));
|
||||
|
@@ -71,7 +71,7 @@ var searchModule = (function (p4) {
|
||||
$('#SENT_query').val(query);
|
||||
var histo = $('#history-queries ul');
|
||||
|
||||
histo.prepend('<li onclick="doSpecialSearch(\'' + query.replace(/\'/g, "\\'") + '\')">' + query + '</li>');
|
||||
histo.prepend('<li onclick="prodModule.doSpecialSearch(\'' + query.replace(/\'/g, "\\'") + '\')">' + query + '</li>');
|
||||
|
||||
var lis = $('li', histo);
|
||||
if (lis.length > 25) {
|
||||
@@ -157,7 +157,7 @@ var searchModule = (function (p4) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
linearize();
|
||||
prodModule.linearizeUi();
|
||||
}
|
||||
|
||||
function checkFilters(save) {
|
||||
@@ -341,6 +341,10 @@ var searchModule = (function (p4) {
|
||||
}
|
||||
}
|
||||
|
||||
function viewNbSelect() {
|
||||
$("#nbrecsel").empty().append(p4.Results.Selection.length());
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
checkFilters: checkFilters,
|
||||
@@ -351,6 +355,7 @@ var searchModule = (function (p4) {
|
||||
afterSearch: afterSearch,
|
||||
clearAnswers: clearAnswers,
|
||||
newSearch: newSearch,
|
||||
resetSearch: resetSearch
|
||||
resetSearch: resetSearch,
|
||||
viewNbSelect: viewNbSelect
|
||||
};
|
||||
}(p4));
|
||||
|
@@ -4,9 +4,9 @@ var utilsModule = (function (p4) {
|
||||
|
||||
|
||||
function RGBtoHex(R, G, B) {
|
||||
return toHex(R) + toHex(G) + toHex(B);
|
||||
return _toHex(R) + _toHex(G) + _toHex(B);
|
||||
}
|
||||
function toHex(N) {
|
||||
function _toHex(N) {
|
||||
if (N === null) return "00";
|
||||
N = parseInt(N);
|
||||
if (N === 0 || isNaN(N)) return "00";
|
||||
@@ -30,9 +30,9 @@ var utilsModule = (function (p4) {
|
||||
m2 = l + s - l * s;
|
||||
m1 = l * 2 - m2;
|
||||
hue = h / 360;
|
||||
r = HueToRgb(m1, m2, hue + 1 / 3);
|
||||
g = HueToRgb(m1, m2, hue);
|
||||
b = HueToRgb(m1, m2, hue - 1 / 3);
|
||||
r = _HueToRgb(m1, m2, hue + 1 / 3);
|
||||
g = _HueToRgb(m1, m2, hue);
|
||||
b = _HueToRgb(m1, m2, hue - 1 / 3);
|
||||
}
|
||||
return {
|
||||
r: r,
|
||||
@@ -41,7 +41,7 @@ var utilsModule = (function (p4) {
|
||||
};
|
||||
}
|
||||
|
||||
function HueToRgb(m1, m2, hue) {
|
||||
function _HueToRgb(m1, m2, hue) {
|
||||
var v;
|
||||
if (hue < 0)
|
||||
hue += 1;
|
||||
@@ -59,7 +59,34 @@ var utilsModule = (function (p4) {
|
||||
|
||||
return 255 * v;
|
||||
}
|
||||
|
||||
function is_ctrl_key(event) {
|
||||
if (event.altKey)
|
||||
return true;
|
||||
if (event.ctrlKey)
|
||||
return true;
|
||||
if (event.metaKey) // apple key opera
|
||||
return true;
|
||||
if (event.keyCode === 17) // apple key opera
|
||||
return true;
|
||||
if (event.keyCode === 224) // apple key mozilla
|
||||
return true;
|
||||
if (event.keyCode === 91) // apple key safari
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function is_shift_key(event) {
|
||||
if (event.shiftKey)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
RGBtoHex: RGBtoHex, hsl2rgb: hsl2rgb
|
||||
RGBtoHex: RGBtoHex,
|
||||
hsl2rgb: hsl2rgb,
|
||||
is_ctrl_key: is_ctrl_key,
|
||||
is_shift_key: is_shift_key
|
||||
};
|
||||
}(p4));
|
||||
|
@@ -98,5 +98,10 @@ var workzoneBasketModule = (function (p4) {
|
||||
|
||||
|
||||
|
||||
return {archiveBasket: archiveBasket, deleteBasket: deleteBasket, openBasketPreferences: openBasketPreferences}
|
||||
return {
|
||||
archiveBasket: archiveBasket,
|
||||
deleteBasket: deleteBasket,
|
||||
openBasketPreferences: openBasketPreferences
|
||||
|
||||
}
|
||||
})(p4);
|
@@ -0,0 +1,33 @@
|
||||
var p4 = p4 || {};
|
||||
|
||||
var workzoneThesaurusModule = (function (p4) {
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#thesaurus_tab .input-medium').on('keyup', function(){
|
||||
if($('#thesaurus_tab .input-medium').val() != ''){
|
||||
$('#thesaurus_tab .th_clear').show();
|
||||
}else{
|
||||
$('#thesaurus_tab .th_clear').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('.th_clear').on('click', function(){
|
||||
$('#thesaurus_tab .input-medium').val('');
|
||||
$('#thesaurus_tab .gform').submit();
|
||||
$('#thesaurus_tab .th_clear').hide();
|
||||
});
|
||||
|
||||
$('.treeview>li.expandable>.hitarea').on('click', function(){
|
||||
if($(this).css('background-position') == '99% 22px'){
|
||||
$(this).css('background-position', '99% -28px');
|
||||
$(this).addClass('active');
|
||||
}else{
|
||||
$(this).css('background-position', '99% 22px');
|
||||
$(this).removeClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return {};
|
||||
})(p4);
|
@@ -1,6 +1,77 @@
|
||||
var p4 = p4 || {};
|
||||
|
||||
var workzoneModule = (function (p4) {
|
||||
var warnOnRemove = true;
|
||||
$(document).ready(function () {
|
||||
activeBaskets();
|
||||
|
||||
$('a.story_unfix').on('click', function () {
|
||||
unfix($(this).attr('href'));
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
p4.WorkZone = {
|
||||
'Selection': new Selectable($('#baskets'), {selector: '.CHIM'}),
|
||||
'refresh': refreshBaskets,
|
||||
'addElementToBasket': function (sbas_id, record_id, event, singleSelection) {
|
||||
singleSelection = !!singleSelection || false;
|
||||
|
||||
if ($('#baskets .SSTT.active').length === 1) {
|
||||
return dropOnBask(event, $('#IMGT_' + sbas_id + '_' + record_id), $('#baskets .SSTT.active'), singleSelection);
|
||||
} else {
|
||||
humane.info(language.noActiveBasket);
|
||||
}
|
||||
},
|
||||
"removeElementFromBasket": WorkZoneElementRemover,
|
||||
'reloadCurrent': function () {
|
||||
var sstt = $('#baskets .content:visible');
|
||||
if (sstt.length === 0)
|
||||
return;
|
||||
getContent(sstt.prev());
|
||||
},
|
||||
'close': function () {
|
||||
var frame = $('#idFrameC'), that = this;
|
||||
|
||||
if (!frame.hasClass('closed')) {
|
||||
// hide tabs content
|
||||
$('#idFrameC .tabs > .ui-tabs-panel').hide();
|
||||
|
||||
frame.data('openwidth', frame.width());
|
||||
frame.animate({width: 100},
|
||||
300,
|
||||
'linear',
|
||||
function () {
|
||||
prodModule.answerSizer();
|
||||
prodModule.linearizeUi();
|
||||
$('#answers').trigger('resize');
|
||||
});
|
||||
frame.addClass('closed');
|
||||
$('.escamote', frame).hide();
|
||||
frame.unbind('click.escamote').bind('click.escamote', function () {
|
||||
that.open();
|
||||
});
|
||||
}
|
||||
},
|
||||
'open': function () {
|
||||
var frame = $('#idFrameC');
|
||||
|
||||
if (frame.hasClass('closed')) {
|
||||
var width = frame.data('openwidth') ? frame.data('openwidth') : 300;
|
||||
frame.css({width: width});
|
||||
prodModule.answerSizer();
|
||||
prodModule.linearizeUi();
|
||||
frame.removeClass('closed');
|
||||
$('.escamote', frame).show();
|
||||
frame.unbind('click.escamote');
|
||||
// show tabs content
|
||||
var activeTabIdx = $('#idFrameC .tabs').tabs("option", "active");
|
||||
$('#idFrameC .tabs > div:eq(' + activeTabIdx + ')').show();
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
function refreshBaskets(baskId, sort, scrolltobottom, type) {
|
||||
type = typeof type === 'undefined' ? 'basket' : type;
|
||||
|
||||
@@ -80,7 +151,7 @@ var workzoneModule = (function (p4) {
|
||||
function WorkZoneElementRemover(el, confirm) {
|
||||
var context = el.data('context');
|
||||
|
||||
if (confirm !== true && $(el).hasClass('groupings') && p4.reg_delete) {
|
||||
if (confirm !== true && $(el).hasClass('groupings') && warnOnRemove) {
|
||||
var buttons = {};
|
||||
|
||||
buttons[language.valider] = function () {
|
||||
@@ -92,7 +163,7 @@ var workzoneModule = (function (p4) {
|
||||
$("#DIALOG-baskets").dialog('close').remove();
|
||||
};
|
||||
|
||||
var texte = '<p>' + language.confirmRemoveReg + '</p><div><input type="checkbox" onchange="toggleRemoveReg(this);"/>' + language.hideMessage + '</div>';
|
||||
var texte = '<p>' + language.confirmRemoveReg + '</p><div><input type="checkbox" onchange="workzoneModule.toggleRemoveWarning(this);"/>' + language.hideMessage + '</div>';
|
||||
$('body').append('<div id="DIALOG-baskets"></div>');
|
||||
$("#DIALOG-baskets").attr('title', language.removeTitle)
|
||||
.empty()
|
||||
@@ -151,7 +222,7 @@ var workzoneModule = (function (p4) {
|
||||
// click next item
|
||||
selectedItem.next().find("img").trigger("click");
|
||||
} else {
|
||||
closePreview();
|
||||
recordPreviewModule.closePreview();
|
||||
}
|
||||
|
||||
selectedItem.remove();
|
||||
@@ -368,14 +439,14 @@ var workzoneModule = (function (p4) {
|
||||
.remove();
|
||||
},
|
||||
drag: function (event, ui) {
|
||||
if (is_ctrl_key(event) || $(this).closest('.content').hasClass('grouping'))
|
||||
if (utilsModule.is_ctrl_key(event) || $(this).closest('.content').hasClass('grouping'))
|
||||
$('#dragDropCursor div').empty().append('+ ' + p4.WorkZone.Selection.length());
|
||||
else
|
||||
$('#dragDropCursor div').empty().append(p4.WorkZone.Selection.length());
|
||||
|
||||
}
|
||||
});
|
||||
answerSizer();
|
||||
prodModule.answerSizer();
|
||||
return;
|
||||
}
|
||||
});
|
||||
@@ -427,7 +498,7 @@ var workzoneModule = (function (p4) {
|
||||
|
||||
switch (action) {
|
||||
case "CHU2CHU" :
|
||||
if (!is_ctrl_key(event)) act = "MOV";
|
||||
if (!utilsModule.is_ctrl_key(event)) act = "MOV";
|
||||
break;
|
||||
case "IMGT2REG":
|
||||
case "CHU2REG" :
|
||||
@@ -528,75 +599,18 @@ var workzoneModule = (function (p4) {
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
activeBaskets();
|
||||
function setRemoveWarning(state) {
|
||||
warnOnRemove = state;
|
||||
}
|
||||
// remove record from basket/story preferences
|
||||
function toggleRemoveWarning(el) {
|
||||
var state = !el.checked;
|
||||
userModule.setPref('reg_delete', (state ? '1' : '0'));
|
||||
warnOnRemove = state;
|
||||
}
|
||||
|
||||
$('a.story_unfix').on('click', function () {
|
||||
unfix($(this).attr('href'));
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
p4.WorkZone = {
|
||||
'Selection': new Selectable($('#baskets'), {selector: '.CHIM'}),
|
||||
'refresh': refreshBaskets,
|
||||
'addElementToBasket': function (sbas_id, record_id, event, singleSelection) {
|
||||
singleSelection = !!singleSelection || false;
|
||||
|
||||
if ($('#baskets .SSTT.active').length === 1) {
|
||||
return dropOnBask(event, $('#IMGT_' + sbas_id + '_' + record_id), $('#baskets .SSTT.active'), singleSelection);
|
||||
} else {
|
||||
humane.info(language.noActiveBasket);
|
||||
}
|
||||
},
|
||||
"removeElementFromBasket": WorkZoneElementRemover,
|
||||
'reloadCurrent': function () {
|
||||
var sstt = $('#baskets .content:visible');
|
||||
if (sstt.length === 0)
|
||||
return;
|
||||
getContent(sstt.prev());
|
||||
},
|
||||
'close': function () {
|
||||
var frame = $('#idFrameC'), that = this;
|
||||
|
||||
if (!frame.hasClass('closed')) {
|
||||
// hide tabs content
|
||||
$('#idFrameC .tabs > .ui-tabs-panel').hide();
|
||||
|
||||
frame.data('openwidth', frame.width());
|
||||
frame.animate({width: 100},
|
||||
300,
|
||||
'linear',
|
||||
function () {
|
||||
answerSizer();
|
||||
linearize();
|
||||
$('#answers').trigger('resize');
|
||||
});
|
||||
frame.addClass('closed');
|
||||
$('.escamote', frame).hide();
|
||||
frame.unbind('click.escamote').bind('click.escamote', function () {
|
||||
that.open();
|
||||
});
|
||||
}
|
||||
},
|
||||
'open': function () {
|
||||
var frame = $('#idFrameC');
|
||||
|
||||
if (frame.hasClass('closed')) {
|
||||
var width = frame.data('openwidth') ? frame.data('openwidth') : 300;
|
||||
frame.css({width: width});
|
||||
answerSizer();
|
||||
linearize();
|
||||
frame.removeClass('closed');
|
||||
$('.escamote', frame).show();
|
||||
frame.unbind('click.escamote');
|
||||
// show tabs content
|
||||
var activeTabIdx = $('#idFrameC .tabs').tabs("option", "active");
|
||||
$('#idFrameC .tabs > div:eq(' + activeTabIdx + ')').show();
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
return;
|
||||
return {
|
||||
setRemoveWarning: setRemoveWarning,
|
||||
toggleRemoveWarning: toggleRemoveWarning
|
||||
}
|
||||
}(p4));
|
||||
|
@@ -46,7 +46,7 @@
|
||||
|
||||
var k = get_value($that, $this);
|
||||
|
||||
if (is_shift_key(event) && jQuery('.last_selected', this.$container).filter($this.options.selector).length != 0) {
|
||||
if (utilsModule.is_shift_key(event) && jQuery('.last_selected', this.$container).filter($this.options.selector).length != 0) {
|
||||
var lst = jQuery($this.options.selector, this.$container);
|
||||
|
||||
var index1 = jQuery.inArray(jQuery('.last_selected', this.$container).filter($this.options.selector)[0], lst);
|
||||
@@ -89,7 +89,7 @@
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!is_ctrl_key(event)) {
|
||||
if (!utilsModule.is_ctrl_key(event)) {
|
||||
$this.empty().push(k);
|
||||
jQuery('.selected', this.$container).filter($this.options.selector).removeClass('selected');
|
||||
$that.addClass('selected');
|
||||
@@ -133,7 +133,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
function is_ctrl_key(event) {
|
||||
function utilsModule.is_ctrl_key(event) {
|
||||
if (event.altKey)
|
||||
return true;
|
||||
if (event.ctrlKey)
|
||||
@@ -150,7 +150,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
function is_shift_key(event) {
|
||||
function utilsModule.is_shift_key(event) {
|
||||
if (event.shiftKey)
|
||||
return true;
|
||||
return false;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,527 +0,0 @@
|
||||
var prevAjax, prevAjaxrunning;
|
||||
prevAjaxrunning = false;
|
||||
p4.slideShow = false;
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#PREVIEWIMGDESC').tabs();
|
||||
});
|
||||
|
||||
|
||||
function getNewVideoToken(lst, obj) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "../prod/records/renew-url/",
|
||||
dataType: 'json',
|
||||
data: {
|
||||
lst: lst
|
||||
},
|
||||
success: function (data) {
|
||||
if (!data[lst])
|
||||
return;
|
||||
obj.unload();
|
||||
obj.setClip({url: data[lst]});
|
||||
obj.play();
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @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) {
|
||||
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 zoomPreview(bool) {
|
||||
|
||||
var el = $('#PREVIEWIMGCONT img.record');
|
||||
|
||||
if (el.length === 0)
|
||||
return;
|
||||
|
||||
var t1 = parseInt(el.css('top'));
|
||||
var l1 = parseInt(el.css('left'));
|
||||
var w1 = el.width();
|
||||
var h1 = el.height();
|
||||
|
||||
var w2, t2;
|
||||
|
||||
if (bool) {
|
||||
if (w1 * 1.08 < 32767)
|
||||
w2 = w1 * 1.08;
|
||||
else
|
||||
w2 = w1;
|
||||
}
|
||||
else {
|
||||
if (w1 / 1.08 > 20)
|
||||
w2 = w1 / 1.08;
|
||||
else
|
||||
w2 = w1;
|
||||
}
|
||||
|
||||
var ratio = p4.preview.current.width / p4.preview.current.height;
|
||||
h2 = Math.round(w2 / ratio);
|
||||
w2 = Math.round(w2);
|
||||
|
||||
t2 = Math.round(t1 - (h2 - h1) / 2) + 'px';
|
||||
var l2 = Math.round(l1 - (w2 - w1) / 2) + 'px';
|
||||
|
||||
var wPreview = $('#PREVIEWIMGCONT').width() / 2;
|
||||
var hPreview = $('#PREVIEWIMGCONT').height() / 2;
|
||||
|
||||
var nt = Math.round((h2 / h1) * (t1 - hPreview) + hPreview);
|
||||
var nl = Math.round(((w2 / w1) * (l1 - wPreview)) + wPreview);
|
||||
|
||||
el.css({
|
||||
left: nl,
|
||||
top: nt
|
||||
}).width(w2).height(h2);
|
||||
}
|
||||
|
||||
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 bounce(sbid, term, field) {
|
||||
doThesSearch('T', sbid, term, field);
|
||||
closePreview();
|
||||
}
|
||||
|
||||
function setTitle(title) {
|
||||
$('#SPANTITLE').empty().append(title);
|
||||
}
|
||||
|
||||
function cancelPreview() {
|
||||
$('#PREVIEWIMGDESCINNER').empty();
|
||||
$('#PREVIEWIMGCONT').empty();
|
||||
p4.preview.current = false;
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
//var posAsk = null;
|
||||
|
||||
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;
|
||||
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 reloadPreview() {
|
||||
$('#PREVIEWCURRENT li.selected 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;
|
||||
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 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 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:
|
||||
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 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);
|
||||
// if(p4.preview.current.type == 'video')
|
||||
// {
|
||||
// var h = parseInt(p4.preview.current.flashcontent.height);
|
||||
// var w = parseInt(p4.preview.current.flashcontent.width);
|
||||
// }
|
||||
var t = 20;
|
||||
var de = 0;
|
||||
|
||||
var margX = 0;
|
||||
var margY = 0;
|
||||
|
||||
if ($('#PREVIEWIMGCONT .record_audio').length > 0) {
|
||||
margY = 100;
|
||||
de = 60;
|
||||
}
|
||||
|
||||
|
||||
// if(p4.preview.current.type != 'flash')
|
||||
// {
|
||||
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);
|
||||
}
|
||||
}
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
// h = Math.round(parseInt(p4.preview.height) - margY);
|
||||
// w = Math.round(parseInt(p4.preview.width) - margX);
|
||||
// }
|
||||
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 classicMode() {
|
||||
$('#PREVIEWCURRENTCONT').animate({'scrollLeft': ($('#PREVIEWCURRENT li.selected').position().left - 160)});
|
||||
p4.currentViewMode = 'classic';
|
||||
}
|
||||
|
||||
function closePreview() {
|
||||
p4.preview.open = false;
|
||||
hideOverlay();
|
||||
|
||||
$('#PREVIEWBOX').fadeTo(500, 0);
|
||||
$('#PREVIEWBOX').queue(function () {
|
||||
$(this).css({
|
||||
'display': 'none'
|
||||
});
|
||||
cancelPreview();
|
||||
$(this).dequeue();
|
||||
});
|
||||
|
||||
}
|
1168
resources/www/prod/js/prod.js
Normal file
1168
resources/www/prod/js/prod.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +0,0 @@
|
||||
function publicator_reload_publicator(url) {
|
||||
var options = $('#dialog_publicator form[name="current_datas"]').serializeArray();
|
||||
var dialog = p4.Dialog.get(1);
|
||||
dialog.load(url, 'POST', options);
|
||||
}
|
@@ -447,7 +447,7 @@
|
||||
|
||||
var k = el.attr('id').split('_').pop();
|
||||
|
||||
if (is_shift_key(evt) && $('tr.last_selected', cont).length != 0) {
|
||||
if (utilsModule.is_shift_key(evt) && $('tr.last_selected', cont).length != 0) {
|
||||
var lst = $('tr', cont);
|
||||
var index1 = $.inArray($('tr.last_selected', cont)[0], lst);
|
||||
var index2 = $.inArray($(el)[0], lst);
|
||||
@@ -478,7 +478,7 @@
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!is_ctrl_key(evt)) {
|
||||
if (!utilsModule.is_ctrl_key(evt)) {
|
||||
if ($.inArray(k, p4.users.sel) < 0) {
|
||||
p4.users.sel = new Array();
|
||||
$('tr', cont).removeClass('selected');
|
||||
|
@@ -45,12 +45,12 @@
|
||||
<div class="context-menu context-menu-theme-vista">
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="downloadThis('ssel={{basket.getId()}}');">{{ 'action::exporter' | trans }}
|
||||
onclick="prodModule.openDownloadModal('ssel={{basket.getId()}}');">{{ 'action::exporter' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
|
||||
<div title="" class="context-menu-item menu3-custom-item">
|
||||
<div onclick="editThis('SSTT','{{basket.getId()}}');" style=""
|
||||
<div onclick="prodModule.openRecordEditor('SSTT','{{basket.getId()}}');" style=""
|
||||
class="context-menu-item-inner">{{ 'edit' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -139,7 +139,7 @@
|
||||
<div class="context-menu context-menu-theme-vista">
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="downloadThis('ssel={{basket.getId()}}');">{{ 'action::exporter' | trans }}
|
||||
onclick="prodModule.openDownloadModal('ssel={{basket.getId()}}');">{{ 'action::exporter' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
<div title="" class="context-menu-item">
|
||||
@@ -173,7 +173,7 @@
|
||||
</div>
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner" id="SSTTREMOVER_{{basket.getId()}}"
|
||||
onclick="checkDeleteThis('SSTT',this);return false;">
|
||||
onclick="prodModule.deleteConfirmation('SSTT',this);return false;">
|
||||
{{ 'action : supprimer' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -227,12 +227,12 @@
|
||||
<div class="context-menu context-menu-theme-vista">
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="downloadThis('lst={{story.getRecord(app).get_serialize_key()}}');">{{ 'action::exporter' | trans }}
|
||||
onclick="prodModule.openDownloadModal('lst={{story.getRecord(app).get_serialize_key()}}');">{{ 'action::exporter' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
|
||||
<div title="" class="context-menu-item menu3-custom-item">
|
||||
<div onclick="editThis('IMGT','{{story.getRecord(app).get_serialize_key()}}');" style=""
|
||||
<div onclick="prodModule.openRecordEditor('IMGT','{{story.getRecord(app).get_serialize_key()}}');" style=""
|
||||
class="context-menu-item-inner">{{ 'action::editer' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -277,7 +277,7 @@
|
||||
|
||||
{% import 'common/thumbnail.html.twig' as thumbnail %}
|
||||
|
||||
<div ondblclick="{% if wz_scope == 'groupings' %}openPreview('REG',{{ ord }},'{{container.get_sbas_id()}}_{{container.get_record_id()}}');{% else %}openPreview('BASK',{{ ord }},{{container.getId()}});{% endif %}"
|
||||
<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 %}"
|
||||
class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;"
|
||||
id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}">
|
||||
<input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
{% if error_message is empty %}
|
||||
|
||||
<script type="text/javascript">
|
||||
window.opener.publicator_reload_publicator("{{ path("prod_bridge_manager") }}");
|
||||
window.opener.pushModule.reloadBridge("{{ path("prod_bridge_manager") }}");
|
||||
window.close();
|
||||
</script>
|
||||
|
||||
|
@@ -158,7 +158,7 @@ $(function() {
|
||||
success: function(datas){
|
||||
if(datas.success) {
|
||||
confirmBox.Close();
|
||||
publicator_reload_publicator(managerUrl);
|
||||
pushModule.reloadBridge(managerUrl);
|
||||
} else {
|
||||
confirmBox.Close();
|
||||
var alertBox = p4.Dialog.Create({
|
||||
|
@@ -266,8 +266,8 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
p4.Feedback = new Feedback($('#PushBox'), '{{ context }}');
|
||||
p4.ListManager = new ListManager($('#ListManager'));
|
||||
p4.Feedback = new pushModule.Feedback($('#PushBox'), '{{ context }}');
|
||||
p4.ListManager = new pushModule.ListManager($('#ListManager'));
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
@@ -638,7 +638,7 @@ $(document).ready(function(){
|
||||
}).done(function(data) {
|
||||
// self reload tab with current active tab:
|
||||
var activeTab = tabs.tabs('option', 'active');
|
||||
toolREFACTOR($dialog.getOption('contextArgs'), activeTab);
|
||||
prodModule.openToolModal($dialog.getOption('contextArgs'), activeTab);
|
||||
}).error(function(err) {
|
||||
alert('forbidden action')
|
||||
});
|
||||
|
@@ -82,7 +82,7 @@
|
||||
p4.WorkZone.Selection.remove(n);
|
||||
}
|
||||
});
|
||||
viewNbSelect();
|
||||
searchModule.viewNbSelect();
|
||||
},
|
||||
complete: function(){
|
||||
$this.prop('disabled', false);
|
||||
|
@@ -407,7 +407,7 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td class="infos">
|
||||
<a href="#" onclick="lookBox(this,event);return false;">{{ 'Preferences' | trans }} </a>
|
||||
<a href="#" onclick="preferencesModule.lookBox(this,event);return false;">{{ 'Preferences' | trans }} </a>
|
||||
|
|
||||
<span id="tool_results">
|
||||
|
||||
@@ -684,7 +684,7 @@
|
||||
<div class="PNB" style="width:180px;left:auto;">
|
||||
<div class="PNB10 ui-corner-all" style="height:20px;">
|
||||
|
||||
<button type="button" onclick="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" 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">
|
||||
<span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span><span class="ui-button-text">close</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -765,7 +765,7 @@
|
||||
})
|
||||
|
||||
$(document).ready(function(){
|
||||
p4.reg_delete="{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), "warning_on_delete_story") %}true{% else %}false{% endif %}";
|
||||
workzoneModule.setRemoveWarning("{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), "warning_on_delete_story") %}true{% else %}false{% endif %}");
|
||||
});
|
||||
|
||||
function setCss(color) {
|
||||
|
@@ -116,7 +116,7 @@ $(document).ready(function(){
|
||||
|
||||
var $this = $(this);
|
||||
|
||||
if(is_ctrl_key(event))
|
||||
if(utilsModule.is_ctrl_key(event))
|
||||
{
|
||||
if($this.hasClass('selected')) {
|
||||
$this.removeClass('selected');
|
||||
@@ -126,7 +126,7 @@ $(document).ready(function(){
|
||||
}
|
||||
else
|
||||
{
|
||||
if(is_shift_key(event))
|
||||
if(utilsModule.is_shift_key(event))
|
||||
{
|
||||
var first = false, last = false;
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<ul>
|
||||
<li class="title">{{ 'Apparait aussi dans ces reportages' | trans }}</li>
|
||||
{% for par in parents %}
|
||||
<li onclick="openPreview('REG',0,'{{par.get_serialize_key()}}', true); return(false);"
|
||||
<li onclick="recordPreviewModule.openPreview('REG',0,'{{par.get_serialize_key()}}', true); return(false);"
|
||||
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 %}>
|
||||
<img src="{{par.get_thumbnail().get_url()}}" style="width:25px;height:25px;"/>
|
||||
<span class="title" title="{{ par.get_title() }}"> {{ par.get_title() }} </span>
|
||||
@@ -16,7 +16,7 @@
|
||||
<ul>
|
||||
<li class="title">{{ 'Apparait aussi dans ces paniers' | trans }}</li>
|
||||
{% for basket in baskets %}
|
||||
<li onclick="openPreview('BASK',0,'{{basket.getId()}}',true); return(false);"
|
||||
<li onclick="recordPreviewModule.openPreview('BASK',0,'{{basket.getId()}}',true); return(false);"
|
||||
class="otherBaskToolTip" title="{{basket.getDescription()}}">
|
||||
{#<img style="vertical-align:middle" src="/assets/common/images/icons/basket.png" width="16">#}
|
||||
|
||||
|
@@ -49,10 +49,10 @@
|
||||
</div>
|
||||
<div class="cont_infos">
|
||||
<div>
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="getPrevious();"/>
|
||||
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="getNext();"/><br/>
|
||||
<span onclick="startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
|
||||
<span onclick="stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="recordPreviewModule.getPrevious();"/>
|
||||
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="recordPreviewModule.getNext();"/><br/>
|
||||
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
|
||||
<span onclick="recordPreviewModule.stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWTOOL">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
{% if can_edit %}
|
||||
<div class="edit_button" style="text-align:right">
|
||||
<a href="#" onclick="editThis('IMGT','{{ record.get_serialize_key }}');">
|
||||
<a href="#" onclick="prodModule.openRecordEditor('IMGT','{{ record.get_serialize_key }}');">
|
||||
<img style="vertical-align:middle" src="/assets/common/images/icons/ppen_history.png" width="16" class="btn-image"/>
|
||||
{{ 'action : editer' | trans }}
|
||||
</a>
|
||||
|
@@ -47,10 +47,10 @@
|
||||
</div>
|
||||
<div class="cont_infos">
|
||||
<div>
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="getPrevious();"/>
|
||||
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="getNext();"/><br/>
|
||||
<span onclick="startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
|
||||
<span onclick="stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="recordPreviewModule.getPrevious();"/>
|
||||
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="recordPreviewModule.getNext();"/><br/>
|
||||
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
|
||||
<span onclick="recordPreviewModule.stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWTOOL">
|
||||
|
@@ -25,7 +25,7 @@
|
||||
%}
|
||||
|
||||
<div id="PREVMAINREG" class="PNB10">
|
||||
<img onclick="openPreview('REG',0,'{{story.get_serialize_key}}')"
|
||||
<img onclick="recordPreviewModule.openPreview('REG',0,'{{story.get_serialize_key}}')"
|
||||
src="{{url}}"
|
||||
style="
|
||||
width:{{fit_size.width}}px;
|
||||
@@ -80,10 +80,10 @@
|
||||
</div>
|
||||
<div class="cont_infos">
|
||||
<div>
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="getPrevious();"/>
|
||||
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="getNext();"/><br/>
|
||||
<span onclick="startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
|
||||
<span onclick="stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="recordPreviewModule.getPrevious();"/>
|
||||
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="recordPreviewModule.getNext();"/><br/>
|
||||
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
|
||||
<span onclick="recordPreviewModule.stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWTOOL">
|
||||
|
@@ -43,10 +43,10 @@
|
||||
</div>
|
||||
<div class="cont_infos">
|
||||
<div>
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="getPrevious();"/>
|
||||
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="getNext();"/><br/>
|
||||
<span onclick="startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }} </span>
|
||||
<span onclick="stopSlide()" id="stop_slide"> {{ 'preview:: arreter le diaporama' | trans }} </span>
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:10px;" onclick="recordPreviewModule.getPrevious();"/>
|
||||
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:10px;" onclick="recordPreviewModule.getNext();"/><br/>
|
||||
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }} </span>
|
||||
<span onclick="recordPreviewModule.stopSlide()" id="stop_slide"> {{ 'preview:: arreter le diaporama' | trans }} </span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWTOOL"></div>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
|
||||
<div id="PREVIEWCURRENTCONT" class="PNB10">
|
||||
<div style="margin:2px 0;">
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:20px;" onclick="getPrevious();"/>
|
||||
<span onclick="startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
|
||||
<span onclick="stopSlide()" id="stop_slide">{{ 'preview:: arreter le diaporama' | trans }}</span>
|
||||
<img src="/assets/common/images/icons/light_right.gif" style="margin-left:20px;" onclick="getNext();"/><br/>
|
||||
<img src="/assets/common/images/icons/light_left.gif" style="margin-right:20px;" onclick="recordPreviewModule.getPrevious();"/>
|
||||
<span onclick="recordPreviewModule.startSlide()" id="start_slide">{{ 'preview:: demarrer le diaporama' | trans }}</span>
|
||||
<span onclick="recordPreviewModule.stopSlide()" 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/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="PREVIEWTOOL" style="top:0;bottom:auto;">
|
||||
|
@@ -2,7 +2,7 @@
|
||||
{% if (record.is_from_basket is empty) and app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'canputinalbum') %}
|
||||
<div sbas="{{record.get_sbas_id()}}" id="PREV_BASKADD_{{record.get_serialize_key}}"
|
||||
class="baskAdder" title="{{ 'action : ajouter au panier' | trans }}"
|
||||
onclick="evt_add_in_chutier('{{record.get_sbas_id()}}','{{record.get_record_id()}}',false,this);return(false);">
|
||||
onclick="prodModule.addToBasket('{{record.get_sbas_id()}}','{{record.get_record_id()}}',false,this);return(false);">
|
||||
<img src="/assets/common/images/icons/basket.png" height="16" width="16" class="btn-image">
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -11,18 +11,18 @@
|
||||
<a sbas="{{record.get_sbas_id()}}" id="PREV_BASKDEL_{{record.get_serialize_key}}"
|
||||
class="WorkZoneElementRemover"
|
||||
data-context="reg_train_basket"
|
||||
onclick="remove_from_basket($(this), false);return false;"
|
||||
onclick="prodModule.removeFromBasket($(this), false);return false;"
|
||||
href="{{ path('prod_baskets_basket_element_remove', { 'basket' : record.get_container().getId(), 'basket_element_id' : record.get_original_item().getId()}) }}">
|
||||
<img src="/assets/common/images/icons/delete.png" height="16" width="16" class="btn-image" title="{{ 'Remove from basket' | trans }}">
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<div onclick="evt_print('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);">
|
||||
<div onclick="prodModule.openPrintModal('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);">
|
||||
<img src="/assets/common/images/icons/print_history.png" height="16" width="16" class="btn-image" title="'{{ 'action : print' | trans }}">
|
||||
</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') %}
|
||||
<div onclick="evt_dwnl('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);">
|
||||
<div onclick="prodModule.openDownloadModal('{{record.get_sbas_id()}}_{{record.get_record_id()}}', 'lst');return(false);">
|
||||
<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">#}
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
sbas="{{ record.databoxId }}"
|
||||
id="{{'PUBLI_' ~ entry.id ~ '_' ~ record.id }}"
|
||||
class="IMGT diapo type-{{ record.type }}"
|
||||
onDblClick="openPreview('FEED',{{ record.getNumber }},{{ entry.id }});"
|
||||
onDblClick="recordPreviewModule.openPreview('FEED',{{ record.getNumber }},{{ entry.id }});"
|
||||
>
|
||||
<div style="padding: 4px;">
|
||||
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
sbas="{{ record.databoxId }}"
|
||||
id="{{ prefix|default('IMGT') }}_{{ record.id }}"
|
||||
class="IMGT diapo {% if record.story %}grouping{% endif %} type-{{ record.type }}"
|
||||
onDblClick="openPreview('{{ record.story ? 'REG' : 'RESULT' }}', '{{ record.position|default(0) }}', '{{ record.id }}');">
|
||||
onDblClick="recordPreviewModule.openPreview('{{ record.story ? 'REG' : 'RESULT' }}', '{{ record.position|default(0) }}', '{{ record.id }}');">
|
||||
<div style="padding: 4px;">
|
||||
<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) }}">
|
||||
@@ -103,7 +103,7 @@
|
||||
{% if granted_on_collection(record.baseId, 'canputinalbum') and not record.story %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="evt_add_in_chutier('{{record.databoxId}}','{{record.recordId}}',false,this);return(false);">
|
||||
onclick="prodModule.addToBasket('{{record.databoxId}}','{{record.recordId}}',false,this);return(false);">
|
||||
{{ 'action : ajouter au panier' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -111,14 +111,14 @@
|
||||
{% if granted_on_collection(record.baseId, 'candwnldpreview') or granted_on_collection(record.baseId, 'candwnldhd') %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="evt_dwnl('{{record.id}}',false,this);return(false);">
|
||||
onclick="prodModule.openDownloadModal('{{record.id}}','lst');return(false);">
|
||||
{{ 'action : exporter' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="evt_print('{{record.id}}');return(false);">
|
||||
onclick="prodModule.openPrintModal('{{record.id}}');return(false);">
|
||||
{{ 'action : print' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -128,7 +128,7 @@
|
||||
{% if record.story is empty %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="shareThis('{{record.baseId}}','{{record.recordId}}');">
|
||||
onclick="prodModule.openShareModal('{{record.baseId}}','{{record.recordId}}');">
|
||||
{{ 'reponses:: partager' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user