Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	install/db/dedalo4_install.pgsql
#	install/db/dedalo4_install.pgsql.zip
#	lib/dedalo/component_text_area/js/component_text_area.js
#	lib/dedalo/component_text_area/js/text_editor.js
#	lib/dedalo/login/class.login.php
  • Loading branch information
renderpci committed Sep 21, 2017
2 parents 4540f1f + c200e52 commit 12d77fb
Show file tree
Hide file tree
Showing 27 changed files with 1,477 additions and 1 deletion.
Binary file removed install/db/dedalo4_install.psql.zip
Binary file not shown.
21 changes: 21 additions & 0 deletions lib/dedalo/component_text_area/js/component_text_area.js
Original file line number Diff line number Diff line change
Expand Up @@ -2245,6 +2245,7 @@ alert("get_tag_label");

// IMG : Create and insert image in text
//var img_html = component_text_area.build_note_img(label, state, data)
<<<<<<< HEAD
let img = component_text_area.build_dom_element_from_data(tag_type, note_number, state, label, data)

if (component_text_area.is_tiny(ed)===false) {
Expand Down Expand Up @@ -2328,6 +2329,26 @@ alert("get_tag_label");
},150)
});
}
=======
var img = component_text_area.build_dom_element_from_data(tag_type, note_number, state, label, data)
var img_html = img.outerHTML

// Insert html on editor
ed.selection.setContent( img_html, {format:'raw'} )

// Set editor as modified and save
ed.setDirty(true)
component_text_area.Save( document.getElementById(ed.id), null, ed ).then(function(response){
// On finish save, select created tag (the last) and trigger click action
var last_tag_obj = component_text_area.get_last_element(ed, 'note')
if (last_tag_obj) {
// Select image in text editor
ed.selection.select(last_tag_obj); //select the inserted element // .scrollIntoView(false)
// Trigger exec click on selected tag
last_tag_obj.click();
}
})
>>>>>>> origin/master
}
})

Expand Down
102 changes: 101 additions & 1 deletion lib/dedalo/component_text_area/js/text_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,113 @@ var text_editor = new function() {
}
},false)
/*
<<<<<<< HEAD
text_preview.addEventListener("keyup", function(e){
var key = 'text_preview'
localStorage[key] = self.innerHTML;
},false)*/

//console.log("text_editor.wrapper_id: ",text_editor.wrapper_id);

=======
external_plugins: {

"image" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/image/plugin.min.js",
"print" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/print/plugin.min.js",
"searchreplace" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/searchreplace/plugin.min.js",
"code" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/code/plugin.min.js",
"fullscreen" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js",
"paste" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/paste/plugin.min.js",
//"wordcount" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/wordcount/plugin.min.js",
"nanospell": DEDALO_ROOT_WEB + "/lib/tinymce/nanospell/plugin.js"
},
*/
skin_url : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/skins/lightgray",
theme_url : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/themes/modern/theme.min.js?" +page_globals.dedalo_version,


// ENCODING
entity_encoding : "raw",

// P : FORCE NO INSERT TINYMCE PARAGRAPS "<p>"
//v3 force_br_newlines : true, // need true for webkit
force_p_newlines : false,
forced_root_block : false, // Needed for 3.x

// SIZE :
width : '100%',
height : editor_height,

autoresize_min_height : 88,
autoresize_max_height : 276,
autoresize_bottom_margin: 10,

// CSS
content_css : cssFile,
//skin : 'lightgray',

// IMAGES : Avoid user resize images
object_resizing : false,
paste_block_drop : false, // block drag images on true

// HTML ELEMENTS ALLOWED
valid_elements : html_tags_allowed, //"strong/b,em/i,div[class],span[class],img[id|src|class],br,p",

// This option enables or disables the element cleanup functionality. If you set this option to false,
// all element cleanup will be skipped but other cleanup functionality such as URL conversion will still be executed.
//v3 verify_html : false, // default false (IMPORTANT FOR IMAGE TAGS ALWAYS SET FALSE)
//v3 apply_source_formatting : false,

// Gestion de URL's por tiny. Default is both true
relative_urls : false,
convert_urls : false,

// TESTING
//v3 remove_linebreaks : false, // remove line break stripping by tinyMCE so that we can read the HTML
//v3 verify_css_classes : false,
paste_create_linebreaks : true, // for paste plugin - single linefeeds are converted to hard line break elements
paste_auto_cleanup_on_paste : true, // for paste plugin - word paste will be executed when the user copy/paste content

// SPELLCHECKER
browser_spellcheck : true, // Browser (Chrome) spellchecker bool
//spellchecker_rpc_url: DEDALO_ROOT_WEB + '/lib/tinymce/spellchecker/' + 'spellchecker.php',

schema: 'html5-strict',

