Media youtube, title description, CMS Info Content / Header Frontend
This commit is contained in:
parent
c9f3d85d4e
commit
7294ccc1d0
49 changed files with 1283 additions and 148 deletions
|
|
@ -312,6 +312,18 @@ jQuery(document).ready(function() {
|
|||
|
||||
$(function() {
|
||||
|
||||
|
||||
$('.datepicker-range').datepicker({
|
||||
calendarWeeks: true,
|
||||
orientation: 'auto left',
|
||||
format: 'dd.mm.yyyy',
|
||||
language: 'de',
|
||||
daysOfWeekHighlighted: '0,6',
|
||||
clearBtn: true,
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('.datepicker-base').datepicker({
|
||||
calendarWeeks: true,
|
||||
todayBtn: 'linked',
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ function getSelectedItems() {
|
|||
|
||||
function hasSelectedItems() {
|
||||
$('input.lfm-control-input').each(function () {
|
||||
console.log($(this).prop('checked'));
|
||||
//console.log($(this).prop('checked'));
|
||||
if($(this).prop('checked')){
|
||||
return true;
|
||||
}
|
||||
|
|
@ -351,8 +351,8 @@ var refreshFoldersAndItems = function (data) {
|
|||
loadItems();
|
||||
if(isJSON(data)){
|
||||
var response = JSON.parse(data);
|
||||
console.log("done");
|
||||
console.log(response);
|
||||
//console.log("done");
|
||||
//console.log(response);
|
||||
if(response.type === "error"){
|
||||
$.growl({
|
||||
title: "Error",
|
||||
|
|
@ -380,7 +380,7 @@ function loadItems() {
|
|||
loading(true);
|
||||
performLfmRequest('jsonitems', {show_list: lfm_show_list, sort_type: lfm_sort_type}, 'html')
|
||||
.done(function (data) {
|
||||
console.log(data);
|
||||
//console.log(data);
|
||||
lfm_selected = [];
|
||||
var response = JSON.parse(data);
|
||||
var working_dir = response.working_dir;
|
||||
|
|
@ -401,7 +401,7 @@ function loadItems() {
|
|||
.attr('data-id', index)
|
||||
//.click(toggleSelected)
|
||||
.click(function (e) {
|
||||
console.log($(e.target));
|
||||
//console.log($(e.target));
|
||||
if(!$(e.target).hasClass('lfm-click-disable') && !$(e.target).hasClass('dropdown-item')){
|
||||
if (item.is_file) {
|
||||
if($(e.target).hasClass('file-item-img') || $(e.target).hasClass('file-item-icon')){
|
||||
|
|
@ -469,7 +469,7 @@ function loadItems() {
|
|||
//$('#nav-buttons > ul').removeClass('d-none');
|
||||
|
||||
$('#working_dir').val(working_dir);
|
||||
console.log('Current working_dir : ' + working_dir);
|
||||
// console.log('Current working_dir : ' + working_dir);
|
||||
var breadcrumbs = [];
|
||||
var validSegments = working_dir.split('/').filter(function (e) { return e; });
|
||||
validSegments.forEach(function (segment, index) {
|
||||
|
|
@ -602,24 +602,41 @@ function preview_item(item) {
|
|||
|
||||
function preview(item) {
|
||||
var media = $('#previewTemplate').clone().attr('id', 'previewMedia').removeClass('d-none');
|
||||
|
||||
|
||||
var item_content_id = "";
|
||||
if(item.icon == "fa-image" || item.icon == "fa-file-pdf"){
|
||||
media.find('.media-preview').attr('src', item.url + '?timestamp=' + item.time).removeClass('d-none');
|
||||
}else if(item.icon == "fab fa-youtube-square"){
|
||||
media.find('.embed-responsive-item').attr('src', 'https://www.youtube.com/embed/' +item.content + '?rel=0');
|
||||
media.find('.embed-responsive-item').attr('src', 'https://www.youtube.com/embed/' +item.content.id + '?rel=0');
|
||||
media.find('.embed-responsive').removeClass('d-none');
|
||||
media.find('.media-content').val(item.content);
|
||||
media.find('.media-content').parent().removeClass('d-none');
|
||||
item_content_id = item.content.id;
|
||||
|
||||
|
||||
}else{
|
||||
var icon = $('<div>').addClass('file-item-icon fa ' + item.icon).css('color', item.color);
|
||||
media.find('.file-manager-col-view').html(icon).removeClass('d-none');
|
||||
}
|
||||
|
||||
|
||||
if(item.content){
|
||||
media.find('.media-content-title').val(item.content.title);
|
||||
media.find('.media-content-description').val(item.content.description);
|
||||
}
|
||||
media.find('.media-content-title').parent().removeClass('d-none');
|
||||
media.find('.media-content-description').parent().removeClass('d-none');
|
||||
|
||||
media.find('.media-name').html(item.name);
|
||||
media.find('.media-url').val(item.url);
|
||||
media.find('.media-download').attr('target', '_blank').attr('href', item.url);
|
||||
|
||||
|
||||
callback = function () {
|
||||
performLfmRequest('file-content', {
|
||||
file: item.name,
|
||||
content_id: item_content_id,
|
||||
content_title: media.find('.media-content-title').val(),
|
||||
content_description: media.find('.media-content-description').val(),
|
||||
}).done(refreshFoldersAndItems);
|
||||
};
|
||||
/* if (item.thumb_url) {
|
||||
media.find('.carousel-image').css('background-image', 'url(\'' + item.url + '?timestamp=' + item.time + '\')');
|
||||
} else {
|
||||
|
|
@ -631,7 +648,7 @@ function preview(item) {
|
|||
.append($('<i class="fas fa-external-link-alt ml-2"></i>'));
|
||||
*/
|
||||
|
||||
notify(media);
|
||||
notify(media, callback);
|
||||
}
|
||||
|
||||
/*function preview(items) {
|
||||
|
|
@ -833,7 +850,11 @@ function notImp() {
|
|||
function notify(body, callback) {
|
||||
|
||||
$('#notify').find('.btn-primary').toggle(callback !== undefined);
|
||||
$('#notify').find('.btn-primary').unbind().click(callback);
|
||||
if(callback !== 'success'){
|
||||
$('#notify').find('.btn-primary').unbind().click(callback);
|
||||
}else{
|
||||
$('#notify').find('.btn-primary').unbind();
|
||||
}
|
||||
$('#notify').modal('show').find('.modal-body').html(body);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue