2013-04-15 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_html.php, include/javascript/jquery.pandora.js:
	improved the source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7983 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-04-15 14:32:50 +00:00
parent 5830c04c0a
commit 9b705e4643
3 changed files with 16 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2013-04-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php, include/javascript/jquery.pandora.js:
improved the source code style.
2013-04-15 Sergio Martin <sergio.martin@artica.es>
* include/functions_html.php

View File

@ -1640,7 +1640,7 @@ function html_print_image ($src, $return = false, $options = false, $return_src
// If metaconsole is activated and image doesn't exists try to search on normal console
if (defined('METACONSOLE')) {
if (!$relative) {
if (false === @file_get_contents($src,0,null,0,1)) {
if (false === @file_get_contents($src, 0, null, 0, 1)) {
$src = ui_get_full_url('../../' . $src_tmp);
}
}
@ -1658,7 +1658,7 @@ function html_print_image ($src, $return = false, $options = false, $return_src
return io_safe_input($src);
}
$output = '<img src="'.$src.'" '; // Dont use safe_input here or the performance will dead
$output = '<img src="' . $src . '" '; // Dont use safe_input here or the performance will dead
$style = '';
if (!empty ($options)) {

View File

@ -180,7 +180,7 @@ function forced_title_callback() {
///////////////////////////////////////////
$('#forced_title_layer').css('left', 0);
$('#forced_title_layer').css('top', 0);
///////////////////////////////////////////
// Get info of the image
///////////////////////////////////////////
@ -190,44 +190,44 @@ function forced_title_callback() {
var img_height = $(this).height();
var img_id = $(this).attr('id');
var img_left_mid = $(this).offset().left + (img_width / 2);
///////////////////////////////////////////
// Put title in the layer
///////////////////////////////////////////
var title = $('#forced_title_'+img_id).html();
$('#forced_title_layer').html(title);
///////////////////////////////////////////
///////////////////////////////////////////
// Get info of the layer
///////////////////////////////////////////
var layer_width = $('#forced_title_layer').width();
var layer_height = $('#forced_title_layer').height();
///////////////////////////////////////////
// Obtain the new position of the layer
///////////////////////////////////////////
// Jquery doesnt know the padding of the layer
var layer_padding = 4;
// Deduct padding of both sides
var layer_top = img_top - layer_height - (layer_padding * 2) - 5;
if(layer_top < 0) {
if (layer_top < 0) {
layer_top = img_top + img_height + (layer_padding * 2);
}
// Deduct padding of one side
var layer_left = img_left_mid - (layer_width / 2) - layer_padding;
if(layer_left < 0) {
if (layer_left < 0) {
layer_left = 0;
}
var real_layer_width = layer_width + (layer_padding * 2) + 5;
var layer_right = layer_left + real_layer_width;
var screen_width = $(window).width();
if(screen_width < layer_right) {
if (screen_width < layer_right) {
layer_left = screen_width - real_layer_width;
}