adaptative height frame for svg editor

skala
Juan Carlos Raña 13 years ago
parent 23bcb82d46
commit 358cb36122
  1. 18
      main/document/create_draw.php
  2. 16
      main/document/edit_draw.php

@ -150,10 +150,20 @@ if (api_browser_support('svg')){
$langsvgedit = api_get_language_isocode();
$langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit;
$langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'svg-edit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en';
//editor
echo '<iframe style=\'height: 550px; width: 100%;\' scrolling=\'no\' frameborder=\'0\' src=\''.api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?lang='.$langsvgedit.'\'>';
echo '</iframe>';
?>
<script type="text/javascript">
if (window.innerHeight){
height_iframe = window.innerHeight -50;
}else{
height_iframe = 550;
}
document.write ('<iframe frameborder="0" scrolling="no" src="<?php echo api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?lang='.$langsvgedit; ?>" width="100%" height="' + height_iframe + '"></iframe>');
</script>
<?php
echo '<noscript>';
echo '<iframe style=\'height: 550px; width: 100%;\' scrolling=\'no\' frameborder=\'0\' src=\''.api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?lang='.$langsvgedit.'\'></iframe>';
echo '</noscript>';
} else {
Display::display_error_message(get_lang('BrowserDontSupportsSVG'));
}

@ -135,8 +135,20 @@ if (api_browser_support('svg')) {
$langsvgedit = api_get_language_isocode();
$langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit;
$langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'svg-edit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en';
echo '<iframe style=\'height: 550px; width: 100%;\' scrolling=\'no\' frameborder=\'0\' src=\''.api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../../courses/'.$courseDir.$dir.$file.'&amp;lang='.$langsvgedit.'\'>';
echo '</iframe>';
?>
<script type="text/javascript">
if (window.innerHeight){
height_iframe = window.innerHeight -50;
}else{
height_iframe = 550;
}
document.write ('<iframe frameborder="0" scrolling="no" src="<?php echo api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../../courses/'.$courseDir.$dir.$file.'&amp;lang='.$langsvgedit; ?>" width="100%" height="' + height_iframe + '"></iframe>');
</script>
<?php
echo '<noscript>';
echo '<iframe style=\'height: 550px; width: 100%;\' scrolling=\'no\' frameborder=\'0\' src=\''.api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../../courses/'.$courseDir.$dir.$file.'&amp;lang='.$langsvgedit.'\'></iframe>';
echo '</noscript>';
} else {
Display::display_error_message(get_lang('BrowserDontSupportsSVG'));
}

Loading…
Cancel
Save