Travel Guide Frontend Backend
This commit is contained in:
parent
e6cc042aee
commit
0857a34766
681 changed files with 6680 additions and 1689 deletions
|
|
@ -316,19 +316,25 @@ figcaption {
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
.mediaA {
|
||||
.mediaA, .imageWrapper {
|
||||
width: 98%;
|
||||
margin-left: .9%;
|
||||
margin-right: .9%;
|
||||
display: block;
|
||||
}
|
||||
.mediaA img {
|
||||
/*.mediaA img .note-editable img {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}*/
|
||||
|
||||
|
||||
.mediaA img, .imageWrapper img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
|
||||
.mediaA .mediaInfo {
|
||||
.mediaA .mediaInfo, .imageWrapper .mediaInfo {
|
||||
width: 100%;
|
||||
float: left;
|
||||
background-color: #648859;
|
||||
|
|
@ -342,6 +348,28 @@ figcaption {
|
|||
width: auto;
|
||||
}
|
||||
|
||||
|
||||
.imageWrapper .mediaInfo p {
|
||||
padding: 4px 4px 4px 8px;
|
||||
margin: 0;
|
||||
width: auto;
|
||||
|
||||
}
|
||||
|
||||
.note-editable h2 {
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 15px;
|
||||
border-bottom: 1px solid #c2c2c2;
|
||||
color: #616161;
|
||||
display: block;
|
||||
clear: both;
|
||||
padding-top: 20px;
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
line-height: 1.1;
|
||||
|
||||
}
|
||||
|
||||
.modal-open .tooltip {
|
||||
z-index: 2120;
|
||||
}
|
||||
|
|
|
|||
0
public/js/_bak_1_filemanager.js
Normal file → Executable file
0
public/js/_bak_1_filemanager.js
Normal file → Executable file
0
public/js/_bak_filemanager.js
Normal file → Executable file
0
public/js/_bak_filemanager.js
Normal file → Executable file
0
public/js/application.js
Normal file → Executable file
0
public/js/application.js
Normal file → Executable file
|
|
@ -197,9 +197,9 @@ var LFileManager = {
|
|||
data[key] = value;
|
||||
});
|
||||
}
|
||||
// console.log(lfm_route + '/' + url);
|
||||
// console.log(type);
|
||||
// console.log(data);
|
||||
//console.log(lfm_route + '/' + url);
|
||||
//console.log(type);
|
||||
//console.log(data);
|
||||
return $.ajax({
|
||||
type: 'GET',
|
||||
beforeSend: function(request) {
|
||||
|
|
@ -565,7 +565,8 @@ var LFileManager = {
|
|||
};
|
||||
},
|
||||
insertHTML : function(item){
|
||||
var title = '';
|
||||
//TODO need?
|
||||
/* var title = '';
|
||||
if(item.content !== null && item.content.title){
|
||||
title = item.content.title;
|
||||
}
|
||||
|
|
@ -611,7 +612,7 @@ var LFileManager = {
|
|||
}
|
||||
return insert;
|
||||
}
|
||||
|
||||
*/
|
||||
return false;
|
||||
},
|
||||
notImp : function() {
|
||||
|
|
|
|||
|
|
@ -1 +1,125 @@
|
|||
|
||||
var IqLFileManager = {
|
||||
image_dialog_images_url: "/iq/content/assets/modal",
|
||||
image_dialog_title: 'Medien',
|
||||
image_dialog_close_btn_text: 'schließen',
|
||||
image_dialog_ok_btn_text: 'Einfügen',
|
||||
data_id: null,
|
||||
data_obj: null,
|
||||
data_set: null,
|
||||
data_img: null,
|
||||
data_title: null,
|
||||
data_alt: null,
|
||||
modal: null,
|
||||
|
||||
init: function () {
|
||||
var _self = this;
|
||||
var $modal = _self.modal = $('#modal_iq_assets').hide();
|
||||
$modal.find("button#modal_iq_save").click(function(event)
|
||||
{
|
||||
var items = LFileManager.getSelectedItems();
|
||||
$modal.modal('hide');
|
||||
if(items[0]){
|
||||
console.log(items[0]);
|
||||
var item = items[0];
|
||||
if(_self.data_img){
|
||||
var img = $(_self.data_id).find(_self.data_img);
|
||||
if(item['thumb_url'] && img){
|
||||
img.attr('src', item['thumb_url']);
|
||||
}
|
||||
}
|
||||
//console.log(_self.data_content);
|
||||
//console.log(item['content']);
|
||||
if(_self.data_title){
|
||||
var input = $(_self.data_id).find('input[name="'+_self.data_obj+'['+_self.data_title+']"]');
|
||||
console.log(input);
|
||||
|
||||
if(input && item['content'] && item['content'][_self.data_title]) {
|
||||
var val = item['content'][_self.data_title];
|
||||
if (input) {
|
||||
input.val(val).change();
|
||||
}
|
||||
console.log(val);
|
||||
}
|
||||
}
|
||||
|
||||
if(_self.data_alt && _self.data_title){
|
||||
var input = $(_self.data_id).find('input[name="'+_self.data_obj+'['+_self.data_alt+']"]');
|
||||
console.log(input);
|
||||
|
||||
if(input && item['content'] && item['content']['title']) {
|
||||
var val = item['content'][_self.data_title];
|
||||
if(item['content']['author_name']){
|
||||
val = val + " | Bildquelle: " + item['content']['author_name']
|
||||
}
|
||||
if (input) {
|
||||
input.val(val).change();
|
||||
}
|
||||
console.log(val);
|
||||
}
|
||||
}
|
||||
_self.data_set.forEach(function (setter, index) {
|
||||
var input = $(_self.data_id).find('input[name="'+_self.data_obj+'['+setter+']"]');
|
||||
var val = item[setter]
|
||||
if(input && val){
|
||||
input.val(val).change();
|
||||
}
|
||||
});
|
||||
}
|
||||
/*items.forEach(function (item, index) {
|
||||
});*/
|
||||
});
|
||||
|
||||
$('.btn-lfm-open-modal').on('click', function () {
|
||||
|
||||
_self.data_id = $(this).data('id');
|
||||
_self.data_obj = $(this).data('obj');
|
||||
_self.data_set = $(this).data('set');
|
||||
_self.data_img = $(this).data('img');
|
||||
_self.data_title = $(this).data('title');
|
||||
_self.data_alt = $(this).data('alt');
|
||||
|
||||
_self.fillModal();
|
||||
_self.modal.modal();
|
||||
});
|
||||
},
|
||||
|
||||
fillModal: function () {
|
||||
var _self = this;
|
||||
var next = _self.setEvents;
|
||||
_self.getImagesFromUrl(next);
|
||||
},
|
||||
setEvents: function()
|
||||
{
|
||||
// images click event to select image
|
||||
/*self.$modal.find('img').click(function(event)
|
||||
{
|
||||
// $(this).toggleClass(self.select_class);
|
||||
});*/
|
||||
},
|
||||
getImagesFromUrl: function(callback)
|
||||
{
|
||||
var _self = this;
|
||||
// get images html from url
|
||||
$.get(_self.image_dialog_images_url, function(html)
|
||||
{
|
||||
_self.setModalHtml(html);
|
||||
callback();
|
||||
|
||||
}).fail(function()
|
||||
{
|
||||
console.error("error loading from "+_self.image_dialog_images_url);
|
||||
})
|
||||
},
|
||||
setModalHtml: function(html)
|
||||
{ // set variabl parts to modal html
|
||||
var _self = this;
|
||||
|
||||
_self.modal.find('.modal-title').html(_self.image_dialog_title);
|
||||
_self.modal.find('#modal_iq_close').html(_self.image_dialog_close_btn_text);
|
||||
_self.modal.find('#modal_iq_save').html(_self.image_dialog_ok_btn_tex);
|
||||
|
||||
_self.modal.find('.modal-body').html(html);
|
||||
LFileManager.initFileManager(true);
|
||||
},
|
||||
};
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
if ($.contains(parent, focused_element))
|
||||
{
|
||||
$(self.editor).data('last_focused_element', focused_element)
|
||||
};
|
||||
}
|
||||
};
|
||||
self.editorEvents = function () {
|
||||
$(self.editable).on('keypress, mousemove', function()
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
self.recoverEditorFocus();
|
||||
|
||||
items.forEach(function (item, index) {
|
||||
var insert = LFileManager.insertHTML(item);
|
||||
var insert = self.insertHTML(item);
|
||||
if(insert){
|
||||
context.invoke('editor.pasteHTML', insert);
|
||||
}
|
||||
|
|
@ -189,6 +189,73 @@
|
|||
|
||||
};
|
||||
|
||||
|
||||
this.insertHTML = function(item){
|
||||
var title = 'Bildtitel ...';
|
||||
var description = '';
|
||||
var author_name = '';
|
||||
var img_title = '';
|
||||
|
||||
if(item.content !== null){
|
||||
if(item.content.title !== undefined && item.content.title){
|
||||
title = item.content.title;
|
||||
img_title = item.content.title;
|
||||
}
|
||||
if(item.content.description !== undefined && item.content.description){
|
||||
description = ' ' + item.content.description;
|
||||
}
|
||||
if(item.content.author_name !== undefined && item.content.author_name){
|
||||
author_name = 'Bildquelle: ' + item.content.author_name;
|
||||
if(img_title !== ''){
|
||||
img_title = img_title + " | " + author_name;
|
||||
}else{
|
||||
img_title = author_name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// console.log(item)
|
||||
var insert = '';
|
||||
|
||||
if(item.is_file && item.is_image){
|
||||
insert += '<div class="mediaA">'+
|
||||
'<img src="'+item.url+'" alt="'+title+'" class="img-responsive" title="'+img_title+'" data-slug="'+item.slug+'" width="auto" height="auto">' +
|
||||
'<div class="mediaInfo">\n' +
|
||||
'<p class="infotext">' + title + '</p>\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
return insert;
|
||||
}
|
||||
if(item.icon === "fab fa-youtube-square"){
|
||||
|
||||
|
||||
insert += '<div class="mediaA" itemprop="video" itemscope itemtype="http://schema.org/VideoObject">\n' +
|
||||
'<h2><span itemprop="name">'+ title +'</span></h2>\n' +
|
||||
'<meta itemprop="duration" content="'+item.content.duration+'" />\n' +
|
||||
'<meta itemprop="uploadDate" content="'+item.content.uploadDate+'"/>\n' +
|
||||
'<meta itemprop="thumbnailURL" content="'+item.content.thumbnailURL+'" />\n' +
|
||||
'<meta itemprop="embedURL" content="https://youtube.googleapis.com/v/'+item.content.id+'" />\n' +
|
||||
'<div class="video-container">\n' +
|
||||
'<iframe src="https://www.youtube.com/embed/'+item.content.id+'?rel=0&controls=0&showinfo=0" data-identifier="'+item.identifier+'" data-slug="'+item.slug+'" frameborder="0" allowfullscreen></iframe>\n' +
|
||||
'</div>\n' +
|
||||
'<div class="mediaInfo">\n' +
|
||||
'<p class="infotext" itemprop="description">' + description + '</p>\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
|
||||
return insert;
|
||||
}
|
||||
if(item.is_file){
|
||||
insert += '<a href="'+item.url+'" title="'+title+'" data-identifier="'+item.identifier+'">'+item.name+'</a>';
|
||||
if(description !== ''){
|
||||
insert += '<p>'+description+'</p>';
|
||||
}
|
||||
return insert;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
// This methods will be called when editor is destroyed by $('..').summernote('destroy');
|
||||
// You should remove elements on `initialize`.
|
||||
this.destroy = function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue