mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 21:43:18 +00:00
wip: remove prod js modules dependencies
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)))searchResultModule.gotopage(parseInt(this.value))" type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini" />';
|
||||
$string .= '<input type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini search-navigate-input-action" data-initial-value="' . $i . '" data-total-pages="'.$npages.'"/>';
|
||||
else
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . $i . ");return false;' class='btn btn-primary btn-mini'>" . $i . "</a>";
|
||||
$string .= '<a class="btn btn-primary btn-mini search-navigate-action" data-page="'.$i.'">' . $i . '</a>';
|
||||
}
|
||||
if ($npages > 4)
|
||||
$string .= "<a id='NEXT_PAGE' class='btn btn-primary btn-mini'></a>";
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . ($npages) . ");return false;' class='btn btn-primary btn-mini' id='last'></a>";
|
||||
$string .= '<a href="#" class="btn btn-primary btn-mini search-navigate-action" data-page="' . $npages . '" id="last"></a>';
|
||||
} else {
|
||||
$start = $npages - 4;
|
||||
if (($start) > 0){
|
||||
$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>";
|
||||
$string .= '<a class="btn btn-primary btn-mini search-navigate-action" data-page="1" 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)))searchResultModule.gotopage(parseInt(this.value))" type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini" />';
|
||||
$string .= '<input type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini search-navigate-input-action" data-initial-value="' . $i . '" data-total-pages="'.$npages.'" />';
|
||||
else
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . $i . ");return false;' class='btn btn-primary btn-mini'>" . $i . "</a>";
|
||||
$string .= '<a class="btn btn-primary btn-mini search-navigate-action" data-page="'.$i.'">' . $i . '</a>';
|
||||
}
|
||||
if($page < $npages){
|
||||
$string .= "<a id='NEXT_PAGE' class='btn btn-primary btn-mini'></a>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$string .= "<a onclick='searchResultModule.gotopage(1);return false;' class='btn btn-primary btn-mini' id='first'></a>";
|
||||
$string .= '<a class="btn btn-primary btn-mini btn-mini search-navigate-action" data-page="1" 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)))searchResultModule.gotopage(parseInt(this.value))" type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini" />';
|
||||
$string .= '<input type="text" value="' . $i . '" size="' . (strlen((string) $i)) . '" class="btn btn-mini search-navigate-input-action" data-initial-value="' . $i . '" data-total-pages="'.$npages.'" />';
|
||||
else
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . $i . ");return false;' class='btn btn-primary btn-mini'>" . $i . "</a>";
|
||||
$string .= '<a class="btn btn-primary btn-mini search-navigate-action" data-page="'.$i.'">' . $i . '</a>';
|
||||
}
|
||||
|
||||
$string .= "<a onclick='searchResultModule.gotopage(" . ($npages) . ");return false;' class='btn btn-primary btn-mini' id='last'></a>";
|
||||
$string .= '<a href="#" class="btn btn-primary btn-mini search-navigate-action" data-page="' . $npages . '" id="last"></a>';
|
||||
}
|
||||
}
|
||||
$string .= '<div style="display:none;"><div id="NEXT_PAGE"></div><div id="PREV_PAGE"></div></div>';
|
||||
|
@@ -76,14 +76,7 @@ class RootController extends Controller
|
||||
|
||||
$thjslist = "";
|
||||
|
||||
$queries_topics = '';
|
||||
|
||||
$conf = $this->getConf();
|
||||
if ($conf->get(['registry', 'classic', 'render-topics']) == 'popups') {
|
||||
$queries_topics = \queries::dropdown_topics($this->app['translator'], $this->app['locale']);
|
||||
} elseif ($conf->get(['registry', 'classic', 'render-topics']) == 'tree') {
|
||||
$queries_topics = \queries::tree_topics($this->app['locale']);
|
||||
}
|
||||
|
||||
$sbas = $bas2sbas = [];
|
||||
|
||||
@@ -130,9 +123,7 @@ class RootController extends Controller
|
||||
'feeds' => $feeds,
|
||||
'aggregate' => $aggregate,
|
||||
'GV_google_api' => $conf->get(['registry', 'webservices', 'google-charts-enabled']),
|
||||
'queries_topics' => $queries_topics,
|
||||
'search_status' => \databox_status::getSearchStatus($this->app),
|
||||
'queries_history' => \queries::history($this->app, $user->getId()),
|
||||
'thesau_js_list' => $thjslist,
|
||||
'thesau_json_sbas' => json_encode($sbas),
|
||||
'thesau_json_bas2sbas' => json_encode($bas2sbas),
|
||||
|
@@ -1,286 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2016 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
class queries
|
||||
{
|
||||
public static function tree_topics($I18N)
|
||||
{
|
||||
$out = '';
|
||||
|
||||
$xmlTopics = null;
|
||||
$sxTopics = null;
|
||||
|
||||
if (file_exists(__DIR__ . '/../../config/topics/topics_' . $I18N . '.xml'))
|
||||
$xmlTopics = __DIR__ . '/../../config/topics/topics_' . $I18N . '.xml';
|
||||
|
||||
if (! $xmlTopics) {
|
||||
if (file_exists(__DIR__ . '/../../config/topics/topics.xml')) {
|
||||
$xmlTopics = __DIR__ . '/../../config/topics/topics.xml';
|
||||
}
|
||||
}
|
||||
|
||||
$cssTopics = '';
|
||||
if ($xmlTopics && false !== $sxTopics = simplexml_load_file($xmlTopics)) {
|
||||
$cssTopics = (string) $sxTopics->display->css;
|
||||
}
|
||||
|
||||
$out .= '<style type="text/css">
|
||||
' . $cssTopics . '
|
||||
</style>';
|
||||
|
||||
$out .='<div class="searchZone" >
|
||||
<div class="linktopics1" >';
|
||||
|
||||
if ($sxTopics) {
|
||||
$defaultview = mb_strtolower($sxTopics->display->defaultview);
|
||||
if ( ! $defaultview)
|
||||
$defaultview = 'static';
|
||||
$out .= ( "<ul id='TOPIC_UL' class='nobox'>\n");
|
||||
$out .= self::drawTopics($sxTopics->topics, 0, '', $defaultview);
|
||||
$out .= ( "\n</ul>\n");
|
||||
}
|
||||
|
||||
$out .= '</div>
|
||||
</div>';
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
public static function topics_exists($I18n)
|
||||
{
|
||||
if (file_exists(__DIR__ . '/../../config/topics/topics_' . $I18n . '.xml')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (file_exists(__DIR__ . '/../../config/topics/topics.xml')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function dropdown_topics(TranslatorInterface $translator, $I18n)
|
||||
{
|
||||
$out = '';
|
||||
|
||||
$xmlTopics = '';
|
||||
$sxTopics = null;
|
||||
|
||||
if (file_exists(__DIR__ . '/../../config/topics/topics_' . $I18n . '.xml'))
|
||||
$xmlTopics = __DIR__ . '/../../config/topics/topics_' . $I18n . '.xml';
|
||||
|
||||
if ($xmlTopics == '') {
|
||||
if (file_exists(__DIR__ . '/../../config/topics/topics.xml')) {
|
||||
$xmlTopics = __DIR__ . '/../../config/topics/topics.xml';
|
||||
}
|
||||
}
|
||||
|
||||
if ($xmlTopics == '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
$jsTopics = 'null';
|
||||
$maxdepth = 0;
|
||||
if (false !== $sxTopics = simplexml_load_file($xmlTopics)) {
|
||||
$jsTopics = self::topicsAsJS($sxTopics->topics, 0, $maxdepth);
|
||||
}
|
||||
|
||||
$out .= ' <script type="text/javascript">
|
||||
var maxdepth = ' . ($maxdepth + 1) . ';
|
||||
var topics = ' . $jsTopics . ';
|
||||
var current_popqry = "";
|
||||
|
||||
function doSearchTopPop(qry)
|
||||
{
|
||||
var qft = document.forms["pops"].qry.value;
|
||||
if(qft != "" && current_popqry != "")
|
||||
qry = "("+qft+") AND ("+current_popqry+")";
|
||||
else
|
||||
qry = qft+current_popqry;
|
||||
|
||||
if(qry=="")
|
||||
qry = "all";
|
||||
|
||||
prodModule.doSpecialSearch(qry,true);
|
||||
|
||||
return;
|
||||
}
|
||||
function chgPopTopic(ipop)
|
||||
{
|
||||
if(ipop > ' . ($maxdepth + 1) . ')
|
||||
|
||||
return;
|
||||
var i,j;
|
||||
var _topics = topics;
|
||||
var zpop;
|
||||
current_popqry = "";
|
||||
for (i=0; _topics && i<ipop; i++) {
|
||||
zpop = document.forms["pops"]["popTopic_"+i];
|
||||
if((j = zpop.selectedIndex) > 0)
|
||||
current_popqry = zpop.options[j].value;
|
||||
j--;
|
||||
if(_topics[j] && _topics[j].topics)
|
||||
_topics = _topics[j].topics;
|
||||
else
|
||||
_topics = null;
|
||||
}
|
||||
if(ipop == ' . ($maxdepth + 1) . ')
|
||||
|
||||
return;
|
||||
zpop = document.forms["pops"]["popTopic_"+ipop];
|
||||
if (_topics) {
|
||||
while(zpop.options[0])
|
||||
zpop.options[0] = null;
|
||||
zpop.options[0] = new Option("All", "");
|
||||
for(j=0; j<_topics.length; j++)
|
||||
zpop.options[j+1] = new Option(_topics[j].label, _topics[j].query);
|
||||
zpop.selectedIndex = 0;
|
||||
document.getElementById("divTopic_"+ipop).style.display = "";
|
||||
} else {
|
||||
document.getElementById("divTopic_"+ipop).style.display = "none";
|
||||
}
|
||||
while (++ipop <= ' . $maxdepth . ') {
|
||||
document.getElementById("divTopic_"+ipop).style.display = "none";
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
|
||||
$out .= '<div class="searchZonePop" onload="chgPopTopic(0);">
|
||||
<div class="linktopics1">
|
||||
<form name="pops" onsubmit="return(false);" style="margin:0px; margin-left:5px; margin-right:5px">
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">' . $translator->trans('boutton::chercher') . ' :
|
||||
<input style="width:180px" type="text" name="qry"></td>
|
||||
</tr>
|
||||
</table>
|
||||
' . $translator->trans('client::recherche: dans les categories') . '<br/>';
|
||||
|
||||
for ($i = 0; $i <= $maxdepth; $i ++) {
|
||||
$out .= '<p id="divTopic_' . $i . '" style="margin:0px;margin-bottom:5px;" >
|
||||
<select style="width:100%;" id="popTopic_' . $i . '" name="popTopic_' . $i . '" onchange="chgPopTopic(' . ($i + 1) . ');">
|
||||
</select>
|
||||
</p>';
|
||||
}
|
||||
$out .= '<div style="text-align:right;">
|
||||
<input type="submit" value="' . $translator->trans('boutton::chercher') . '" onclick="doSearchTopPop();" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>chgPopTopic(0);</script>';
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
public static function history(Application $app, $usrId)
|
||||
{
|
||||
$history = '<ul>';
|
||||
|
||||
$queries = $app['repo.user-queries']->findBy(['user' => $usrId], ['created' => 'ASC'], 25, 0);
|
||||
|
||||
foreach ($queries as $query) {
|
||||
$history .= '<li onclick="prodModule.doSpecialSearch(\'' . str_replace(["'", '"'], ["\'", '"'], $query->getQuery()) . '\')">' . $query->getQuery() . '</li>';
|
||||
}
|
||||
|
||||
$history .= '<ul>';
|
||||
|
||||
return $history;
|
||||
}
|
||||
|
||||
private static function hastopics(&$topics)
|
||||
{
|
||||
foreach ($topics->topics as $subtopic) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static function topicsAsJS($topics, $depth, &$maxdepth)
|
||||
{
|
||||
if ($depth > $maxdepth)
|
||||
$maxdepth = $depth;
|
||||
$t = '';
|
||||
$tab = str_repeat("\t", $depth);
|
||||
foreach ($topics->topic as $subtopic) {
|
||||
$t .= $t ? "$tab, " : "$tab ";
|
||||
$t .= '{ ';
|
||||
$t .= 'label:"' . p4string::MakeString(utf8_decode($subtopic->label), 'js') . '"';
|
||||
if ($q = $subtopic->query) {
|
||||
$q = str_replace(["\\", "'", "\r", "\n"], ["\\\\", "\\'", "\\r", "\\n"], $subtopic->query);
|
||||
$t .= ", query:'" . $q . "'";
|
||||
} else {
|
||||
$t .= ', query:null';
|
||||
}
|
||||
if (self::hastopics($subtopic)) {
|
||||
$t .= ', topics:' . "\n" . self::topicsAsJS($subtopic->topics, $depth + 1, $maxdepth); //, $fullquery) ;
|
||||
} else {
|
||||
$t .= ', topics:null';
|
||||
}
|
||||
$t .= " }\n";
|
||||
}
|
||||
|
||||
return("$tab" . "[\n" . $t . "\n$tab]");
|
||||
}
|
||||
|
||||
private static function drawTopics($topics, $depth = 0, $triid = '', $defaultview)
|
||||
{
|
||||
$n = 0;
|
||||
$out = '';
|
||||
foreach ($topics->topic as $subtopic) {
|
||||
$tid = $triid . '_' . $n;
|
||||
$s = $subtopic->label;
|
||||
$l = p4string::MakeString($s, 'html');
|
||||
$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="prodModule.doSpecialSearch(\'' . $q . '\',true);">' . $l . '</a>';
|
||||
} else {
|
||||
$q = $l;
|
||||
}
|
||||
if (self::hastopics($subtopic)) {
|
||||
$view = mb_strtolower($subtopic['view']);
|
||||
if ( ! $view)
|
||||
$view = $defaultview;
|
||||
switch ($view) {
|
||||
case 'opened':
|
||||
$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="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");
|
||||
break;
|
||||
case 'static':
|
||||
default:
|
||||
$out .= ( '<li><span id=\'TOPIC_TRI' . $tid . '\' class="static"> </span> ' . $q . '</li>' . "\n");
|
||||
$out .= ( "<ul id='TOPIC_UL$tid' class='static'>\n");
|
||||
$out .= self::drawTopics($subtopic->topics, $depth + 1, $tid, $defaultview);
|
||||
$out .= ( "</ul>\n<div style='height:1px;'></div>\n");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$out .= ( '<li><span id=\'TOPIC_TRI' . $tid . '\' class="none"> </span> ' . $q . '</li>' . "\n");
|
||||
}
|
||||
$n ++;
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
}
|
@@ -65,20 +65,20 @@ gulp.task('build-prod-css', ['build-prod-skin-black', 'build-prod-skin-grey', 'b
|
||||
});
|
||||
gulp.task('build-prod-js', function(){
|
||||
var prodGroup = [
|
||||
config.paths.vendors + 'underscore-amd/underscore.js',
|
||||
// config.paths.vendors + 'underscore-amd/underscore.js',
|
||||
config.paths.src + 'vendors/colorpicker/js/colorpicker.js',
|
||||
config.paths.vendors + 'jquery.lazyload/jquery.lazyload.js',
|
||||
config.paths.vendors + 'humane-js/humane.js', // @TODO > extra files
|
||||
//config.paths.vendors + 'jquery.lazyload/jquery.lazyload.js',
|
||||
// config.paths.vendors + 'humane-js/humane.js', // @TODO > extra files
|
||||
config.paths.vendors + 'blueimp-load-image/js/load-image.js', // @TODO > extra files
|
||||
config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js',
|
||||
config.paths.vendors + 'jquery-file-upload/js/jquery.fileupload.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/selectable.js',
|
||||
//config.paths.src + 'prod/js/core/selectable.js',
|
||||
config.paths.src + 'prod/js/core/alert.js',
|
||||
|
||||
config.paths.src + 'prod/js/components/search/search.js',
|
||||
config.paths.src + 'prod/js/components/search/search-result.js',
|
||||
//config.paths.src + 'prod/js/components/search/search.js',
|
||||
//config.paths.src + 'prod/js/components/search/search-result.js',
|
||||
// config.paths.src + 'prod/js/components/publication.js',
|
||||
// config.paths.src + 'prod/js/components/workzone/workzone.js',
|
||||
// config.paths.src + 'prod/js/components/workzone/workzone-basket.js',
|
||||
@@ -86,10 +86,10 @@ gulp.task('build-prod-js', function(){
|
||||
// config.paths.src + 'prod/js/components/workzone/workzone-thesaurus.js',
|
||||
// config.paths.src + 'prod/js/components/cgu.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/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 + 'vendors/jquery-sprintf/js/jquery.sprintf.1.0.3.js',
|
||||
//config.paths.src + 'prod/js/components/preview/preview.js',
|
||||
|
@@ -1,450 +0,0 @@
|
||||
(function (window) {
|
||||
|
||||
function checkVocabId(VocabularyId) {
|
||||
if (typeof VocabularyId === 'undefined')
|
||||
VocabularyId = null;
|
||||
|
||||
if (VocabularyId === '')
|
||||
VocabularyId = null;
|
||||
|
||||
return VocabularyId;
|
||||
}
|
||||
|
||||
var recordFieldValue = function (meta_id, value, VocabularyId) {
|
||||
|
||||
VocabularyId = checkVocabId(VocabularyId);
|
||||
|
||||
this.datas = {
|
||||
meta_id: meta_id,
|
||||
value: value,
|
||||
VocabularyId: VocabularyId
|
||||
};
|
||||
|
||||
var $this = this;
|
||||
};
|
||||
|
||||
recordFieldValue.prototype = {
|
||||
getValue: function () {
|
||||
return this.datas.value;
|
||||
},
|
||||
getMetaId: function () {
|
||||
return this.datas.meta_id;
|
||||
},
|
||||
getVocabularyId: function () {
|
||||
return this.datas.VocabularyId;
|
||||
},
|
||||
setValue: function (value, VocabularyId) {
|
||||
|
||||
this.datas.value = value;
|
||||
this.datas.VocabularyId = checkVocabId(VocabularyId);
|
||||
return this;
|
||||
},
|
||||
remove: function () {
|
||||
this.datas.value = '';
|
||||
this.datas.VocabularyId = null;
|
||||
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
var databoxField = function (name, label, meta_struct_id, options) {
|
||||
|
||||
var defaults = {
|
||||
multi: false,
|
||||
required: false,
|
||||
readonly: false,
|
||||
maxLength: null,
|
||||
minLength: null,
|
||||
type: 'string',
|
||||
separator: null,
|
||||
vocabularyControl: null,
|
||||
vocabularyRestricted: false
|
||||
},
|
||||
options = (typeof options == 'object') ? options : {};
|
||||
|
||||
if (isNaN(meta_struct_id)) {
|
||||
throw 'meta_struct_id should be a number';
|
||||
}
|
||||
|
||||
this.name = name;
|
||||
this.label = label;
|
||||
this.meta_struct_id = meta_struct_id;
|
||||
this.options = jQuery.extend(defaults, options);
|
||||
|
||||
if (this.options.multi === true && this.options.separator === null) {
|
||||
this.options.separator = ';';
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
databoxField.prototype = {
|
||||
getMetaStructId: function () {
|
||||
return this.meta_struct_id;
|
||||
},
|
||||
getName: function () {
|
||||
return this.name;
|
||||
},
|
||||
getLabel: function () {
|
||||
return this.label;
|
||||
},
|
||||
isMulti: function () {
|
||||
return this.options.multi;
|
||||
},
|
||||
isRequired: function () {
|
||||
return this.options.required;
|
||||
},
|
||||
isReadonly: function () {
|
||||
return this.options.readonly;
|
||||
},
|
||||
getMaxLength: function () {
|
||||
return this.options.maxLength;
|
||||
},
|
||||
getMinLength: function () {
|
||||
return this.options.minLength;
|
||||
},
|
||||
getType: function () {
|
||||
return this.options.type;
|
||||
},
|
||||
getSeparator: function () {
|
||||
return this.options.separator;
|
||||
}
|
||||
};
|
||||
|
||||
var recordField = function (databoxField, arrayValues) {
|
||||
|
||||
this.databoxField = databoxField;
|
||||
this.options = {
|
||||
dirty: false
|
||||
};
|
||||
this.datas = new Array();
|
||||
|
||||
if (arrayValues instanceof Array) {
|
||||
if (arrayValues.length > 1 && !databoxField.isMulti())
|
||||
throw 'You can not add multiple values to a non multi field ' + databoxField.getName();
|
||||
|
||||
var first = true;
|
||||
|
||||
for (v in arrayValues) {
|
||||
if (typeof arrayValues[v] !== 'object') {
|
||||
if (window.console) {
|
||||
console.error('Trying to add a non-recordFieldValue to the field...');
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isNaN(arrayValues[v].getMetaId())) {
|
||||
if (window.console) {
|
||||
console.error('Trying to add a recordFieldValue without metaId...');
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!first && this.options.multi === false) {
|
||||
if (window.console) {
|
||||
console.error('Trying to add multi values in a non-multi field');
|
||||
}
|
||||
}
|
||||
|
||||
if (window.console) {
|
||||
console.log('adding a value : ', arrayValues[v]);
|
||||
}
|
||||
|
||||
this.datas.push(arrayValues[v]);
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
|
||||
var $this = this;
|
||||
}
|
||||
recordField.prototype = {
|
||||
getName: function () {
|
||||
return this.databoxField.getName();
|
||||
},
|
||||
getMetaStructId: function () {
|
||||
return this.databoxField.getMetaStructId();
|
||||
},
|
||||
isMulti: function () {
|
||||
return this.databoxField.isMulti();
|
||||
},
|
||||
isRequired: function () {
|
||||
return this.databoxField.isRequired();
|
||||
},
|
||||
isDirty: function () {
|
||||
return this.options.dirty;
|
||||
},
|
||||
addValue: function (value, merge, VocabularyId) {
|
||||
|
||||
VocabularyId = checkVocabId(VocabularyId);
|
||||
|
||||
merge = !!merge;
|
||||
|
||||
if (this.databoxField.isReadonly()) {
|
||||
if (window.console) {
|
||||
console.error('Unable to set a value to a readonly field');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.console) {
|
||||
console.log('adding value ', value, ' vocId : ', VocabularyId, ' ; merge is ', merge);
|
||||
}
|
||||
|
||||
if (this.isMulti()) {
|
||||
if (!this.hasValue(value, VocabularyId)) {
|
||||
if (window.console) {
|
||||
console.log('adding new multi value ', value);
|
||||
}
|
||||
this.datas.push(new recordFieldValue(null, value, VocabularyId));
|
||||
this.options.dirty = true;
|
||||
}
|
||||
else {
|
||||
if (window.console) {
|
||||
console.log('already have ', value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (merge === true && this.isEmpty() === false && VocabularyId === null) {
|
||||
if (window.console) {
|
||||
console.log('Merging value ', value);
|
||||
}
|
||||
this.datas[0].setValue(this.datas[0].getValue() + ' ' + value, VocabularyId);
|
||||
|
||||
this.options.dirty = true;
|
||||
}
|
||||
else {
|
||||
if (merge === true && this.isEmpty() === false && VocabularyId !== null) {
|
||||
if (window.console) {
|
||||
console.error('Cannot merge vocabularies');
|
||||
}
|
||||
this.datas[0].setValue(value, VocabularyId);
|
||||
}
|
||||
else {
|
||||
|
||||
if (!this.hasValue(value, VocabularyId)) {
|
||||
if (this.datas.length === 0) {
|
||||
if (window.console) {
|
||||
console.log('Adding new value ', value);
|
||||
}
|
||||
this.datas.push(new recordFieldValue(null, value, VocabularyId));
|
||||
}
|
||||
else {
|
||||
if (window.console) {
|
||||
console.log('Updating value ', value);
|
||||
}
|
||||
this.datas[0].setValue(value, VocabularyId);
|
||||
}
|
||||
this.options.dirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
hasValue: function (value, VocabularyId) {
|
||||
|
||||
if (typeof value === 'undefined') {
|
||||
if (window.console) {
|
||||
console.error('Trying to check the presence of an undefined value');
|
||||
}
|
||||
}
|
||||
|
||||
VocabularyId = checkVocabId(VocabularyId);
|
||||
|
||||
for (d in this.datas) {
|
||||
if (VocabularyId !== null) {
|
||||
if (this.datas[d].getVocabularyId() === VocabularyId) {
|
||||
if (window.console) {
|
||||
console.log('already got the vocab ID');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (this.datas[d].getVocabularyId() === null && this.datas[d].getValue() == value) {
|
||||
if (window.console) {
|
||||
console.log('already got this value');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
removeValue: function (value, vocabularyId) {
|
||||
|
||||
if (this.databoxField.isReadonly()) {
|
||||
if (window.console) {
|
||||
console.error('Unable to set a value to a readonly field');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
vocabularyId = checkVocabId(vocabularyId);
|
||||
|
||||
if (window.console) {
|
||||
console.log('Try to remove value ', value, vocabularyId, this.datas);
|
||||
}
|
||||
|
||||
for (d in this.datas) {
|
||||
if (window.console) {
|
||||
console.log('loopin... ', this.datas[d].getValue());
|
||||
}
|
||||
if (this.datas[d].getVocabularyId() !== null) {
|
||||
if (this.datas[d].getVocabularyId() == vocabularyId) {
|
||||
if (window.console) {
|
||||
console.log('Found within the vocab ! removing... ');
|
||||
}
|
||||
this.datas[d].remove();
|
||||
this.options.dirty = true;
|
||||
}
|
||||
}
|
||||
else if (this.datas[d].getValue() == value) {
|
||||
if (window.console) {
|
||||
console.log('Found ! removing... ');
|
||||
}
|
||||
this.datas[d].remove();
|
||||
this.options.dirty = true;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
isEmpty: function () {
|
||||
var empty = true;
|
||||
|
||||
for (d in this.datas) {
|
||||
if (this.datas[d].getValue() !== '')
|
||||
empty = false;
|
||||
}
|
||||
return empty;
|
||||
},
|
||||
empty: function () {
|
||||
|
||||
if (this.databoxField.isReadonly()) {
|
||||
if (window.console) {
|
||||
console.error('Unable to set a value to a readonly field');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (d in this.datas) {
|
||||
this.datas[d].remove();
|
||||
this.options.dirty = true;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
getValue: function () {
|
||||
|
||||
if (this.isMulti())
|
||||
throw 'This field is multi, I can not give you a single value';
|
||||
|
||||
if (this.isEmpty())
|
||||
return null;
|
||||
|
||||
return this.datas[0];
|
||||
},
|
||||
getValues: function () {
|
||||
|
||||
if (!this.isMulti()) {
|
||||
throw 'This field is not multi, I can not give you multiple values';
|
||||
}
|
||||
|
||||
if (this.isEmpty())
|
||||
return new Array();
|
||||
|
||||
var arrayValues = [];
|
||||
|
||||
for (d in this.datas) {
|
||||
if (this.datas[d].getValue() === '')
|
||||
continue;
|
||||
|
||||
arrayValues.push(this.datas[d]);
|
||||
}
|
||||
|
||||
return arrayValues;
|
||||
},
|
||||
sort: function (algo) {
|
||||
this.datas.sort(algo);
|
||||
|
||||
return this;
|
||||
},
|
||||
getSerializedValues: function () {
|
||||
|
||||
var arrayValues = [];
|
||||
var values = this.getValues();
|
||||
|
||||
for (v in values) {
|
||||
arrayValues.push(values[v].getValue());
|
||||
}
|
||||
|
||||
return arrayValues.join(' ; ');
|
||||
},
|
||||
replaceValue: function (search, replace) {
|
||||
|
||||
if (this.databoxField.isReadonly()) {
|
||||
if (window.console) {
|
||||
console.error('Unable to set a value to a readonly field');
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
var n = 0;
|
||||
|
||||
for (d in this.datas) {
|
||||
if (this.datas[d].getVocabularyId() !== null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var value = this.datas[d].getValue();
|
||||
var replacedValue = value.replace(search, replace);
|
||||
|
||||
if (value === replacedValue) {
|
||||
continue;
|
||||
}
|
||||
|
||||
n++;
|
||||
|
||||
this.removeValue(value);
|
||||
|
||||
if (!this.hasValue(replacedValue)) {
|
||||
this.addValue(replacedValue);
|
||||
}
|
||||
|
||||
this.options.dirty = true;
|
||||
}
|
||||
|
||||
return n;
|
||||
},
|
||||
exportDatas: function () {
|
||||
|
||||
var returnValue = new Array();
|
||||
|
||||
for (d in this.datas) {
|
||||
var temp = {
|
||||
meta_id: this.datas[d].getMetaId() ? this.datas[d].getMetaId() : '',
|
||||
meta_struct_id: this.getMetaStructId(),
|
||||
value: this.datas[d].getValue()
|
||||
};
|
||||
|
||||
if (this.datas[d].getVocabularyId()) {
|
||||
temp.vocabularyId = this.datas[d].getVocabularyId();
|
||||
}
|
||||
returnValue.push(temp);
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
};
|
||||
|
||||
window.p4 = window.p4 || {};
|
||||
|
||||
window.p4.databoxField = databoxField;
|
||||
window.p4.recordFieldValue = recordFieldValue;
|
||||
window.p4.recordField = recordField;
|
||||
|
||||
})(window);
|
@@ -1,32 +0,0 @@
|
||||
var p4 = p4 || {};
|
||||
|
||||
var searchResultModule = (function (p4, window) {
|
||||
|
||||
p4.Results = {
|
||||
'Selection': new Selectable($('#answers'), {
|
||||
selector: '.IMGT',
|
||||
limit: 800,
|
||||
selectStart: function (event, selection) {
|
||||
$('#answercontextwrap table:visible').hide();
|
||||
},
|
||||
selectStop: function (event, selection) {
|
||||
prodApp.appEvents.emit('search.doRefreshSelection')
|
||||
},
|
||||
callbackSelection: function (element) {
|
||||
var elements = $(element).attr('id').split('_');
|
||||
|
||||
return elements.slice(elements.length - 2, elements.length).join('_');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
function gotopage(pag) {
|
||||
$('#searchForm input[name="sel"]').val(p4.Results.Selection.serialize());
|
||||
$('#formAnswerPage').val(pag);
|
||||
$('#searchForm').submit();
|
||||
}
|
||||
|
||||
return {
|
||||
gotopage: gotopage
|
||||
};
|
||||
}(p4, window));
|
@@ -1,12 +0,0 @@
|
||||
var p4 = p4 || {};
|
||||
|
||||
var searchModule = (function (p4) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
|
||||
};
|
||||
}(p4));
|
@@ -1,254 +0,0 @@
|
||||
;
|
||||
var p4 = p4 || {};
|
||||
|
||||
;
|
||||
(function (p4, $) {
|
||||
|
||||
/**
|
||||
* UPLOADER MANAGER
|
||||
*/
|
||||
var UploaderManager = function (options) {
|
||||
|
||||
var options = options || {};
|
||||
|
||||
if (false === ("container" in options)) {
|
||||
throw "missing container parameter";
|
||||
}
|
||||
else if (!options.container.jquery) {
|
||||
throw "container parameter must be a jquery dom element";
|
||||
}
|
||||
|
||||
if (false === ("settingsBox" in options)) {
|
||||
throw "missing settingBox parameter";
|
||||
}
|
||||
else if (!options.settingsBox.jquery) {
|
||||
throw "container parameter must be a jquery dom element";
|
||||
}
|
||||
|
||||
if (false === ("uploadBox" in options)) {
|
||||
throw "missing uploadBox parameter";
|
||||
}
|
||||
else if (!options.uploadBox.jquery) {
|
||||
throw "container parameter must be a jquery dom element";
|
||||
}
|
||||
|
||||
if (false === ("downloadBox" in options)) {
|
||||
throw "missing downloadBox parameter";
|
||||
}
|
||||
else if (!options.downloadBox.jquery) {
|
||||
throw "container parameter must be a jquery dom element";
|
||||
}
|
||||
|
||||
this.recordClass = options.recordClass || 'upload-record';
|
||||
|
||||
this.options = options;
|
||||
|
||||
this.options.uploadBox.wrapInner('<ul class="thumbnails" />');
|
||||
|
||||
this.options.uploadBox = this.options.uploadBox.find('ul:first');
|
||||
|
||||
this.options.downloadBox.wrapInner('<ul class="thumbnails" />');
|
||||
|
||||
this.options.downloadBox = this.options.downloadBox.find('ul:first');
|
||||
|
||||
if ($.isFunction($.fn.sortable)) {
|
||||
this.options.uploadBox.sortable();
|
||||
}
|
||||
|
||||
this.uploadIndex = 0;
|
||||
|
||||
this.Queue = new Queue();
|
||||
this.Formater = new Formater();
|
||||
this.Preview = new Preview();
|
||||
};
|
||||
|
||||
UploaderManager.prototype = {
|
||||
setOptions: function (options) {
|
||||
return $.extend(this.options, options);
|
||||
},
|
||||
getContainer: function () {
|
||||
return this.options.container;
|
||||
},
|
||||
getUploadBox: function () {
|
||||
return this.options.uploadBox;
|
||||
},
|
||||
getSettingsBox: function () {
|
||||
return this.options.settingsBox;
|
||||
},
|
||||
getDownloadBox: function () {
|
||||
return this.options.downloadBox;
|
||||
},
|
||||
clearUploadBox: function () {
|
||||
this.getUploadBox().empty();
|
||||
this.uploadIndex = 0;
|
||||
this.Queue.clear();
|
||||
},
|
||||
getDatas: function () {
|
||||
return this.Queue.all();
|
||||
},
|
||||
getData: function (index) {
|
||||
return this.Queue.get(index);
|
||||
},
|
||||
addData: function (data) {
|
||||
this.uploadIndex++;
|
||||
data.uploadIndex = this.uploadIndex;
|
||||
this.Queue.set(this.uploadIndex, data);
|
||||
},
|
||||
removeData: function (index) {
|
||||
this.Queue.remove(index);
|
||||
},
|
||||
addAttributeToData: function (indexOfData, attribute, value) {
|
||||
var data = this.getData(indexOfData);
|
||||
if ($.type(attribute) === "string") {
|
||||
data[attribute] = value;
|
||||
this.Queue.set(indexOfData, data);
|
||||
}
|
||||
},
|
||||
getUploadIndex: function () {
|
||||
return this.uploadIndex;
|
||||
},
|
||||
hasData: function () {
|
||||
return !this.Queue.isEmpty();
|
||||
},
|
||||
countData: function () {
|
||||
return this.Queue.getLength();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* PREVIEW
|
||||
*
|
||||
* Dependency : loadImage function
|
||||
* @see https://github.com/blueimp/JavaScript-Load-Image
|
||||
*
|
||||
* Options
|
||||
* maxWidth: (int) Max width of preview
|
||||
* maxHeight: (int) Max height of preview
|
||||
* minWidth: (int) Min width of preview
|
||||
* minHeight: (int) Min height of preview
|
||||
* canva: (boolean) render preview as canva if supported by the navigator
|
||||
*/
|
||||
|
||||
var Preview = function () {
|
||||
this.options = {
|
||||
fileType: /^image\/(gif|jpeg|png|jpg)$/,
|
||||
maxSize: 5242880 // 5MB
|
||||
};
|
||||
};
|
||||
|
||||
Preview.prototype = {
|
||||
setOptions: function (options) {
|
||||
this.options = $.extend(this.options, options);
|
||||
},
|
||||
getOptions: function () {
|
||||
return this.options;
|
||||
},
|
||||
render: function (file, callback) {
|
||||
if (typeof loadImage === 'function' && this.options.fileType.test(file.type)) {
|
||||
if ($.type(this.options.maxSize) !== 'number' || file.size < this.options.maxSize) {
|
||||
var options = {
|
||||
maxWidth: this.options.maxWidth || 150,
|
||||
maxHeight: this.options.maxHeight || 75,
|
||||
minWidth: this.options.minWidth || 80,
|
||||
minHeight: this.options.minHeight || 40,
|
||||
canvas: this.options.canva || true
|
||||
};
|
||||
loadImage(file, callback, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* FORMATER
|
||||
*/
|
||||
|
||||
var Formater = function () {
|
||||
|
||||
};
|
||||
|
||||
Formater.prototype = {
|
||||
size: function (bytes) {
|
||||
if (typeof bytes !== 'number') {
|
||||
throw bytes + ' is not a number';
|
||||
}
|
||||
if (bytes >= 1073741824) {
|
||||
return (bytes / 1073741824).toFixed(2) + ' GB';
|
||||
}
|
||||
if (bytes >= 1048576) {
|
||||
return (bytes / 1048576).toFixed(2) + ' MB';
|
||||
}
|
||||
return (bytes / 1024).toFixed(2) + ' KB';
|
||||
},
|
||||
bitrate: function (bits) {
|
||||
if (typeof bits !== 'number') {
|
||||
throw bits + ' is not a number';
|
||||
}
|
||||
// 1 byte = 8 bits
|
||||
var bytes = (bits >> 3);
|
||||
|
||||
if (bytes >= (1 << 30)) {
|
||||
return (bytes / (1 << 30)).toFixed(2) + ' Go/s';
|
||||
}
|
||||
if (bytes >= (1 << 20)) {
|
||||
return (bytes / (1 << 20)).toFixed(2) + ' Mo/s';
|
||||
}
|
||||
if (bytes >= (1 << 10)) {
|
||||
return (bytes / (1 << 10)).toFixed(2) + ' Ko/s';
|
||||
}
|
||||
return bytes + ' o/s';
|
||||
},
|
||||
pourcent: function (current, total) {
|
||||
return (current / total * 100).toFixed(2);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* QUEUE
|
||||
*/
|
||||
var Queue = function () {
|
||||
this.list = {};
|
||||
};
|
||||
|
||||
Queue.prototype = {
|
||||
all: function () {
|
||||
return this.list;
|
||||
},
|
||||
set: function (id, item) {
|
||||
this.list[id] = item;
|
||||
return this;
|
||||
},
|
||||
get: function (id) {
|
||||
if (!this.list[id]) {
|
||||
throw 'Unknown ID' + id;
|
||||
}
|
||||
return this.list[id];
|
||||
},
|
||||
remove: function (id) {
|
||||
delete this.list[id];
|
||||
},
|
||||
getLength: function () {
|
||||
var count = 0;
|
||||
for (var k in this.list) {
|
||||
if (this.list.hasOwnProperty(k)) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
},
|
||||
isEmpty: function () {
|
||||
return this.getLength() === 0;
|
||||
},
|
||||
clear: function () {
|
||||
var $this = this;
|
||||
$.each(this.list, function (k) {
|
||||
$this.remove(k);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
p4.UploaderManager = UploaderManager;
|
||||
|
||||
})(p4, jQuery);
|
@@ -1,324 +0,0 @@
|
||||
/*
|
||||
var videoEditorModule = (function (document) {
|
||||
|
||||
/!*****************
|
||||
* Canva Object
|
||||
*****************!/
|
||||
var Canva = function (domCanva) {
|
||||
this.domCanva = domCanva;
|
||||
};
|
||||
|
||||
Canva.prototype = {
|
||||
resize: function (elementDomNode, forceWidth) {
|
||||
|
||||
var w = elementDomNode.getWidth();
|
||||
var h = null;
|
||||
var maxH = elementDomNode.getHeight();
|
||||
var ratio = 1;
|
||||
|
||||
if ('' !== elementDomNode.getAspectRatio()) {
|
||||
ratio = parseFloat(elementDomNode.getAspectRatio());
|
||||
|
||||
h = Math.round(w * (1 / ratio));
|
||||
|
||||
if (h > maxH) {
|
||||
h = maxH;
|
||||
w = Math.round(h * ratio);
|
||||
}
|
||||
} else {
|
||||
h = maxH;
|
||||
}
|
||||
|
||||
if( forceWidth !== undefined ) {
|
||||
w = parseInt(forceWidth, 10);
|
||||
|
||||
if (elementDomNode.getAspectRatio() !== '') {
|
||||
h = Math.round(w * (1 / ratio));
|
||||
} else {
|
||||
h = maxH;
|
||||
}
|
||||
}
|
||||
|
||||
this.domCanva.setAttribute("width", w);
|
||||
this.domCanva.setAttribute("height", h);
|
||||
|
||||
return this;
|
||||
},
|
||||
getContext2d: function () {
|
||||
|
||||
if (undefined === this.domCanva.getContext) {
|
||||
return G_vmlCanvasManager
|
||||
.initElement(this.domCanva)
|
||||
.getContext("2d");
|
||||
}
|
||||
|
||||
return this.domCanva.getContext('2d');
|
||||
},
|
||||
extractImage: function () {
|
||||
return this.domCanva.toDataURL("image/png");
|
||||
},
|
||||
reset: function () {
|
||||
var context = this.getContext2d();
|
||||
var w = this.getWidth();
|
||||
var h = this.getHeight();
|
||||
|
||||
context.save();
|
||||
context.setTransform(1, 0, 0, 1, 0, 0);
|
||||
context.clearRect(0, 0, w, h);
|
||||
context.restore();
|
||||
|
||||
return this;
|
||||
},
|
||||
copy: function (elementDomNode) {
|
||||
var context = this.getContext2d();
|
||||
|
||||
context.drawImage(
|
||||
elementDomNode.getDomElement()
|
||||
, 0
|
||||
, 0
|
||||
, this.getWidth()
|
||||
, this.getHeight()
|
||||
);
|
||||
|
||||
return this;
|
||||
},
|
||||
getDomElement: function () {
|
||||
return this.domCanva;
|
||||
},
|
||||
getHeight: function () {
|
||||
return this.domCanva.offsetHeight;
|
||||
},
|
||||
getWidth: function () {
|
||||
return this.domCanva.offsetWidth;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/!******************
|
||||
* Image Object
|
||||
******************!/
|
||||
var Image = function (domElement) {
|
||||
this.domElement = domElement;
|
||||
};
|
||||
|
||||
Image.prototype = {
|
||||
getDomElement: function () {
|
||||
return this.domElement;
|
||||
},
|
||||
getHeight: function () {
|
||||
return this.domElement.offsetHeight;
|
||||
},
|
||||
getWidth: function () {
|
||||
return this.domElement.offsetWidth;
|
||||
}
|
||||
};
|
||||
|
||||
/!******************
|
||||
* Video Object inherits from Image object
|
||||
******************!/
|
||||
|
||||
var Video = function (domElement) {
|
||||
Image.call(this, domElement);
|
||||
this.aspectRatio = domElement.getAttribute('data-ratio');
|
||||
};
|
||||
|
||||
Video.prototype = new Image();
|
||||
Video.prototype.constructor = Video;
|
||||
Video.prototype.getCurrentTime = function () {
|
||||
return Math.floor(this.domElement.currentTime);
|
||||
};
|
||||
Video.prototype.getAspectRatio = function () {
|
||||
return this.aspectRatio;
|
||||
};
|
||||
|
||||
/!******************
|
||||
* Cache Object
|
||||
******************!/
|
||||
var Store = function () {
|
||||
this.datas = {};
|
||||
};
|
||||
|
||||
Store.prototype = {
|
||||
set: function (id, item) {
|
||||
this.datas[id] = item;
|
||||
return this;
|
||||
},
|
||||
get: function (id) {
|
||||
if (!this.datas[id]) {
|
||||
throw 'Unknown ID';
|
||||
}
|
||||
return this.datas[id];
|
||||
},
|
||||
remove: function (id) {
|
||||
// never reuse same id
|
||||
this.datas[id] = null;
|
||||
},
|
||||
getLength: function () {
|
||||
var count = 0;
|
||||
for (var k in this.datas) {
|
||||
if (this.datas.hasOwnProperty(k)) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
};
|
||||
|
||||
/!******************
|
||||
* Screenshot Object
|
||||
******************!/
|
||||
var ScreenShot = function (id, canva, video, altCanvas) {
|
||||
|
||||
var date = new Date();
|
||||
var options = options || {};
|
||||
canva.resize(video);
|
||||
canva.copy(video);
|
||||
|
||||
// handle alternative canvas:
|
||||
var altCanvas = altCanvas == undefined ? [] : altCanvas;
|
||||
this.altScreenShots = [];
|
||||
if( altCanvas.length > 0 ) {
|
||||
for(var i = 0; i< altCanvas.length; i++) {
|
||||
var canvaEl = altCanvas[i].el;
|
||||
canvaEl.resize(video, altCanvas[i].width);
|
||||
canvaEl.copy(video);
|
||||
|
||||
this.altScreenShots.push({
|
||||
dataURI: canvaEl.extractImage(),
|
||||
name: altCanvas[i].name
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
this.id = id;
|
||||
this.timestamp = date.getTime();
|
||||
this.dataURI = canva.extractImage();
|
||||
this.videoTime = video.getCurrentTime();
|
||||
|
||||
};
|
||||
|
||||
ScreenShot.prototype = {
|
||||
getId: function () {
|
||||
return this.id;
|
||||
},
|
||||
getDataURI: function () {
|
||||
return this.dataURI;
|
||||
},
|
||||
getTimeStamp: function () {
|
||||
return this.timestamp;
|
||||
},
|
||||
getVideoTime: function () {
|
||||
return this.videoTime;
|
||||
},
|
||||
getAltScreenShots: function() {
|
||||
return this.altScreenShots;
|
||||
}
|
||||
};
|
||||
|
||||
/!**
|
||||
* THUMB EDITOR
|
||||
*!/
|
||||
var ThumbnailEditor = function (videoId, canvaId, outputOptions) {
|
||||
|
||||
var domElement = document.getElementById(videoId);
|
||||
|
||||
if (null !== domElement) {
|
||||
var editorVideo = new Video(domElement);
|
||||
}
|
||||
var store = new Store();
|
||||
|
||||
function getCanva() {
|
||||
return document.getElementById(canvaId);
|
||||
}
|
||||
|
||||
var outputOptions = outputOptions || {};
|
||||
|
||||
function setAltCanvas() {
|
||||
var domElements = [],
|
||||
altCanvas = outputOptions.altCanvas;
|
||||
if( altCanvas.length > 0 ) {
|
||||
for(var i = 0; i< altCanvas.length; i++) {
|
||||
domElements.push({
|
||||
el: new Canva(altCanvas[i]),
|
||||
width: altCanvas[i].getAttribute('data-width'),
|
||||
name: altCanvas[i].getAttribute('data-name')
|
||||
} );
|
||||
}
|
||||
}
|
||||
return domElements;
|
||||
}
|
||||
|
||||
return {
|
||||
isSupported: function () {
|
||||
var elem = document.createElement('canvas');
|
||||
|
||||
return !!document.getElementById(videoId) && document.getElementById(canvaId)
|
||||
&& !!elem.getContext && !!elem.getContext('2d');
|
||||
},
|
||||
screenshot: function () {
|
||||
var screenshot = new ScreenShot(
|
||||
store.getLength() + 1,
|
||||
new Canva(getCanva()),
|
||||
editorVideo,
|
||||
setAltCanvas()
|
||||
);
|
||||
|
||||
store.set(screenshot.getId(), screenshot);
|
||||
|
||||
return screenshot;
|
||||
},
|
||||
store: store,
|
||||
copy: function (mainSource, altSources) {
|
||||
|
||||
var elementDomNode = document.createElement('img');
|
||||
elementDomNode.src = mainSource;
|
||||
|
||||
var element = new Image(elementDomNode);
|
||||
var editorCanva = new Canva(getCanva());
|
||||
var altEditorCanva = setAltCanvas();
|
||||
editorCanva
|
||||
.reset()
|
||||
.resize(editorVideo)
|
||||
.copy(element);
|
||||
|
||||
|
||||
// handle alternative canvas:
|
||||
if( altEditorCanva.length > 0 ) {
|
||||
for(var i = 0; i< altEditorCanva.length; i++) {
|
||||
|
||||
var tmpEl = document.createElement('img');
|
||||
tmpEl.src = altSources[i].dataURI;
|
||||
|
||||
var canvaEl = altEditorCanva[i].el;
|
||||
|
||||
canvaEl
|
||||
.reset()
|
||||
.resize(editorVideo, altEditorCanva[i].width)
|
||||
.copy(new Image(tmpEl)); // @TODO: should copy the right stored image
|
||||
}
|
||||
}
|
||||
},
|
||||
getCanvaImage: function () {
|
||||
var canva = new Canva(getCanva());
|
||||
|
||||
return canva.extractImage();
|
||||
},
|
||||
resetCanva: function () {
|
||||
var editorCanva = new Canva(getCanva());
|
||||
editorCanva.reset();
|
||||
},
|
||||
getNbScreenshot: function () {
|
||||
return store.getLength();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// document.THUMB_EDITOR = ThumbEditor;
|
||||
|
||||
return {
|
||||
ThumbnailEditor: ThumbnailEditor
|
||||
}
|
||||
|
||||
})(document);
|
||||
|
||||
*/
|
@@ -1,223 +0,0 @@
|
||||
/*
|
||||
* Selection Object
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
(function (window) {
|
||||
|
||||
var Selectable = function ($container, options) {
|
||||
|
||||
var defaults = {
|
||||
allow_multiple: false,
|
||||
selector: '',
|
||||
callbackSelection: null,
|
||||
selectStart: null,
|
||||
selectStop: null,
|
||||
limit: null
|
||||
},
|
||||
options = (typeof options == 'object') ? options : {};
|
||||
|
||||
var $this = this;
|
||||
|
||||
if ($container.data('selectionnable')) {
|
||||
/* this container is already selectionnable */
|
||||
if (window.console) {
|
||||
console.error('Trying to apply new selection to existing one');
|
||||
}
|
||||
|
||||
return $container.data('selectionnable');
|
||||
}
|
||||
|
||||
this.$container = $container;
|
||||
this.options = jQuery.extend(defaults, options);
|
||||
this.datas = new Array();
|
||||
|
||||
this.$container.data('selectionnable', this);
|
||||
this.$container.addClass('selectionnable');
|
||||
this.$container
|
||||
.on('click', this.options.selector, function(event) {
|
||||
event.preventDefault();
|
||||
if (typeof $this.options.selectStart === 'function') {
|
||||
$this.options.selectStart(jQuery.extend(jQuery.Event('selectStart'), event), $this);
|
||||
}
|
||||
|
||||
var $that = jQuery(this);
|
||||
|
||||
var k = get_value($that, $this);
|
||||
|
||||
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);
|
||||
var index2 = jQuery.inArray($that[0], lst);
|
||||
|
||||
if (index2 < index1) {
|
||||
var tmp = index1;
|
||||
index1 = (index2 - 1) < 0 ? index2 : (index2 - 1);
|
||||
index2 = tmp;
|
||||
}
|
||||
|
||||
var stopped = false;
|
||||
|
||||
if (index2 != -1 && index1 != -1) {
|
||||
var exp = $this.options.selector + ':gt(' + index1 + '):lt(' + (index2 - index1) + ')';
|
||||
|
||||
$.each(jQuery(exp, this.$container), function (i, n) {
|
||||
if (!jQuery(n).hasClass('selected') && stopped === false) {
|
||||
if (!$this.hasReachLimit()) {
|
||||
var k = get_value(jQuery(n), $this);
|
||||
$this.push(k);
|
||||
jQuery(n).addClass('selected');
|
||||
}
|
||||
else {
|
||||
alert(language.max_record_selected);
|
||||
stopped = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($this.has(k) === false && stopped === false) {
|
||||
if (!$this.hasReachLimit()) {
|
||||
$this.push(k);
|
||||
$that.addClass('selected');
|
||||
}
|
||||
else {
|
||||
alert(language.max_record_selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!utilsModule.is_ctrl_key(event)) {
|
||||
$this.empty().push(k);
|
||||
jQuery('.selected', this.$container).filter($this.options.selector).removeClass('selected');
|
||||
$that.addClass('selected');
|
||||
}
|
||||
else {
|
||||
if ($this.has(k) === true) {
|
||||
$this.remove(k);
|
||||
$that.removeClass('selected');
|
||||
}
|
||||
else {
|
||||
if (!$this.hasReachLimit()) {
|
||||
$this.push(k);
|
||||
$that.addClass('selected');
|
||||
}
|
||||
else {
|
||||
alert(language.max_record_selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jQuery('.last_selected', this.$container).removeClass('last_selected');
|
||||
$that.addClass('last_selected');
|
||||
|
||||
|
||||
if (typeof $this.options.selectStop === 'function') {
|
||||
$this.options.selectStop(jQuery.extend(jQuery.Event('selectStop'), event), $this);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
function get_value(element, Selectable) {
|
||||
if (typeof Selectable.options.callbackSelection === 'function') {
|
||||
return Selectable.options.callbackSelection(jQuery(element));
|
||||
}
|
||||
else {
|
||||
return jQuery('input[name="id"]', jQuery(element)).val();
|
||||
}
|
||||
}
|
||||
|
||||
Selectable.prototype = {
|
||||
push: function (element) {
|
||||
if (this.options.allow_multiple === true || !this.has(element)) {
|
||||
this.datas.push(element);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
hasReachLimit: function () {
|
||||
if (this.options.limit !== null && this.options.limit <= this.datas.length) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
remove: function (element) {
|
||||
this.datas = jQuery.grep(this.datas, function (n) {
|
||||
return(n !== element);
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
has: function (element) {
|
||||
|
||||
return jQuery.inArray(element, this.datas) >= 0;
|
||||
},
|
||||
get: function () {
|
||||
|
||||
return this.datas;
|
||||
},
|
||||
empty: function () {
|
||||
var $this = this;
|
||||
this.datas = new Array();
|
||||
|
||||
jQuery(this.options.selector, this.$container).filter('.selected:visible').removeClass('selected');
|
||||
|
||||
if (typeof $this.options.selectStop === 'function') {
|
||||
$this.options.selectStop(jQuery.Event('selectStop'), $this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
length: function () {
|
||||
|
||||
return this.datas.length;
|
||||
},
|
||||
size: function () {
|
||||
|
||||
return this.datas.length;
|
||||
},
|
||||
serialize: function (separator) {
|
||||
|
||||
separator = separator || ';';
|
||||
|
||||
return this.datas.join(separator);
|
||||
},
|
||||
selectAll: function () {
|
||||
this.select('*');
|
||||
|
||||
return this;
|
||||
},
|
||||
select: function (selector) {
|
||||
var $this = this,
|
||||
stopped = false;
|
||||
|
||||
jQuery(this.options.selector, this.$container).filter(selector).not('.selected').filter(':visible').each(function () {
|
||||
if (!$this.hasReachLimit()) {
|
||||
$this.push(get_value(this, $this));
|
||||
$(this).addClass('selected');
|
||||
}
|
||||
else {
|
||||
if (stopped === false) {
|
||||
alert(language.max_record_selected);
|
||||
}
|
||||
stopped = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (typeof $this.options.selectStop === 'function') {
|
||||
$this.options.selectStop(jQuery.Event('selectStop'), $this);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
window.Selectable = Selectable;
|
||||
})(window);
|
@@ -10,103 +10,23 @@ var bodySize = {
|
||||
y: 0
|
||||
};
|
||||
|
||||
var prodModule = (function (p4, humane) {
|
||||
|
||||
var prodModule = (function (p4) {
|
||||
console.log('prod')
|
||||
p4.preview = {
|
||||
open: false,
|
||||
current: false
|
||||
};
|
||||
p4.sel = [];
|
||||
p4.edit = {};
|
||||
p4.thesau = {
|
||||
tabs: null
|
||||
};
|
||||
p4.active_zone = false;
|
||||
|
||||
function doSpecialSearch(qry, allbase) {
|
||||
if (allbase) {
|
||||
prodApp.appEvents.emit('search.doToggleDatabase', true);
|
||||
}
|
||||
prodApp.appEvents.emit('facets.doResetSelectedFacets');
|
||||
$('#EDIT_query').val(decodeURIComponent(qry).replace(/\+/g, " "));
|
||||
prodApp.appEvents.emit('search.doNewSearch', qry);
|
||||
}
|
||||
|
||||
function addToBasket(sbas_id, record_id, event, singleSelection) {
|
||||
var singleSelection = singleSelection || false;
|
||||
p4.WorkZone.addElementToBasket(sbas_id, record_id, event, singleSelection);
|
||||
}
|
||||
|
||||
function removeFromBasket(el, confirm) {
|
||||
/*function removeFromBasket(el, confirm) {
|
||||
var confirm = confirm || false;
|
||||
p4.WorkZone.removeElementFromBasket(el, confirm);
|
||||
}
|
||||
|
||||
/*function openRecordEditor(type, value) {
|
||||
|
||||
$('#idFrameE').empty().addClass('loading');
|
||||
commonModule.showOverlay(2);
|
||||
|
||||
$('#EDITWINDOW').show();
|
||||
|
||||
var options = {
|
||||
lst: '',
|
||||
ssel: '',
|
||||
act: ''
|
||||
};
|
||||
|
||||
switch (type) {
|
||||
case "IMGT":
|
||||
options.lst = value;
|
||||
break;
|
||||
|
||||
case "SSTT":
|
||||
options.ssel = value;
|
||||
break;
|
||||
|
||||
case "STORY":
|
||||
options.story = value;
|
||||
break;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "../prod/records/edit/",
|
||||
type: "POST",
|
||||
dataType: "html",
|
||||
data: options,
|
||||
success: function (data) {
|
||||
recordEditorModule.initialize();
|
||||
$('#idFrameE').removeClass('loading').empty().html(data);
|
||||
$('#tooltip').hide();
|
||||
return;
|
||||
},
|
||||
error: function (XHR, textStatus, errorThrown) {
|
||||
if (XHR.status === 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
function toggleTopic(id) {
|
||||
var o = $('#TOPIC_UL' + id);
|
||||
if ($('#TOPIC_UL' + id).hasClass('closed'))
|
||||
$('#TOPIC_TRI' + id + ' ,#TOPIC_UL' + id).removeClass('closed').addClass('opened');
|
||||
else
|
||||
$('#TOPIC_TRI' + id + ' ,#TOPIC_UL' + id).removeClass('opened').addClass('closed');
|
||||
}
|
||||
|
||||
return {
|
||||
doSpecialSearch: doSpecialSearch,
|
||||
addToBasket: addToBasket,
|
||||
removeFromBasket: removeFromBasket,
|
||||
toggleTopic: toggleTopic
|
||||
}
|
||||
})(p4, humane);
|
||||
removeFromBasket: removeFromBasket
|
||||
}*/
|
||||
})(p4);
|
||||
|
||||
//var language = {}; // handled with external prodution module
|
||||
|
||||
|
@@ -67,7 +67,7 @@
|
||||
{% set link = path('upload_flash_form') %}
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ link }}" class="dialog full-dialog" title="{{ 'Upload' | trans }}">
|
||||
<a href="{{ link }}" class="uploader-open-action" title="{{ 'Upload' | trans }}">
|
||||
<span>
|
||||
{{ 'admin::monitor: module upload' | trans }}
|
||||
</span>
|
||||
|
@@ -10,55 +10,3 @@
|
||||
{{ 'Ajouter ma selection courrante' | trans }}
|
||||
</label>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
var $dialog = dialogModule.dialog.get(1);
|
||||
var $dialogBox = $dialog.getDomElement();
|
||||
|
||||
$('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize());
|
||||
|
||||
var buttons = $dialog.getOption('buttons');
|
||||
|
||||
buttons[language.create] = function(){
|
||||
$('form', $dialogBox).trigger('submit')
|
||||
};
|
||||
|
||||
$dialog.setOption('buttons', buttons);
|
||||
|
||||
$('form', $dialogBox).bind('submit', function(event){
|
||||
|
||||
var $form = $(this);
|
||||
var dialog = $dialogBox.closest('.ui-dialog');
|
||||
var buttonPanel = dialog.find('.ui-dialog-buttonpane');
|
||||
|
||||
$.ajax({
|
||||
type: $form.attr('method'),
|
||||
url: $form.attr('action'),
|
||||
data: $form.serializeArray(),
|
||||
dataType: 'json',
|
||||
beforeSend:function(){
|
||||
$(":button:contains('" + language.create + "')", buttonPanel)
|
||||
.attr("disabled", true).addClass("ui-state-disabled");
|
||||
},
|
||||
success: function(data){
|
||||
|
||||
p4.WorkZone.refresh(data.basket.id);
|
||||
dialogModule.dialog.close(1);
|
||||
|
||||
return;
|
||||
},
|
||||
error: function(){
|
||||
$(":button:contains('" + language.create + "')", buttonPanel)
|
||||
.attr("disabled", false).removeClass("ui-state-disabled");
|
||||
},
|
||||
timeout: function(){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@@ -34,187 +34,3 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var container = $('#reorder_box');
|
||||
|
||||
$('button.autoorder', container).bind('click', function(){
|
||||
autoorder();
|
||||
return false;
|
||||
});
|
||||
$('button.reverseorder', container).bind('click', function(){
|
||||
reverse_order();
|
||||
return false;
|
||||
});
|
||||
|
||||
function autoorder()
|
||||
{
|
||||
var val = $.trim($('#auto_order').val());
|
||||
|
||||
if(val == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
var diapos = [];
|
||||
$('#reorder_box .diapo form').each(function(i,n){
|
||||
diapos.push({
|
||||
"title": $('input[name=title]',n).val(),
|
||||
"order" : parseInt($('input[name=default]',n).val()),
|
||||
"id" : $('input[name=id]',n).val()
|
||||
});
|
||||
});
|
||||
|
||||
var sorterCallback;
|
||||
|
||||
if (val === "default") {
|
||||
sorterCallback = function(diapo) {return diapo.order;};
|
||||
} else {
|
||||
sorterCallback = function(diapo) {return diapo.title;};
|
||||
}
|
||||
|
||||
var elements = [];
|
||||
|
||||
_.chain(diapos)
|
||||
.sortBy(sorterCallback)
|
||||
.each(function(diapo) {
|
||||
elements.push($('#ORDER_'+ diapo.id));
|
||||
});
|
||||
|
||||
$('#reorder_box .elements').append(elements);
|
||||
}
|
||||
|
||||
function reverse_order() {
|
||||
var $container = $('#reorder_box .elements');
|
||||
$('#reorder_box .diapo').each(function() {
|
||||
$(this).prependTo($container);
|
||||
});
|
||||
}
|
||||
|
||||
$('.elements', container).sortable({
|
||||
appendTo : container,
|
||||
placeholder: 'diapo ui-sortable-placeholder',
|
||||
distance:20,
|
||||
cursorAt: {
|
||||
top:10,
|
||||
left:-20
|
||||
},
|
||||
items:'div.diapo',
|
||||
scroll:true,
|
||||
scrollSensitivity:40,
|
||||
scrollSpeed:30,
|
||||
start:function(event, ui){
|
||||
var selected = $('.selected',container);
|
||||
|
||||
selected.each(function(i,n){
|
||||
$(n).attr('position',i);
|
||||
});
|
||||
|
||||
var n = selected.length - 1;
|
||||
|
||||
$('.selected:visible', container).hide();
|
||||
|
||||
while(n > 0){
|
||||
$('<div style="height:130px;" class="diapo ui-sortable-placeholderfollow"></div>').after($('.diapo.ui-sortable-placeholder', container));
|
||||
n--;
|
||||
}
|
||||
},
|
||||
stop:function(event, ui){
|
||||
|
||||
$('.diapo.ui-sortable-placeholderfollow', container).remove();
|
||||
|
||||
var main_id = $(ui.item[0]).attr('id');
|
||||
|
||||
var selected = $('.selected',container);
|
||||
var sorter = new Array();
|
||||
|
||||
|
||||
selected.each(function(i,n){
|
||||
|
||||
var position = parseInt($(n).attr('position'));
|
||||
|
||||
if(position !== '') {
|
||||
sorter[position] = $(n);
|
||||
}
|
||||
|
||||
var id = $(n).attr('id');
|
||||
if(id == main_id) {
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var before = true;
|
||||
var last_moved = $(ui.item[0]);
|
||||
$(sorter).each(function(i,n){
|
||||
$(n).show().removeAttr('position');
|
||||
if($(n).attr('id') == main_id){
|
||||
before = false;
|
||||
} else {
|
||||
if(before){
|
||||
$(n).before($(ui.item[0]));
|
||||
} else{
|
||||
$(n).after($(last_moved));
|
||||
}
|
||||
|
||||
}
|
||||
last_moved = sorter[i];
|
||||
});
|
||||
|
||||
},
|
||||
change:function(){
|
||||
$('.diapo.ui-sortable-placeholderfollow', container).remove();
|
||||
|
||||
var n = OrderSelection.length() - 1 ;
|
||||
while(n > 0) {
|
||||
$('<div style="height:130px;" class="diapo ui-sortable-placeholderfollow"></div>').after($('.diapo.ui-sortable-placeholder', container));
|
||||
n--;
|
||||
}
|
||||
}
|
||||
|
||||
}).disableSelection();
|
||||
|
||||
var OrderSelection = new Selectable($('.elements', container), {
|
||||
selector : '.CHIM'
|
||||
});
|
||||
|
||||
$('form[name="reorder"]', container).bind('submit', function(event){
|
||||
|
||||
//$this.SetLoader(true);
|
||||
var $form = $(this);
|
||||
|
||||
$('.elements form', container).each(function(i, el){
|
||||
var id = $('input[name="id"]', $(el)).val();
|
||||
|
||||
$('input[name="element[' + id + ']"]', $form).val(i+1);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: $form.attr('method'),
|
||||
url: $form.attr('action'),
|
||||
data: $form.serializeArray(),
|
||||
dataType: 'json',
|
||||
beforeSend:function(){
|
||||
|
||||
},
|
||||
success: function(data){
|
||||
if(!data.success) {
|
||||
alert(data.message);
|
||||
}
|
||||
p4.WorkZone.refresh('current');
|
||||
dialogModule.dialog.get(1).close();
|
||||
|
||||
return;
|
||||
},
|
||||
error: function(){
|
||||
|
||||
},
|
||||
timeout: function(){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@@ -6,48 +6,4 @@
|
||||
<textarea style="width:98%;height:120px;" name="description">{{ basket.getDescription() }}</textarea>
|
||||
<button type='button' class="btn btn-inverse" style="margin: 5px 40%;">{{ 'boutton::valider' | trans }}</button>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('form[name="basket-rename-box"]').on('submit', function(event){
|
||||
event.preventDefault();
|
||||
onSubmitRenameForm(event);
|
||||
});
|
||||
|
||||
$('#basket-rename-box button').on('click', function(event){
|
||||
event.preventDefault();
|
||||
onSubmitRenameForm(event);
|
||||
});
|
||||
|
||||
var onSubmitRenameForm = function(event) {
|
||||
var $form = $(event.currentTarget).closest('form');
|
||||
$.ajax({
|
||||
type: $form.attr('method'),
|
||||
url: $form.attr('action'),
|
||||
dataType: 'json',
|
||||
data: $form.serializeArray(),
|
||||
beforeSend:function(){
|
||||
|
||||
},
|
||||
success: function(data){
|
||||
$dialog = dialogModule.dialog.get(1).close();
|
||||
if(data.success) {
|
||||
humane.info(data.message);
|
||||
return p4.WorkZone.refresh(data.basket.id);
|
||||
} else {
|
||||
humane.error(data.message);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
|
||||
},
|
||||
timeout: function(){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
@@ -14,55 +14,4 @@
|
||||
<input type="checkbox" name="lst" value="" id="new_story_add_sel"/>
|
||||
{{ 'Ajouter ma selection courrante' | trans }}
|
||||
</label>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var $dialog = dialogModule.dialog.get(1);
|
||||
var $dialogBox = $dialog.getDomElement();
|
||||
|
||||
$('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize());
|
||||
|
||||
var buttons = $dialog.getOption('buttons');
|
||||
|
||||
buttons[language.create] = function(){
|
||||
$('form', $dialogBox).trigger('submit')
|
||||
};
|
||||
|
||||
$dialog.setOption('buttons', buttons);
|
||||
|
||||
$('form', $dialogBox).bind('submit', function(event){
|
||||
|
||||
var $form = $(this);
|
||||
var dialog = $dialogBox.closest('.ui-dialog');
|
||||
var buttonPanel = dialog.find('.ui-dialog-buttonpane');
|
||||
|
||||
$.ajax({
|
||||
type: $form.attr('method'),
|
||||
url: $form.attr('action'),
|
||||
data: $form.serializeArray(),
|
||||
dataType: 'json',
|
||||
beforeSend:function(){
|
||||
$(":button:contains('" + language.create + "')", buttonPanel)
|
||||
.attr("disabled", true).addClass("ui-state-disabled");
|
||||
},
|
||||
success: function(data){
|
||||
|
||||
p4.WorkZone.refresh(data.WorkZone, '', true, 'story');
|
||||
dialogModule.dialog.close(1);
|
||||
|
||||
return;
|
||||
},
|
||||
error: function(){
|
||||
$(":button:contains('" + language.create + "')", buttonPanel)
|
||||
.attr("disabled", false).removeClass("ui-state-disabled");
|
||||
},
|
||||
timeout: function(){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</form>
|
||||
|
@@ -34,195 +34,3 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var optionsContainer = $('#reorder_options');
|
||||
var container = $('#reorder_box');
|
||||
|
||||
$('button.autoorder', optionsContainer).bind('click', function(){
|
||||
autoorder();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('button.reverseorder', optionsContainer).bind('click', function(){
|
||||
reverse_order();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
function autoorder()
|
||||
{
|
||||
var val = $.trim($('#auto_order').val());
|
||||
|
||||
if(val == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
var diapos = [];
|
||||
$('#reorder_box .diapo form').each(function(i,n){
|
||||
diapos.push({
|
||||
"title": $('input[name=title]',n).val(),
|
||||
"order" : parseInt($('input[name=default]',n).val()),
|
||||
"id" : $('input[name=id]',n).val()
|
||||
});
|
||||
});
|
||||
|
||||
var sorterCallback;
|
||||
|
||||
if (val === "default") {
|
||||
sorterCallback = function(diapo) {return diapo.order;};
|
||||
} else {
|
||||
sorterCallback = function(diapo) {return diapo.title;};
|
||||
}
|
||||
|
||||
var elements = [];
|
||||
|
||||
_.chain(diapos)
|
||||
.sortBy(sorterCallback)
|
||||
.each(function(diapo) {
|
||||
elements.push($('#ORDER_'+ diapo.id));
|
||||
});
|
||||
|
||||
$('#reorder_box .elements').append(elements);
|
||||
}
|
||||
|
||||
function reverse_order() {
|
||||
var $container = $('#reorder_box .elements');
|
||||
$('#reorder_box .diapo').each(function() {
|
||||
$(this).prependTo($container);
|
||||
});
|
||||
}
|
||||
|
||||
$('.elements', container).sortable({
|
||||
appendTo : container,
|
||||
placeholder: 'diapo ui-sortable-placeholder',
|
||||
distance:20,
|
||||
cursorAt: {
|
||||
top:10,
|
||||
left:-20
|
||||
},
|
||||
items:'div.diapo',
|
||||
scroll:true,
|
||||
scrollSensitivity:40,
|
||||
scrollSpeed:30,
|
||||
start:function(event, ui){
|
||||
var selected = $('.selected',container);
|
||||
|
||||
selected.each(function(i,n){
|
||||
$(n).attr('position',i);
|
||||
});
|
||||
|
||||
var n = selected.length - 1;
|
||||
|
||||
$('.selected:visible', container).hide();
|
||||
|
||||
while(n > 0)
|
||||
{
|
||||
$('<div style="height:130px;" class="diapo ui-sortable-placeholderfollow"></div>').after($('.diapo.ui-sortable-placeholder', container));
|
||||
n--;
|
||||
}
|
||||
},
|
||||
stop:function(event, ui){
|
||||
|
||||
$('.diapo.ui-sortable-placeholderfollow', container).remove();
|
||||
|
||||
var main_id = $(ui.item[0]).attr('id');
|
||||
|
||||
var selected = $('.selected',container);
|
||||
var sorter = new Array();
|
||||
|
||||
|
||||
selected.each(function(i,n){
|
||||
|
||||
var position = parseInt($(n).attr('position'));
|
||||
|
||||
if(position !== '')
|
||||
{
|
||||
sorter[position] = $(n);
|
||||
}
|
||||
|
||||
var id = $(n).attr('id');
|
||||
if(id == main_id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var before = true;
|
||||
var last_moved = $(ui.item[0]);
|
||||
$(sorter).each(function(i,n){
|
||||
$(n).show().removeAttr('position');
|
||||
if($(n).attr('id') == main_id)
|
||||
{
|
||||
before = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(before)
|
||||
$(n).before($(ui.item[0]));
|
||||
else
|
||||
$(n).after($(last_moved));
|
||||
|
||||
}
|
||||
last_moved = sorter[i];
|
||||
});
|
||||
|
||||
},
|
||||
change:function(){
|
||||
$('.diapo.ui-sortable-placeholderfollow', container).remove();
|
||||
|
||||
var n = OrderSelection.length() - 1 ;
|
||||
while(n > 0)
|
||||
{
|
||||
$('<div style="height:130px;" class="diapo ui-sortable-placeholderfollow"></div>').after($('.diapo.ui-sortable-placeholder', container));
|
||||
n--;
|
||||
}
|
||||
}
|
||||
|
||||
}).disableSelection();
|
||||
|
||||
var OrderSelection = new Selectable($('.elements', container), {
|
||||
selector : '.CHIM'
|
||||
});
|
||||
|
||||
|
||||
$('form[name="reorder"] button').bind('click', function(event){
|
||||
var $form = $(this).closest("form");
|
||||
|
||||
$('.elements form', container).each(function(i, el){
|
||||
var id = $('input[name="id"]', $(el)).val();
|
||||
$('input[name="element[' + id + ']"]', $form).val(i+1);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: $form.attr('method'),
|
||||
url: $form.attr('action'),
|
||||
data: $form.serializeArray(),
|
||||
dataType: 'json',
|
||||
beforeSend:function(){
|
||||
|
||||
},
|
||||
success: function(data){
|
||||
if(!data.success) {
|
||||
alert(data.message);
|
||||
}
|
||||
p4.WorkZone.refresh('current', null, false, 'story');
|
||||
dialogModule.dialog.get(1).close();
|
||||
|
||||
return;
|
||||
},
|
||||
error: function(){
|
||||
|
||||
},
|
||||
timeout: function(){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@@ -84,226 +84,3 @@
|
||||
<div class="PNB10 Basket">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
var $container = $('#BasketBrowser'),results = null;
|
||||
|
||||
function loadResults(datas, url)
|
||||
{
|
||||
results = $.ajax({
|
||||
type: 'GET',
|
||||
url: url,
|
||||
dataType: 'html',
|
||||
data: datas,
|
||||
beforeSend: function(){
|
||||
if(results && results.abort && typeof results.abort == 'function')
|
||||
results.abort();
|
||||
$('.results', $container).addClass('loading').empty();
|
||||
},
|
||||
error: function(){
|
||||
$('.results', $container).removeClass('loading');
|
||||
},
|
||||
timeout: function(){
|
||||
$('.results', $container).removeClass('loading');
|
||||
},
|
||||
success: function(data){
|
||||
var results = $('.results', $container);
|
||||
results.removeClass('loading').append(data);
|
||||
activateLinks(results);
|
||||
active_archiver(results);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function loadBasket(url)
|
||||
{
|
||||
results = $.ajax({
|
||||
type: 'GET',
|
||||
url: url,
|
||||
dataType: 'html',
|
||||
beforeSend: function(){
|
||||
if(results && results.abort && typeof results.abort == 'function')
|
||||
results.abort();
|
||||
$('.Browser', $container).hide();
|
||||
$('.Basket', $container).addClass('loading').empty().show();
|
||||
},
|
||||
error: function(){
|
||||
$('.Browser', $container).show();
|
||||
$('.Basket', $container).removeClass('loading').hide();
|
||||
},
|
||||
timeout: function(){
|
||||
$('.Browser', $container).show();
|
||||
$('.Basket', $container).removeClass('loading').hide();
|
||||
},
|
||||
success: function(data){
|
||||
$('.Basket', $container).removeClass('loading').append(data);
|
||||
|
||||
$('.Basket a.back', $container).bind('click', function(){
|
||||
$('.Basket', $container).hide();
|
||||
$('.Browser', $container).show();
|
||||
|
||||
return false;
|
||||
});
|
||||
active_archiver($('.Basket', $container));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function activateLinks($scope)
|
||||
{
|
||||
$('a.result', $scope).bind('click', function(){
|
||||
var $this = $(this);
|
||||
|
||||
loadResults({}, $this.attr('href'));
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a.basket_link', $scope).bind('click', function(){
|
||||
var $this = $(this);
|
||||
|
||||
loadBasket($this.attr('href'));
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a.delete-basket', $scope).bind('click', function(event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this);
|
||||
var buttons = {};
|
||||
|
||||
buttons[language.valider] = function() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: $this.attr('href'),
|
||||
data: {},
|
||||
success: function(datas){
|
||||
if(datas.success) {
|
||||
confirmBox.close();
|
||||
$('form[name="BasketBrowser"]', $container).trigger('submit');
|
||||
p4.WorkZone.refresh();
|
||||
} else {
|
||||
confirmBox.close();
|
||||
var alertBox = dialogModule.dialog.create({
|
||||
size : 'Alert',
|
||||
closeOnEscape : true,
|
||||
closeButton:true
|
||||
}, 2);
|
||||
|
||||
alertBox.setContent(datas.message);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
confirmBox.close();
|
||||
var alertBox = dialogModule.dialog.create({
|
||||
size : 'Alert',
|
||||
closeOnEscape : true,
|
||||
closeButton:true
|
||||
}, 2);
|
||||
|
||||
alertBox.setContent("{{'Something wrong happened, please retry or contact an admin.'|trans|e('js') }}");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var confirmBox = dialogModule.dialog.create({
|
||||
size : 'Alert',
|
||||
closeOnEscape : true,
|
||||
cancelButton: true,
|
||||
buttons: buttons
|
||||
}, 2);
|
||||
|
||||
confirmBox.setContent("{{'You are about to delete this basket. Would you like to continue ?'|trans|e('js') }}");
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function active_archiver($scope)
|
||||
{
|
||||
$('a.UserTips', $scope).bind('click', function(){
|
||||
|
||||
return false;
|
||||
}).tooltip();
|
||||
|
||||
$('.infoTips, .previewTips', $scope).tooltip();
|
||||
|
||||
$('a.archive_toggler', $scope).bind('click', function(){
|
||||
var $this = $(this), parent = $this.parent();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: $this.attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function(){
|
||||
$('.loader',parent).show();
|
||||
$('.archive_toggler:visible', parent).addClass('last_act').hide();
|
||||
},
|
||||
error: function(){
|
||||
$('.loader',parent).hide();
|
||||
$('.last_act', parent).removeClass('last_act').show();
|
||||
},
|
||||
timeout: function(){
|
||||
$('.loader',parent).hide();
|
||||
$('.last_act', parent).removeClass('last_act').show();
|
||||
},
|
||||
success: function(data){
|
||||
$('.loader',parent).hide();
|
||||
$('.last_act', parent).removeClass('last_act');
|
||||
if(!data.success)
|
||||
{
|
||||
humane.error(data.message);
|
||||
|
||||
return;
|
||||
}
|
||||
if(data.archive === true)
|
||||
{
|
||||
$('.unarchiver', parent).show();
|
||||
$('.archiver', parent).hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.unarchiver', parent).hide();
|
||||
$('.archiver', parent).show();
|
||||
}
|
||||
|
||||
p4.WorkZone.refresh();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
$('form[name="BasketBrowser"]', $container).bind('submit', function(){
|
||||
|
||||
var $this = $(this);
|
||||
|
||||
loadResults($this.serializeArray(), $this.attr('action'));
|
||||
|
||||
return false;
|
||||
}).trigger('submit').find('label').bind('click', function(){
|
||||
var input = $(this).prev('input'),
|
||||
name = input.attr('name');
|
||||
|
||||
var inputs = $('input[name="' + $(this).prev('input').attr('name') + '"]', $container);
|
||||
inputs.prop('checked', false).next('label').removeClass('selected');
|
||||
|
||||
input.prop('checked', true).next('label').addClass('selected');
|
||||
$('form[name="BasketBrowser"]', $container).trigger('submit')
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
@@ -149,7 +149,7 @@
|
||||
</div>
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner">
|
||||
<a class="dialog small-dialog" title="{{ 'action::renommer' | trans }}" href="{{ path('prod_baskets_basket_update', { 'basket' : basket.getId()}) }}">
|
||||
<a class="basket-update-action" data-basket-id="{{ basket.getId() }}" title="{{ 'action::renommer' | trans }}" href="#">
|
||||
{{ 'action::renommer' | trans }}
|
||||
</a>
|
||||
</div>
|
||||
@@ -166,19 +166,19 @@
|
||||
{% endif %}
|
||||
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner archive-basket-action" data-basket-id="{{ basket.getId() }}" >
|
||||
<div class="context-menu-item-inner basket-archive-action" data-basket-id="{{ basket.getId() }}" >
|
||||
{{ 'Archive' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner delete-basket-action" id="SSTTREMOVER_{{basket.getId()}}" data-context="SSTT">
|
||||
<div class="context-menu-item-inner basket-delete-action" id="SSTTREMOVER_{{basket.getId()}}" data-context="SSTT">
|
||||
{{ 'action : supprimer' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner">
|
||||
<a class="dialog" title="{{ 'Re-ordonner' | trans }}" href="{{ path('prod_baskets_basket_reorder', { 'basket' : basket.getId() }) }}">
|
||||
<a class="basket-reorder-content-action" data-basket-id="{{ basket.getId() }}" title="{{ 'Re-ordonner' | trans }}" href="#">
|
||||
{{ 'Re-ordonner' | trans }}
|
||||
</a>
|
||||
</div>
|
||||
@@ -245,7 +245,10 @@
|
||||
</div>
|
||||
<div title="" class="context-menu-item menu3-custom-item">
|
||||
<div class="context-menu-item-inner">
|
||||
<a class="dialog" title="{{ 'Re-ordonner' | trans }}" href="{{ path('prod_stories_story_reorder', { 'sbas_id' : story.getRecord(app).get_sbas_id, 'record_id' : story.getRecord(app).get_record_id() }) }}">
|
||||
<a class="story-reorder-content-action" title="{{ 'Re-ordonner' | trans }}"
|
||||
data-db-id="{{ story.getRecord(app).get_sbas_id }}"
|
||||
data-record-id="{{ story.getRecord(app).get_record_id() }}"
|
||||
href="#">
|
||||
{{ 'Re-ordonner' | trans }}
|
||||
</a>
|
||||
</div>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<div class="sbas_list sbas_{{sbas_id}}" style="margin-bottom: 10px;">
|
||||
<input type="hidden" name="reference" value="{{sbas_id}}"/>
|
||||
<div class="clksbas">
|
||||
<span class="toggle-collection deployer_closed" data-database="{{sbas_id}}" ></span>
|
||||
<span class="toggle-collection deployer_closed" data-toggle-content=".sbascont_{{sbas_id}}"></span>
|
||||
<input type="checkbox" checked style="display: none;" id="sbasChkr_{{sbas_id}}_{{unique_id}}" class="select-database sbasChkr_{{sbas_id}}" data-database="{{sbas_id}}" />
|
||||
<label id="ADVSRCH_SBAS_LABEL_{{sbas_id}}" style="display: inline" class="checkbox danger_indicator" for="sbasChkr_{{sbas_id}}_{{unique_id}}">
|
||||
<span>{{sbas_id|sbas_labels(app)}}</span>
|
||||
@@ -114,8 +114,7 @@
|
||||
{{WorkZoneMacros.make_bloc(app, WorkZone)}}
|
||||
</div>
|
||||
{% if GV_thesaurus %}
|
||||
<div id="proposals" class="PNB"
|
||||
ondblclick="return(thesau_dblclickThesaurus(event));" onclick="return(thesau_clickThesaurus(event));">
|
||||
<div id="proposals" class="PNB thesaurus-from-facets-action">
|
||||
<button id="facets-back-btn" style="display:none;">back</button>
|
||||
</div>
|
||||
{% include 'prod/tab_thesaurus.html.twig' with {has_access_to_module: app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('thesaurus')} %}
|
||||
@@ -134,19 +133,19 @@
|
||||
<ul style="list-style-type:none;margin:0;padding:0">
|
||||
<li class="context-menu-item">
|
||||
<div class="context-menu-item-inner">
|
||||
<a title="{{ 'action:: nouveau panier' | trans }}" class="dialog small-dialog" href="{{ path('prod_baskets_create') }}">
|
||||
<a title="{{ 'action:: nouveau panier' | trans }}" class="basket-create-action" href="#">
|
||||
<img style="cursor:pointer;" src="/assets/common/images/icons/mtadd_0.gif" title="{{ 'action:: nouveau panier' | trans }}" />
|
||||
{{ 'action:: nouveau panier' | trans }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="context-menu-item-inner">
|
||||
<a title="{{ 'Browse Baskets' | trans }}" class="dialog" href="{{ path('prod_workzone_browse') }}">
|
||||
<a title="{{ 'Browse Baskets' | trans }}" class="basket-browse-action" href="#">
|
||||
{{ 'Browse Baskets' | trans }}
|
||||
</a>
|
||||
</div>
|
||||
{% if app['conf'].get(['registry', 'modules', 'stories']) and app.getAclForUser(app.getAuthenticatedUser()).has_right('addrecord') %}
|
||||
<div class="context-menu-item-inner">
|
||||
<a title="{{ 'action:: nouveau reportage' | trans }}" class="dialog small-dialog" href="{{ path('prod_stories_create') }}">
|
||||
<a title="{{ 'action:: nouveau reportage' | trans }}" class="story-create-action" href="#">
|
||||
<img style="cursor:pointer;" src="/assets/common/images/icons/mtadd_0.gif" title="{{ 'action:: nouveau reportage' | trans }}" />
|
||||
{{ 'action:: nouveau reportage' | trans }}
|
||||
</a>
|
||||
@@ -154,19 +153,19 @@
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="context-menu-item">
|
||||
<div class="context-menu-item-inner" onclick="return p4.WorkZone.refresh('current','date');">
|
||||
<div class="context-menu-item-inner basket-filter-action" data-sort="date">
|
||||
<img style="cursor:pointer;" src="/assets/common/images/icons/cal.png" title="{{ 'phraseanet:: tri par date' | trans }}" />
|
||||
{{ 'phraseanet:: tri par date' | trans }}
|
||||
</div>
|
||||
</li>
|
||||
<li class="context-menu-item">
|
||||
<div class="context-menu-item-inner" onclick="return p4.WorkZone.refresh('current','name');">
|
||||
<div class="context-menu-item-inner basket-filter-action" data-sort="name">
|
||||
<img style="cursor:pointer;" src="/assets/common/images/icons/alpha.png" title="{{ 'phraseanet:: tri par nom' | trans }}" />
|
||||
{{ 'phraseanet:: tri par nom' | trans }}
|
||||
</div>
|
||||
</li>
|
||||
<li class="context-menu-item">
|
||||
<div class="context-menu-item-inner" onclick="prodApp.appEvents.emit('baskets.doOpenBasketPreferences')">
|
||||
<div class="context-menu-item-inner basket-preferences-action">
|
||||
{{ 'Preferences' | trans }}
|
||||
</div>
|
||||
</li>
|
||||
@@ -298,7 +297,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<span onclick="searchModule.toggleCollection(this, '#ADVSRCH_SB_{{databox_id}}' );return false;" class="deployer_closed" ></span>
|
||||
<span class="toggle-collection deployer_closed" data-toggle-content="#ADVSRCH_SB_{{databox_id}}"></span>
|
||||
<span class="danger_indicator">{{ databox['name'] }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -372,22 +371,6 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div id="history-queries" class="PNB" style="top:30px;overflow:hidden;">
|
||||
<div class="PNB10" style="overflow-y:auto;overflow-x:auto;">
|
||||
{{queries_history|raw}}
|
||||
</div>
|
||||
</div>
|
||||
{% if queries_topics %}
|
||||
<div id="choosen-topics" class="PNB" style="top:30px;overflow:hidden;">
|
||||
<div class="PNB10" style="overflow-y:auto;overflow-x:auto;">
|
||||
{{queries_topics|raw}}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
|
||||
<div id="idFrameT" class="PNB ui-corner-top">
|
||||
@@ -719,9 +702,6 @@
|
||||
<div id="modal_feed" title="{{ 'action : publier' | trans }}" style="display:none;"></div>
|
||||
<div id="dialog_dwnl" title="{{ 'action : exporter' | trans }}" style="display:none;"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
{% include "prod/thesaurus.js.twig" with {'search_datas': search_datas} %}
|
||||
</script>
|
||||
<script type="text/javascript" src="/assets/production/app{% if not app.debug %}.min{% endif %}.js"></script>
|
||||
<script type="text/javascript" src="/assets/common/js/common{% if not app.debug %}.min{% endif %}.js"></script>
|
||||
<script type="text/javascript" src="/assets/prod/js/prod{% if not app.debug %}.min{% endif %}.js"></script>
|
||||
@@ -745,7 +725,43 @@
|
||||
moduleId: 1,
|
||||
userId: {{app.getAuthenticatedUser().getId()}}
|
||||
},
|
||||
initialState: "{{ initialAppState }}"
|
||||
initialState: "{{ initialAppState }}",
|
||||
thesaurusConfig: {
|
||||
replaceMessage: '{{ 'prod::thesaurusTab:dlg:Remplacement du candidat "%(from)s" par "%(to)s"' | trans }}',
|
||||
replaceInProgressMsg: '{{ 'prod::thesaurusTab:dlg:Remplacement en cours.' | trans }}',
|
||||
acceptMsg: '{{ 'prod::thesaurusTab:dlg:Acceptation en cours.' | trans }}',
|
||||
deleteMsg: '{{ 'prod::thesaurusTab:dlg:Suppression en cours.' | trans }}',
|
||||
candidateUniqueMsg: '{{ 'prod::thesaurusTab:dlg:accepter le terme candidat "%s" ?' | trans }}',
|
||||
candidateManyMsg: '{{ 'prod::thesaurusTab:dlg:accepter les %d termes candidats ?' | trans }}',
|
||||
acceptCandidateUniqueMsg: '{{ 'prod::thesaurusTab:wizard:clic-droit / accepter le terme candidat "%s"' | trans }}',
|
||||
acceptCandidateManyMsg: '{{ "prod::thesaurusTab:wizard:clic-droit / accepter les %s termes candidats" | trans }}',
|
||||
replaceCandidateUniqueMsg: '{{ "prod::thesaurusTab:dlg:remplacer le terme \"%s\" des fiches par :" | trans }}',
|
||||
replaceCandidateManyMsg: '{{ "prod::thesaurusTab:dlg:remplacer les %d termes des fiches par :" | trans }}',
|
||||
deleteCandidateUniqueMsg: '{{ 'prod::thesaurusTab:dlg:supprimer le terme "%s" des fiches ?' | trans }}',
|
||||
deleteCandidateManyMsg: '{{ 'prod::thesaurusTab:dlg:supprimer les %d termes des fiches ?' | trans }}',
|
||||
loadingMsg: '{{ 'prod::thesaurusTab:tree:loading' | trans }}',
|
||||
searchMsg: '{{ 'boutton::chercher' | trans }}',
|
||||
acceptSpecificTermMsg: '{{ 'prod::thesaurusTab:tmenu:Accepter comme terme specifique' | trans }}',
|
||||
acceptSynonymeMsg: '{{ 'prod::thesaurusTab:tmenu:Accepter comme synonyme' | trans }}',
|
||||
replaceWithMsg: '{{ 'prod::thesaurusTab:cmenu:Remplacer par...' | trans }}',
|
||||
removeActionMsg: '{{ 'boutton::supprimer' | trans }}',
|
||||
sbas: {{thesau_json_sbas|raw}},
|
||||
bas2sbas: {{thesau_json_bas2sbas|raw}},
|
||||
availableDatabases: [
|
||||
{% for base in search_datas['bases'] %}{% if base['thesaurus'] %}{
|
||||
id: {{base['sbas_id']}}
|
||||
}{% if not loop.last %},{% endif %}{% endif %}{% endfor %}
|
||||
],
|
||||
languagesCount: {{ thesau_languages|length }},
|
||||
langContextMenu: [
|
||||
{% for lng_code, lng in thesau_languages %}
|
||||
{
|
||||
label:'{% trans with {'%lng_code%' : lng_code} %}prod::thesaurusTab:cmenu:Accepter en %lng_code%{% endtrans %}',
|
||||
lngCode: '{{lng_code}}',
|
||||
},
|
||||
{% endfor %}
|
||||
]
|
||||
}
|
||||
})
|
||||
// prodApp.appEvents.emit('search.doCheckFilters', true);
|
||||
|
||||
|
@@ -1,17 +1,16 @@
|
||||
|
||||
{% 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="prodModule.addToBasket('{{record.get_sbas_id()}}','{{record.get_record_id()}}',false,this);return(false);">
|
||||
class="baskAdder record-add-to-basket-action" data-db-id="{{record.get_sbas_id()}}" data-record-id="{{record.get_record_id()}}" title="{{ 'action : ajouter au panier' | trans }}">
|
||||
<img src="/assets/common/images/icons/basket.png" height="16" width="16" class="btn-image">
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if record.is_from_basket() %}
|
||||
<a sbas="{{record.get_sbas_id()}}" id="PREV_BASKDEL_{{record.get_serialize_key}}"
|
||||
class="WorkZoneElementRemover"
|
||||
class="WorkZoneElementRemover record-remove-from-basket-action"
|
||||
data-context="reg_train_basket"
|
||||
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>
|
||||
|
@@ -105,21 +105,20 @@
|
||||
<div class="context-menu context-menu-theme-vista">
|
||||
{% if granted_on_collection(record.baseId, 'canputinalbum') and not record.story %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="prodModule.addToBasket('{{record.databoxId}}','{{record.recordId}}',false,this);return(false);">
|
||||
<div class="context-menu-item-inner record-add-to-basket-action" data-db-id="{{record.databoxId}}" data-record-id="{{record.recordId}}">
|
||||
{{ 'action : ajouter au panier' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% 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 export-record-action" data-kind="record" data-id="{{record.id}}">
|
||||
<div class="context-menu-item-inner record-export-action" data-kind="record" data-id="{{record.id}}">
|
||||
{{ 'action : exporter' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner print-record-action"
|
||||
<div class="context-menu-item-inner record-print-action"
|
||||
data-kind="record" data-id="{{record.id}}">
|
||||
{{ 'action : print' | trans }}
|
||||
</div>
|
||||
|
@@ -19,23 +19,21 @@
|
||||
<div class="wizard wiz_2" style="display:none">
|
||||
<div class="txt">{{ 'prod::thesaurusTab:wizard:remplacer par le terme' | trans }}</div>
|
||||
</div>
|
||||
<form class="gform form-inline" onsubmit="T_Gfilter(this);return(false);">
|
||||
<form class="gform form-inline thesaurus-filter-submit-action">
|
||||
<div class="input-append">
|
||||
<input type="text" name="search_value" class="input-medium"
|
||||
onkeyup="T_Gfilter_delayed(this.value, 300);"/>
|
||||
<input type="text" name="search_value" class="input-medium thesaurus-filter-suggest-action"/>
|
||||
<button type="submit" class="th_ok btn btn-inverse">
|
||||
<i class="icon-search"></i>
|
||||
</button>
|
||||
|
||||
<input type="button" class="th_clear"/>
|
||||
<input type="button" class="th_cancel btn" value="{{ 'boutton::annuler' | trans }}"
|
||||
onclick="thesauCancelWizard();return(false);"/>
|
||||
<input type="button" class="th_cancel btn thesaurus-cancel-wizard-action" value="{{ 'boutton::annuler' | trans }}"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id='THPD_T_treeBox' class="searchZone"
|
||||
style="position:absolute; top:45px; bottom:0px; left:0px; width:100%;">
|
||||
<div onclick="Xclick(event);return(false);" ondblclick="TXdblClick(event);">
|
||||
<div class="thesaurus-branch-action">
|
||||
<ul class="treeview" id="THPD_T_tree">
|
||||
{% for base in search_datas['bases'] %}
|
||||
{% if base['thesaurus'] %}
|
||||
@@ -54,7 +52,7 @@
|
||||
{% if has_access_to_module %}
|
||||
<div id="THPD_C">
|
||||
<div id='THPD_C_treeBox' class="searchZone">
|
||||
<div onclick="Xclick(event);return(false);" ondblclick="CXdblClick(event);">
|
||||
<div class="thesaurus-branch-action">
|
||||
<ul class="treeview" id="THPD_C_tree">
|
||||
{% for base in search_datas['bases'] %}
|
||||
{% if base['cterms'] %}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@
|
||||
<td class='uploader-icon'>
|
||||
<img src='/assets/common/images/icons/html5-logo.png' width="32px" heigh="32px" title="{{ 'You are using the HTML5 uploader.' | trans }}"/>
|
||||
</td>
|
||||
<td class="uploader-info">
|
||||
<td class="uploader-infmaxFileSizeo">
|
||||
<p>
|
||||
{{ 'You are using the HTML5 uploader.' | trans }}
|
||||
{% if not app['browser'].supportFileAPI() %}
|
||||
@@ -141,8 +141,11 @@
|
||||
{% include "prod/templates/upload.html.twig" %}
|
||||
|
||||
<script>
|
||||
var uploaderOptions = {
|
||||
maxFileSize: {{ maxFileSize }}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
$(document).ready(function () {
|
||||
|
||||
var iev=0;
|
||||
@@ -506,7 +509,7 @@ $(document).ready(function () {
|
||||
data.context.find('.progress-bar').width('25%');
|
||||
}
|
||||
});
|
||||
});
|
||||
});*/
|
||||
</script>
|
||||
<style>
|
||||
.btn.page-lazaret a {
|
||||
|
Reference in New Issue
Block a user