https://bugzilla.wikimedia.org/show_bug.cgi?id=21682

           Summary: EditWarning script warns about leaving a page that is
                    not changed
           Product: MediaWiki
           Version: 1.16-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: Normal
         Component: User preferences
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Steps:
1. Enable EditWarning script (UsabilityInitiative/EditWarning/EditWarning.js).
2. Enable preview upon first edit.
3. Edit any page.
4. Attempt to close it without any changes.

The problem is that the script checks if the preview element is available, but
it should be checking whether the action is "submit". That is:
// Check if the current values of some form elements are the same as
// the original values
if(
        wgAction == 'submit'
        || $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val()
        || $j( '#wpTextbox1' ).data( 'origtext' ) != $j( '#wpTextbox1' ).val()
) {
...

Rather then currently used:
// Check if the current values of some form elements are the same as
// the original values
if(
        $j( '#wpTextbox1' ).data( 'origtext' ) != $j( '#wpTextbox1' ).val()
        || $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val()
        || $j( '#wikiPreview' ).is( ':visible' )
) {
...

BTW. The order of checks is intentional - the check of origtext and wpTextbox1
val is potentially the most time (CPU) consuming and therefore the script
should rule out other options first.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to