Removed code supporting Internet Explorer.

master
Pacman Ghost 2 years ago committed by Pacman Ghost
parent 23256bbc63
commit 4762a36eb6
  1. 8
      vasl_templates/webapp/static/main.js
  2. 16
      vasl_templates/webapp/static/utils.js
  3. 4
      vasl_templates/webapp/tests/test_ob.py
  4. 4
      vasl_templates/webapp/tests/test_snippets.py
  5. 4
      vasl_templates/webapp/tests/test_ssr.py
  6. 16
      vasl_templates/webapp/tests/utils.py

@ -385,12 +385,6 @@ $(document).ready( function () {
prevHeight[id] = h ;
}
} ) ;
// FUDGE! Some panels are rendering with the wrong width in IE :-/
if ( isIE() ) {
var set_width = function($elem) { $elem.width( $elem.parent().width() ) ; } ;
set_width( $("#panel-vc textarea") ) ;
set_width( $("#panel-ssr .content") ) ;
}
} ) ;
$(window).trigger( "resize" ) ;
@ -785,8 +779,6 @@ function update_page_load_status( id )
// FUDGE! This works around a timing problem during startup, where we unload the current parameters
// before the Victory Conditions Trumbowyg control has initialized (and so doesn't get included).
gLastSavedScenario = unload_params_for_save( false ) ;
// NOTE: The watermark image appears briefly in IE when reloading the page, but not even
// creating the watermark dynamically and removing it when the page unloads fixes it :-(
$("#watermark").fadeIn( 5*1000 ) ;
// notify the test suite
$("body").append( $("<div id='_page-loaded_'></div>") ) ;

@ -124,12 +124,6 @@ function copyToClipboard( val )
return ;
}
// IE-specific code path to prevent textarea being shown while dialog is visible
if ( window.clipboardData && window.clipboardData.setData ) {
clipboardData.setData( "Text", val ) ;
return ;
}
// FUDGE! If a dialog is open, the overlay will stop the copy command from working,
// so we attach the <textarea> to the dialog instead. Setting the z-index to something
// large is also supposed to work, but apparently not... :-/
@ -688,16 +682,6 @@ function makeBlob( data, mimeType )
} ) ;
}
function isIE()
{
// check if we're running in IE :-/
if ( navigator.userAgent.indexOf("MSIE") !== -1 )
return true ;
if ( navigator.appVersion.indexOf("Trident/") !== -1 )
return true ;
return false ;
}
isKeyDown = ( function( key ) {
var keyState = {} ;
window.addEventListener( "keyup", function(e) { keyState[e.key] = false ; } ) ;

@ -7,7 +7,7 @@ from vasl_templates.webapp.tests.utils import \
get_nationalities, wait_for_clipboard, get_stored_msg, set_stored_msg_marker, select_tab, \
find_child, find_children, \
add_simple_note, edit_simple_note, get_sortable_entry_count, drag_sortable_entry_to_trash, \
init_webapp, wait_for, adjust_html, set_scenario_date, set_player, set_theater
init_webapp, wait_for, set_scenario_date, set_player, set_theater
# ---------------------------------------------------------------------
@ -46,7 +46,7 @@ def _do_test_ob_entries( webapp, webdriver, ob_type, has_para ):
elems[entry_no].click()
if ob_type == "ob_notes":
expected = re.sub( r" \(col=.*?\)", "", expected )
assert wait_for_clipboard( 2, expected, transform=adjust_html )
assert wait_for_clipboard( 2, expected )
select_tab( "ob1" )
check_snippet( sortable1, 0,
"[German] [{} #1] (col=[OBCOL:german/OBCOL-BORDER:german])".format( ob_type )

@ -12,7 +12,7 @@ from vasl_templates.webapp.tests import pytest_options
from vasl_templates.webapp.tests.test_user_settings import set_user_settings, SCENARIO_IMAGES_SOURCE_THIS_PROGRAM
from vasl_templates.webapp.tests.utils import \
init_webapp, select_tab, find_snippet_buttons, set_template_params, wait_for, wait_for_clipboard, wait_for_elem, \
get_stored_msg, set_stored_msg_marker, find_child, find_children, find_sortable_helper, adjust_html, \
get_stored_msg, set_stored_msg_marker, find_child, find_children, find_sortable_helper, \
for_each_template, add_simple_note, edit_simple_note, click_dialog_button, \
load_trumbowyg, unload_trumbowyg, get_trumbowyg_editor, \
get_sortable_entry_count, generate_sortable_entry_snippet, drag_sortable_entry_to_trash, \
@ -180,7 +180,7 @@ def test_scenario_notes_snippets( webapp, webdriver ):
sortable = find_child( "#scenario_notes-sortable" )
add_simple_note( sortable, "scenario <i>note</i> #1", None )
add_simple_note( sortable, "scenario note #2", "100px" )
assert generate_sortable_entry_snippet( sortable, 0 ) == adjust_html( "[scenario <i>note</i> #1]" )
assert generate_sortable_entry_snippet( sortable, 0 ) == "[scenario <i>note</i> #1]"
assert generate_sortable_entry_snippet( sortable, 1 ) == "[scenario note #2] (width=[100px])"
# delete a scenario note by dragging it into the trash

@ -3,7 +3,7 @@
import html
from vasl_templates.webapp.tests.utils import \
init_webapp, select_tab, find_child, wait_for_clipboard, adjust_html, \
init_webapp, select_tab, find_child, wait_for_clipboard, \
add_simple_note, edit_simple_note, drag_sortable_entry_to_trash, get_sortable_entry_count
# ---------------------------------------------------------------------
@ -35,7 +35,7 @@ def test_ssr( webapp, webdriver ):
val = "\n".join( "(*) [{}]".format(e) for e in expected )
if width:
val += "\nwidth = [{}]".format( width )
wait_for_clipboard( 2, val, transform=lambda v: html.unescape(adjust_html(v)) )
wait_for_clipboard( 2, val, transform=html.unescape )
# add an SSR and generate the SSR snippet
add_ssr( "This is my first SSR." )

@ -730,22 +730,6 @@ def unload_table( xpath, unload, html=None ):
# ---------------------------------------------------------------------
_IE_HTML_TAGS = [ "<i>" ]
def adjust_html( val ):
"""Adjust HTML content for IE."""
if vasl_templates.webapp.tests.pytest_options.webdriver != "ie":
return val
# convert HTML tags to uppercase :-/
for tag in _IE_HTML_TAGS:
val = val.replace( tag, tag.upper() )
assert tag.startswith( "<" ) and tag.endswith( ">" )
close_tag = "</{}".format( tag[1:] )
val = val.replace( close_tag, close_tag.upper() )
return val
# ---------------------------------------------------------------------
def get_css_classes( elem ):
"""Get the CSS classes for the specified element."""
classes = elem.get_attribute( "class" )

Loading…
Cancel
Save