// SETUP EDITOR
setup : function(ed) {

// BUTTON PERSON
ed.addButton('button_person', {
tooltip: 'Add person',
image: '../themes/default/buttons/person.svg',
onclick: function(evt) {
component_text_area.load_tags_person()
}
});

// BUTTON NOTE
ed.addButton('button_note', {
tooltip: 'Add note',
image: '../themes/default/buttons/note.svg',
onclick: function(evt) {
component_text_area.create_new_note()
}
});

// BUTTON SAVE ADD
ed.addButton('button_save', {
text: get_label.salvar,
tooltip: get_label.salvar,
icon: false,
onclick: function(evt) {
// SAVE COMMAND
// It will get dirty if the user has made modifications to the contents
//ed.setDirty(true); // Force dirty state
text_editor.save_command(ed,evt,text_area_component);
}
});
>>>>>>> origin/master

// console.log("text_preview.style.opacity:",text_preview.style.opacity, typeof text_preview.style.opacity);
if (text_preview.style.opacity=="0") {
Expand Down Expand Up @@ -754,4 +854,4 @@ var text_editor = new function() {



};//end text_editor class
};//end text_editor class
194 changes: 194 additions & 0 deletions lib/dedalo/extras/oh/widgets/av_duration/av_duration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
<?php

















TO DELETE !!! NOT USED

































# CONTROLLER


$widget_name = $this->widget_name;
$modo = $this->component_info->get_modo();
$parent = $this->component_info->get_parent();
$section_tipo = $this->component_info->get_section_tipo();
$data_source = $this->data_source;
$component_portal_tipo = key($data_source);
$component_av_tipo = reset($data_source);
$filename = $modo;


switch ($modo) {

case 'list':
$filename = 'edit';
case 'edit':

#
# DATA_SOURCE
# Format :
# stdClass Object
# (
# [oh25] => rsc35
# )
#dump($data_source, ' data_source ++ '.to_string());

if (isset($this->ar_locators)) {

$ar_locators = $this->ar_locators; // When we are in list, injected from portal data

}else{

#
# COMPONENT PORTAL (calculate when in edit normally)
$component = component_common::get_instance('component_portal',
$component_portal_tipo,
$parent,
'list',
DEDALO_DATA_NOLAN,
$section_tipo);
$ar_locators = $component->get_dato();
}
#dump($ar_locators, ' ar_locators ++ '.to_string());

if (empty($ar_locators)) {
return null;
}

require_once( DEDALO_LIB_BASE_PATH . '/media_engine/class.Ffmpeg.php');
require_once( DEDALO_LIB_BASE_PATH . '/media_engine/class.OptimizeTC.php');

$total_duration = 0;
$ar_duration = array();
$ar_resolved = array();
$use_cache = true;

foreach ($ar_locators as $current_locator) {


$duration_secs = 0;


$cache_key = $current_locator->section_tipo.'_'.$current_locator->section_id;
if (in_array($cache_key, $ar_resolved)) {
continue;
}
if ($use_cache && isset($_SESSION['dedalo4']['config']['av_duration'][$cache_key])) {

$duration_secs = $_SESSION['dedalo4']['config']['av_duration'][$cache_key];
#debug_log(__METHOD__." GET DUTARION FROM SESSION $current_locator->section_id ".to_string($duration_secs), logger::DEBUG);

}else{
/* DEACTIVATED
$modelo_name = RecordObj_dd::get_modelo_name_by_tipo(DEDALO_COMPONENT_RESOURCES_AV_DURATION_TIPO,true);
$component = component_common::get_instance($modelo_name,
DEDALO_COMPONENT_RESOURCES_AV_DURATION_TIPO,
$current_locator->section_id,
'edit',
DEDALO_DATA_NOLAN,
$current_locator->section_tipo);
$dato = $component->get_dato();
*/
if (!empty($dato)) {

$duration_secs = $dato;
if($use_cache) $_SESSION['dedalo4']['config']['av_duration'][$cache_key] = $duration_secs;
#debug_log(__METHOD__." GET DUTARION FROM DEDALO_COMPONENT_RESOURCES_AV_DURATION_TIPO $current_locator->section_id ".to_string($duration_secs), logger::DEBUG);

}else{

$component_av = component_common::get_instance('component_av',
$component_av_tipo,
$current_locator->section_id,
'list',
DEDALO_DATA_NOLAN,
$current_locator->section_tipo);
$video_path = $component_av->get_video_path(DEDALO_AV_QUALITY_DEFAULT);
if ( file_exists( $video_path) ) {

$media_attributes = ffmpeg::get_media_attributes($video_path);
#dump($media_attributes, ' media_attributes ++ '.to_string());
if (isset($media_attributes->format->duration)) {
$duration_secs = $media_attributes->format->duration;

if($use_cache) $_SESSION['dedalo4']['config']['av_duration'][$cache_key] = $duration_secs;
}
}//end if (file_exists
#debug_log(__METHOD__." GET DUTARION FROM FILE MEDIA_ATTRIBUTES $current_locator->section_id ".to_string($duration_secs), logger::DEBUG);
}//end if (empty($dato)) {
}

$ar_duration[$current_locator->section_id] = $duration_secs;

$total_duration += (int)$duration_secs;

$ar_resolved[] = $cache_key;
}
$total_duration_tc = OptimizeTC::seg2tc($total_duration);
#dump($ar_duration, ' ar_duration ++ '.to_string($total_duration_tc));

$widget_base_url = $this->get_widget_base_url();
css::$ar_url[] = $widget_base_url ."/css/".$widget_name.".css";
#js::$ar_url[] = $widget_base_url ."/js/".$widget_name.".js";

break;

default:
return "Sorry. Mode: $modo is not supported";
}




$page_html = dirname(__FILE__) . '/html/' . $widget_name . '_' . $filename . '.phtml';
if( !include($page_html) ) {
echo "<div class=\"error\">Invalid widget mode $modo</div>";
}

?>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 12d77fb

Please sign in to comment.