Kipcool has submitted this change and it was merged.

Change subject: Special Popup
......................................................................


Special Popup

Just added a way to use popups, not just annotation.  Nothing fancy.

Patch 2: replaced some double quotes with single quotes.

Patch 3: declared private vars. finished $o / $this->o transition.

Change-Id: Ib0001ebe7f37e1989e7769af49865e201750cc55
---
M OmegaWiki/SpecialPopupEditor.php
M resources/omegawiki-ajax.js
2 files changed, 157 insertions(+), 128 deletions(-)

Approvals:
  Kipcool: Verified; Looks good to me, approved



diff --git a/OmegaWiki/SpecialPopupEditor.php b/OmegaWiki/SpecialPopupEditor.php
index 496fa64..f4e6051 100644
--- a/OmegaWiki/SpecialPopupEditor.php
+++ b/OmegaWiki/SpecialPopupEditor.php
@@ -9,6 +9,18 @@
 */
 class SpecialPopUpEditor extends SpecialPage {
 
+       // o = OmegaWikiAttributes::getInstance()
+       private $o;
+
+       // html that is output
+       private $output;
+
+       // request variable from MediaWiki
+       private $request;
+
+       // action is view or edit or history
+       private $action;
+
        function __construct() {
                parent::__construct( 'PopupEditor', 'UnlistedSpecialPage' );
        }
@@ -23,28 +35,42 @@
                require_once( 'Transaction.php' );
                require_once( 'WikiDataTables.php' );
 
-               $o = OmegaWikiAttributes::getInstance();
+               $this->o = OmegaWikiAttributes::getInstance();
 
                // disable standard output
                $this->getOutput()->disable();
-               $output = '';
+               $this->output = '';
 
                // get the variables from request
-               $request = $this->getRequest();
+               $this->request = $this->getRequest();
 
                // view or edit or history, default: view
-               $action = $request->getVal( 'action', 'view' );
+               $this->action = $this->request->getVal( 'action', 'view' );
 
+               // get type of popup
+               $popupType = $this->request->getVal( 'type', '' );
+               if ( $popupType === '' ) {
+                       echo "type undefined\n";
+                       die();
+               }
+
+               if ( $popupType == 'annotation') {
+                       $this->annotation();
+               }
+
+       }
+
+       protected function annotation() {
                // exists if we edit Syntrans attributes
                // for the moment we do Syntrans attributes, so we test its 
existence
-               $syntransId = $request->getVal( 'syntransid', '' );
+               $syntransId = $this->request->getVal( 'syntransid', '' );
                if ( $syntransId === '' ) {
                        echo "syntransId undefined\n";
                        die();
                }
 
                // always exists
-               $definedMeaningId = $request->getVal( 'dmid', '' );
+               $definedMeaningId = $this->request->getVal( 'dmid', '' );
                if ( $definedMeaningId === '' ) {
                        echo "definedMeaningId undefined\n";
                        die();
@@ -53,7 +79,7 @@
                // do we need $idPathFlat or can we put a dummy string?
                // $idPathLocal = new IdStack( '' );
                // for the moment we need it because we use the "old" functions 
to save
-               $idPathFlat = $request->getVal( 'idpathflat', '' );
+               $idPathFlat = $this->request->getVal( 'idpathflat', '' );
                if ( $idPathFlat === '' ) {
                        echo "idPathFlat undefined\n";
                        die();
@@ -64,18 +90,18 @@
 
                // start building the output
                $id = 'popup-' . $idPathFlat . '-toggleable' ;
-               $output .= Html::openElement ('div', array( 'class' => 
"popupToggleable", 'id' => $id ));
-               if ( $action !== 'history' ) {
+               $this->output .= Html::openElement ('div', array( 'class' => 
"popupToggleable", 'id' => $id ));
+               if ( $this->action !== 'history' ) {
                        // show edit, save, cancel buttons in view and edit mode
                        // but not in history mode
-                       $output .= $this->getHtmlButtons();
+                       $this->output .= $this->getHtmlButtons();
                }
 
 
                // ViewInformation and attributes
                $viewInformation = new ViewInformation();
 
-               switch ( $action ) {
+               switch ( $this->action ) {
                        case 'view':
                                // $viewInformation->viewOrEdit = 'view';
                                $viewInformation->queryTransactionInformation = 
new QueryLatestTransactionInformation();
@@ -97,19 +123,19 @@
 
 
                // Creating the editor
-               $syntransAttributesEditor = $this->getSyntransAttributesEditor( 
$viewInformation, $o );
+               $syntransAttributesEditor = $this->getSyntransAttributesEditor( 
$viewInformation );
 
                // the values (ArrayRecord) to fill the editor
                $recordArray = getObjectAttributesRecord( $syntransId, 
$viewInformation, null, "SYNT" );
 
-               if ( $action === 'edit' ) {
+               if ( $this->action === 'edit' ) {
                        // EDIT
-                       $output .= $syntransAttributesEditor->edit( 
$idPathLocal, $recordArray );
+                       $this->output .= $syntransAttributesEditor->edit( 
$idPathLocal, $recordArray );
 
                        // in edit mode, add buttons at the bottom as well
-                       $output .= $this->getHtmlButtons();
+                       $this->output .= $this->getHtmlButtons();
 
-               } elseif ( $action === 'save' ) {
+               } elseif ( $this->action === 'save' ) {
                        // SAVE
                        // we don't call startNewTransaction here, it is called 
directly
                        // inside the function when something to save is found.
@@ -120,51 +146,49 @@
 
                        // switch to view mode and refresh the values, 
according to what was saved
                        $viewInformation->viewOrEdit = 'view';
-                       $syntransAttributesEditor = 
$this->getSyntransAttributesEditor( $viewInformation, $o );
+                       $syntransAttributesEditor = 
$this->getSyntransAttributesEditor( $viewInformation );
                        $recordArray = getObjectAttributesRecord( $syntransId, 
$viewInformation, null, "SYNT" );
 
                        // and view the result
-                       $output .= $syntransAttributesEditor->view( 
$idPathLocal, $recordArray );
+                       $this->output .= $syntransAttributesEditor->view( 
$idPathLocal, $recordArray );
 
                } else {
                        // VIEW (default)
-                       $output .= $syntransAttributesEditor->view( 
$idPathLocal, $recordArray );
+                       $this->output .= $syntransAttributesEditor->view( 
$idPathLocal, $recordArray );
                }
 
-               $output .= Html::closeElement ('div');
+               $this->output .= Html::closeElement ('div');
 
-               echo $output;
+               echo $this->output;
        }
 
        /**
         * create back the idStack
         */
        protected function getDmSyntIdStack( $definedMeaningId, $syntransId ) {
-               $o = OmegaWikiAttributes::getInstance();
-
                // the result should look like 
dm-1487027-syntrans-1487033-objAtt
 
                // level1: DM
-               $definedMeaningIdStructure = new Structure( 
$o->definedMeaningId );
+               $definedMeaningIdStructure = new Structure( 
$this->o->definedMeaningId );
                $definedMeaningIdRecord = new ArrayRecord( 
$definedMeaningIdStructure );
                $definedMeaningIdRecord->definedMeaningId = $definedMeaningId;
-               
+
                $idStack = new IdStack( WLD_DEFINED_MEANING );
                $idStack->pushKey( $definedMeaningIdRecord );
-               
+
                $idStack->pushDefinedMeaningId( $definedMeaningId );
                $idStack->pushClassAttributes( new ClassAttributes( 
$definedMeaningId ) );
 
                // level2: Syntrans
-               $syntransIdStructure = new Structure( $o->syntransId );
+               $syntransIdStructure = new Structure( $this->o->syntransId );
                $syntransIdRecord = new ArrayRecord( $syntransIdStructure );
                $syntransIdRecord->syntransId = $syntransId;
-//             $idStack->pushAttribute( $o->syntransId );
-               $idStack->pushAttribute( $o->synonymsAndTranslations );
+//             $idStack->pushAttribute( $this->o->syntransId );
+               $idStack->pushAttribute( $this->o->synonymsAndTranslations );
 
-//             $idStack->pushKey( project( $syntransIdRecord, 
$o->synonymsTranslationsStructure ) );
+//             $idStack->pushKey( project( $syntransIdRecord, 
$this->o->synonymsTranslationsStructure ) );
                $idStack->pushKey( $syntransIdRecord );
-               $idStack->pushAttribute( $o->objectAttributes );
+               $idStack->pushAttribute( $this->o->objectAttributes );
 
                return $idStack;
        }
@@ -173,15 +197,15 @@
         * creates the hierarchical structure editor
         * for view or edit mode according to viewInformation
         */
-       protected function getSyntransAttributesEditor( $viewInformation, $o ) {
+       protected function getSyntransAttributesEditor( $viewInformation ) {
                // the editor is of the class ObjectAttributeValuesEditor 
defined in WrappingEditor.php
                // it wraps a RecordUnorderedListEditor defined in Editor.php
                $syntransAttributesEditor = createObjectAttributesEditor(
                        $viewInformation,
-                       $o->objectAttributes,
+                       $this->o->objectAttributes,
                        wfMessage( "ow_Property" )->text(),
                        wfMessage( "ow_Value" )->text(),
-                       $o->syntransId,
+                       $this->o->syntransId,
                        WLD_SYNTRANS_MEANING_NAME,
                        $viewInformation->getLeftOverAttributeFilter()
                );
@@ -213,7 +237,7 @@
                global $wgUser;
                $now = wfTimestampNow();
                $summary = 'Edited annotations via popup';
-               
+
                $expressionId = getExpressionIdFromSyntrans( $syntransId );
                $expression = getExpression( $expressionId );
                $spelling = $expression->spelling;
diff --git a/resources/omegawiki-ajax.js b/resources/omegawiki-ajax.js
index 914cc3e..e54a636 100644
--- a/resources/omegawiki-ajax.js
+++ b/resources/omegawiki-ajax.js
@@ -4,7 +4,7 @@
         */
 
        // add and manage arrows to navigate the tabs
-       if ( $(".wd-tablist").length ) {
+       if ( $('.wd-tablist').length ) {
                initializeTabs();
 
                $(window).resize(function() {
@@ -13,12 +13,12 @@
        }
 
        // sticky explang
-       var explangUrl = document.URL.match( /explang=\d+/gi ) ;
+       var explangUrl = document.URL.match( /explang=\d+/gi );
        if ( explangUrl!=null ) {
-               var explangNb = explangUrl[0].replace("explang=","") ;
-               $("#ca-edit, #ca-history, #ca-view").find("a").attr( "href", 
function(i, val) {
+               var explangNb = explangUrl[0].replace('explang=','');
+               $('#ca-edit, #ca-history, #ca-view').find('a').attr( 'href', 
function(i, val) {
                        var bigoudi = '&' ;
-                       if ( val.match( /\?/gi ) == null ) bigoudi = '?' ;
+                       if ( val.match( /\?/gi ) == null ) {bigoudi = '?';}
                        return val + bigoudi + 'explang=' + explangNb ;
                });
        }
@@ -30,47 +30,49 @@
 
        // toggle the togglable elements
        // delegated event
-       $("body").on('click', ".toggle", function(event) {
-               $(this).children(".prefix").toggle();
+       $('body').on('click', '.toggle', function(event) {
+               $(this).children('.prefix').toggle();
                $(this).parent().next().fadeToggle('fast');
        });
 
-       $("a").click(function(event) {
+       $('a').click(function(event) {
                // avoid the toggling if a link is clicked
                event.stopPropagation();
        } );
 
        // toggle the annotation popups
-       $(".togglePopup").click(function() {
-               $(this).children("span").toggle();
+       $('.togglePopup').click(function() {
+               $(this).children('span').toggle();
 
                // if no corresponding popupToggleable (in edit mode): create it
                // and get the values
-               if ( $(this).next(".popupToggleable").length == 0 ) {
+               if ( $(this).next('.popupToggleable').length == 0 ) {
 
                        var popupOpenHideLink = this;
                        var myAction = $(this).attr('action');
 
-                       var URL = mw.config.get( 'wgServer' ) + mw.config.get( 
'wgScript' )
+                       var URL = mw.config.get( 'wgServer' ) + mw.config.get( 
'wgScript' );
                        URL = URL + '/Special:PopupEditor';
 
                        var postdata = {
+                               type: 'annotation',
                                syntransid: 
$(popupOpenHideLink).attr('syntransid'),
                                dmid: $(popupOpenHideLink).attr('dmid'),
                                idpathflat: 
$(popupOpenHideLink).attr('idpathflat')
                        };
+
                        if ( myAction === 'history' ) {
                                postdata['action'] = 'history';
                        }
                        $.post( URL, postdata, function(data) {
                                // insert the data and show it
                                $(popupOpenHideLink).after( data );
-                               
$(popupOpenHideLink).next(".popupToggleable").show(100);
+                               
$(popupOpenHideLink).next('.popupToggleable').show(100);
                        });
 
                } else {
                        // there is already data, toggle it
-                       $(this).next(".popupToggleable").toggle(100);
+                       $(this).next('.popupToggleable').toggle(100);
                }
        });
 
@@ -82,10 +84,11 @@
                var popupContent = $(this).parents('.popupToggleable');
                var popupOpenHideLink = $(popupContent).prev('.togglePopup');
 
-               var URL = mw.config.get( 'wgServer' ) + mw.config.get( 
'wgScript' )
+               var URL = mw.config.get( 'wgServer' ) + mw.config.get( 
'wgScript' );
                URL = URL + '/Special:PopupEditor';
 
                var postdata = {
+                       type: 'annotation',
                        syntransid: $(popupOpenHideLink).attr('syntransid'),
                        dmid: $(popupOpenHideLink).attr('dmid'),
                        idpathflat: $(popupOpenHideLink).attr('idpathflat'),
@@ -95,7 +98,7 @@
                        // insert the data and show it
                        $(popupContent).replaceWith( data );
                        // it has been replaced, we need to get the new element
-                       popupContent = 
$(popupOpenHideLink).next(".popupToggleable");
+                       popupContent = 
$(popupOpenHideLink).next('.popupToggleable');
                        $(popupContent).find('.owPopupEdit').hide();
                        $(popupContent).find('.owPopupSave').show();
                        $(popupContent).find('.owPopupCancel').show();
@@ -115,10 +118,11 @@
                var popupContent = $(this).parents('.popupToggleable');
                var popupOpenHideLink = $(popupContent).prev('.togglePopup');
 
-               var URL = mw.config.get( 'wgServer' ) + mw.config.get( 
'wgScript' )
+               var URL = mw.config.get( 'wgServer' ) + mw.config.get( 
'wgScript' );
                URL = URL + '/Special:PopupEditor';
 
                var postdata = {
+                       type: 'annotation',
                        syntransid: $(popupOpenHideLink).attr('syntransid'),
                        dmid: $(popupOpenHideLink).attr('dmid'),
                        idpathflat: $(popupOpenHideLink).attr('idpathflat')
@@ -126,7 +130,7 @@
                $.post( URL, postdata, function(data) {
                        // insert the data and show it
                        $(popupContent).replaceWith( data );
-                       popupContent = 
$(popupOpenHideLink).next(".popupToggleable");
+                       popupContent = 
$(popupOpenHideLink).next('.popupToggleable');
                        $(popupContent).find('.owPopupEdit').show();
                        $(popupContent).find('.owPopupSave').hide();
                        $(popupContent).find('.owPopupCancel').hide();
@@ -141,10 +145,11 @@
                var popupContent = $(this).parents('.popupToggleable');
                var popupOpenHideLink = $(popupContent).prev('.togglePopup');
 
-               var URL = mw.config.get( 'wgServer' ) + mw.config.get( 
'wgScript' )
+               var URL = mw.config.get( 'wgServer' ) + mw.config.get( 
'wgScript' );
                URL = URL + '/Special:PopupEditor';
 
                var postdata = {
+                       type: 'annotation',
                        syntransid: $(popupOpenHideLink).attr('syntransid'),
                        dmid: $(popupOpenHideLink).attr('dmid'),
                        idpathflat: $(popupOpenHideLink).attr('idpathflat'),
@@ -176,7 +181,7 @@
                $.post( URL, postdata, function(data) {
                        // insert the data and show it
                        $(popupContent).replaceWith( data );
-                       popupContent = 
$(popupOpenHideLink).next(".popupToggleable");
+                       popupContent = 
$(popupOpenHideLink).next('.popupToggleable');
                        $(popupContent).find('.owPopupEdit').show();
                        $(popupContent).find('.owPopupSave').hide();
                        $(popupContent).find('.owPopupCancel').hide();
@@ -190,160 +195,160 @@
         * when an expression exists in several languages
         */
        function initializeTabs() {
-               var previousArrow = '<span class="wd-previousArrow">' + "❮" + 
'</span>' ;
-               var nextArrow = '<span class="wd-nextArrow">' + "❯" + '</span>' 
;
+               var previousArrow = '<span class="wd-previousArrow">' + '❮' + 
'</span>' ;
+               var nextArrow = '<span class="wd-nextArrow">' + '❯' + '</span>' 
;
                // add visible class to every item by default
-               $(".wd-tablist").children().addClass("visibleTab");
+               $('.wd-tablist').children().addClass('visibleTab');
                // remove right padding for the last element
-               $(".wd-tablist .wd-tabitem:last").css("padding-right", "0px");
+               $('.wd-tablist .wd-tabitem:last').css('padding-right', '0px');
 
                // remove the tabs that are out of the window
                // theoretically, overflow:hidden should work, but
                // setting overflow and span and float seems a bit tricky
-               var tablistright = $(".wd-tablist").outerWidth(true) + 
$(".wd-tablist").offset().left ;
+               var tablistright = $('.wd-tablist').outerWidth(true) + 
$('.wd-tablist').offset().left ;
                while( tablistright + 30 > $(window).width() ) {
                        // remove tabs on the right until it fits in the window
-                       $(".wd-tablist .visibleTab:last")
-                       .addClass("hiddenTab").removeClass("visibleTab" )
+                       $('.wd-tablist .visibleTab:last')
+                       .addClass('hiddenTab').removeClass('visibleTab' )
                        .hide();
-                       tablistright = $(".wd-tablist").outerWidth(true) + 
$(".wd-tablist").offset().left ;
+                       tablistright = $('.wd-tablist').outerWidth(true) + 
$('.wd-tablist').offset().left ;
                }
 
                // add arrows
-               $(".wd-tablist .wd-tabitem:first").before( previousArrow ) ;
-               $(".wd-previousArrow").hide();
-               $(".wd-tablist ").after( nextArrow );
+               $('.wd-tablist .wd-tabitem:first').before( previousArrow ) ;
+               $('.wd-previousArrow').hide();
+               $('.wd-tablist ').after( nextArrow );
 
                // if the last element is visible, we don't need the nextArrow
-               if ( $(".wd-tablist .wd-tabitem:last").hasClass("visibleTab") ) 
{
-                       $(".wd-nextArrow").hide();
+               if ( $('.wd-tablist .wd-tabitem:last').hasClass('visibleTab') ) 
{
+                       $('.wd-nextArrow').hide();
                }
 
                // next arrow click
-               $(".wd-nextArrow").click(function() {
+               $('.wd-nextArrow').click(function() {
                        // show next tab = first hidden tab after the next 
visible tab
-                       $(".wd-tablist .visibleTab:last").next()
-                       .addClass("visibleTab").removeClass("hiddenTab" )
+                       $('.wd-tablist .visibleTab:last').next()
+                       .addClass('visibleTab').removeClass('hiddenTab')
                        .show();
-                       
+       
                        // show previous arrow
-                       $(".wd-previousArrow").show();
+                       $('.wd-previousArrow').show();
 
                        // remove visible tabs on the left until it fits the 
window
-                       var tablistright = $(".wd-tablist").outerWidth(true) + 
$(".wd-tablist").offset().left ;
+                       var tablistright = $('.wd-tablist').outerWidth(true) + 
$('.wd-tablist').offset().left ;
                        while( tablistright + 30 > $(window).width() ) {
                                // remove visible tabs on the left until it 
fits in the window
-                               $(".wd-tablist .visibleTab:first")
-                               .addClass("hiddenTab").removeClass("visibleTab" 
)
+                               $('.wd-tablist .visibleTab:first')
+                               .addClass('hiddenTab').removeClass('visibleTab')
                                .hide();
-                               tablistright = 
$(".wd-tablist").outerWidth(true) + $(".wd-tablist").offset().left ;
+                               tablistright = 
$('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;
                        }
 
                        // check if maybe we can display more elements on the 
right
-                       while( ( tablistright + 30 < $(window).width() ) && 
$(".wd-tabitem:last").hasClass("hiddenTab") ) {
-                               $(".wd-tablist .visibleTab:last").next()
-                               .addClass("visibleTab").removeClass("hiddenTab" 
)
+                       while( ( tablistright + 30 < $(window).width() ) && 
$('.wd-tabitem:last').hasClass('hiddenTab') ) {
+                               $('.wd-tablist .visibleTab:last').next()
+                               .addClass('visibleTab').removeClass('hiddenTab')
                                .show();
-                               tablistright = 
$(".wd-tablist").outerWidth(true) + $(".wd-tablist").offset().left ;
+                               tablistright = 
$('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;
                        }
                        // remove last tab if we have been to far
                        if ( tablistright + 30 > $(window).width() ) {
-                               $(".wd-tablist .visibleTab:last")
-                               .addClass("hiddenTab").removeClass("visibleTab" 
)
+                               $('.wd-tablist .visibleTab:last')
+                               .addClass('hiddenTab').removeClass('visibleTab')
                                .hide();
                        }
-                       
+       
                        // remove next arrow if last tab is visible
-                       if ( $(".wd-tablist 
.wd-tabitem:last").hasClass("visibleTab") ) {
-                               $(".wd-nextArrow").hide();
+                       if ( $('.wd-tablist 
.wd-tabitem:last').hasClass('visibleTab') ) {
+                               $('.wd-nextArrow').hide();
                        }
-                       
-                       
+       
+       
                }); // nextArrow click
 
                // previous arrow click
-               $(".wd-previousArrow").click(function() {
+               $('.wd-previousArrow').click(function() {
                        // show previous tab = the one before the first visible 
tab
-                       $(".wd-tablist .visibleTab:first").prev()
-                       .addClass("visibleTab").removeClass("hiddenTab" )
+                       $('.wd-tablist .visibleTab:first').prev()
+                       .addClass('visibleTab').removeClass('hiddenTab')
                        .show();
 
                        // show next arrow
-                       $(".wd-nextArrow").show();
-                       
+                       $('.wd-nextArrow').show();
+       
                        // remove previous arrow if first tab is visible
-                       if ( $(".wd-tablist 
.wd-tabitem:first").hasClass("visibleTab") ) {
-                               $(".wd-previousArrow").hide();
+                       if ( $('.wd-tablist 
.wd-tabitem:first').hasClass('visibleTab') ) {
+                               $('.wd-previousArrow').hide();
                        } // if
-                       
+
                        // remove visible tabs on the right until it fits the 
window
-                       var tablistright = $(".wd-tablist").outerWidth(true) + 
$(".wd-tablist").offset().left ;
+                       var tablistright = $('.wd-tablist').outerWidth(true) + 
$('.wd-tablist').offset().left ;
                        while( tablistright + 30 > $(window).width() ) {
                                // remove tabs on the right until it fits in 
the window
-                               $(".wd-tablist .visibleTab:last")
-                               .addClass("hiddenTab").removeClass("visibleTab" 
)
+                               $('.wd-tablist .visibleTab:last')
+                               .addClass('hiddenTab').removeClass('visibleTab')
                                .hide();
-                               tablistright = 
$(".wd-tablist").outerWidth(true) + $(".wd-tablist").offset().left ;
+                               tablistright = 
$('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;
                        }
                }); // click
        } // initializeTabs
-       
-       
+
+
        function updateTabs() {
                // check the situation
-               var tablistright = $(".wd-tablist").outerWidth(true) + 
$(".wd-tablist").offset().left ;
-               
+               var tablistright = $('.wd-tablist').outerWidth(true) + 
$('.wd-tablist').offset().left ;
+
                if ( tablistright + 30 > $(window).width() ) {
                        // the window is now too small, we need to remove some 
tabs (on the right)
                        while( tablistright + 30 > $(window).width() ) {
                                // remove tabs on the right until it fits in 
the window
-                               $(".wd-tablist .visibleTab:last")
-                               .addClass("hiddenTab").removeClass("visibleTab" 
)
+                               $('.wd-tablist .visibleTab:last')
+                               .addClass('hiddenTab').removeClass('visibleTab')
                                .hide();
-                               tablistright = 
$(".wd-tablist").outerWidth(true) + $(".wd-tablist").offset().left ;
+                               tablistright = 
$('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;
                        }
-                       $(".wd-nextArrow").show();
+                       $('.wd-nextArrow').show();
                } else {
                        // the window has been enlarged, there might be extra 
space available
-                       while( ( tablistright + 30 < $(window).width() ) && 
$(".wd-tabitem:last").hasClass("hiddenTab") ) {
-                               $(".wd-tablist .visibleTab:last").next()
-                               .addClass("visibleTab").removeClass("hiddenTab" 
)
+                       while( ( tablistright + 30 < $(window).width() ) && 
$('.wd-tabitem:last').hasClass('hiddenTab') ) {
+                               $('.wd-tablist .visibleTab:last').next()
+                               .addClass('visibleTab').removeClass('hiddenTab')
                                .show();
-                               tablistright = 
$(".wd-tablist").outerWidth(true) + $(".wd-tablist").offset().left ;
+                               tablistright = 
$('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;
                        }
 
                        // remove last tab if we have been to far
                        if ( tablistright + 30 > $(window).width() ) {
-                               $(".wd-tablist .visibleTab:last")
-                               .addClass("hiddenTab").removeClass("visibleTab" 
)
+                               $('.wd-tablist .visibleTab:last')
+                               .addClass('hiddenTab').removeClass('visibleTab')
                                .hide();
                        } else {
                                // all tabs on the right are now visible
-                               $(".wd-nextArrow").hide();
+                               $('.wd-nextArrow').hide();
 
                                // maybe we can still add more tabs on the left?
-                               while( ( tablistright + 30 < $(window).width() 
) && $(".wd-tabitem:first").hasClass("hiddenTab") ) {
-                                       $(".wd-tablist 
.visibleTab:first").prev()
-                                       
.addClass("visibleTab").removeClass("hiddenTab" )
+                               while( ( tablistright + 30 < $(window).width() 
) && $('.wd-tabitem:first').hasClass('hiddenTab') ) {
+                                       $('.wd-tablist 
.visibleTab:first').prev()
+                                       
.addClass('visibleTab').removeClass('hiddenTab')
                                        .show();
-                                       tablistright = 
$(".wd-tablist").outerWidth(true) + $(".wd-tablist").offset().left ;
+                                       tablistright = 
$('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left;
                                }
                                // remove first tab if we have been to far
                                if ( tablistright + 30 > $(window).width() ) {
-                                       $(".wd-tablist .visibleTab:first")
-                                       
.addClass("hiddenTab").removeClass("visibleTab" )
+                                       $('.wd-tablist .visibleTab:first')
+                                       
.addClass('hiddenTab').removeClass('visibleTab')
                                        .hide();
                                } else {
-                                       $(".wd-previousArrow").hide();
+                                       $('.wd-previousArrow').hide();
                                }
                        }
                }
        } // updateTabs
-       
+
 });
 
 
-//TODO: convert the functions below to jQuery...
+//@todo convert the functions below to jQuery...
 
 window.MD5 = function (string) {
 
@@ -421,18 +426,18 @@
        };
 
        function WordToHex(lValue) {
-               var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
+               var WordToHexValue='',WordToHexValue_temp='',lByte,lCount;
                for (lCount = 0;lCount<=3;lCount++) {
                        lByte = (lValue>>>(lCount*8)) & 255;
-                       WordToHexValue_temp = "0" + lByte.toString(16);
+                       WordToHexValue_temp = '0' + lByte.toString(16);
                        WordToHexValue = WordToHexValue + 
WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
                }
                return WordToHexValue;
        };
 
        function Utf8Encode(string) {
-               string = string.replace(/\r\n/g,"\n");
-               var utftext = "";
+               string = string.replace(/\r\n/g,'\n');
+               var utftext = '';
 
                for (var n = 0; n < string.length; n++) {
 

-- 
To view, visit https://gerrit.wikimedia.org/r/135740
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0001ebe7f37e1989e7769af49865e201750cc55
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Hiong3-eng5 <hiong3.e...@gmail.com>
Gerrit-Reviewer: Kipcool <kipmas...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to