sajax is an ancient ajax library, it's part of our legacy code. And it still gets to sneak a license note into our README.

It's probably about time that we start making sure that code is ready for the day it disappears. Just as code shouldn't be relying on bits and pieces of wikibits.

Currently the only parts of core that depend on sajax are the legacy mwsuggest and upload.js. mwsuggest is going to disappear when Krinkle's work making simplesearch's suggestions work universally is finished.
I'm not sure what's going on with upload.js.

The real problem however is extensions. For some reason it appears that we STILL have extensions depending on sajax. And I'm not talking about ancient extensions on the wiki or in svn. I only did an ack through stuff that's currently in git.

So I welcome anyone who is interested in going through extension code and eliminating the use of sajax in favor of jQuery.ajax and RL.


core/skins/common/ajax.js
3:window.sajax_debug_mode = false;
4:window.sajax_request_type = 'GET';
7: * if sajax_debug_mode is true, this function outputs given the message into 8: * the element with id = sajax_debug; if no such element exists in the document,
11:window.sajax_debug = function(text) {
12:     if (!sajax_debug_mode) return false;
14:     var e = document.getElementById( 'sajax_debug' );
18:             e.className = 'sajax_debug';
19:             e.id = 'sajax_debug';
41:window.sajax_init_object = function() {
42:     sajax_debug( 'sajax_init_object() called..' );
61:             sajax_debug( 'Could not create connection object.' );
77: * sajax_do_call( 'doFoo', [1, 2, 3], document.getElementById( 'showFoo' ) );
83:window.sajax_do_call = function(func_name, args, _target) {
88:     if ( sajax_request_type == 'GET' ) {
105:    x = sajax_init_object();
112:            x.open( sajax_request_type, uri, true );
119:    if ( sajax_request_type == 'POST' ) {
130: sajax_debug( 'received (' + x.status + ' ' + x.statusText + ') ' + x.responseText ); 153: alert( 'bad _target for sajax_do_call: not a function or object: ' + _target );
157:    sajax_debug( func_name + ' uri = ' + uri + ' / post = ' + post_data );
159:    sajax_debug( func_name + ' waiting..' );
169:    var request = sajax_init_object();

core/skins/common/mwsuggest.js
489:            var xmlhttp = sajax_init_object();

core/skins/common/upload.js
99:             if ( !ajaxUploadDestCheck || !sajax_init_object() ) return;
124:            if ( !ajaxUploadDestCheck || !sajax_init_object() ) return;
133:            if ( !ajaxUploadDestCheck || !sajax_init_object() ) return;
141: sajax_do_call( 'SpecialUpload::ajaxGetExistsWarning', [this.nameToCheck],
287:            var req = sajax_init_object();

extensions/CommunityVoice/Resources/CommunityVoice.js
100:            var oldRequestType = sajax_request_type;
102:            sajax_request_type = "POST";
104:            sajax_do_call(
114:            sajax_request_type = oldRequestType;

extensions/DonationInterface/modules/validate_input.js
14:     sajax_do_call( 'efPayflowGatewayCheckSession', [], checkSession );

extensions/Drafts/Drafts.js
76:             var oldRequestType = sajax_request_type;
78:             sajax_request_type = 'POST';
80:             sajax_do_call(
98:             sajax_request_type = oldRequestType;

extensions/OnlineStatus/OnlineStatus.js
35:             sajax_do_call( 'OnlineStatus::Ajax', ['get'], function( x ){
71:     sajax_do_call( 'OnlineStatus::Ajax', ['set', status], function( x ){

extensions/ReaderFeedback/readerfeedback.js
36:  /*extern sajax_init_object, sajax_do_call */
92: sajax_do_call( "ReaderFeedbackPage::AjaxReview", args, wgAjaxFeedback.processResult );

extensions/SecurePoll/resources/SecurePoll.js
95: sajax_do_call( 'wfSecurePollStrike', [ action, id, reason ], processResult );

extensions/SemanticForms/includes/SF_FormUtils.php
450:function FCK_sajax(func_name, args, _target) {
451:    sajax_request_type = 'POST' ;
452:    sajax_do_call(func_name, args, function (x) {
716:            sajax_request_type = 'POST' ;
718: sajax_do_call('wfSajaxWikiToHTML', [SRCtextarea.value], function ( result ){
736:    if (!oFCKeditor.ready) return false;            //sajax_do_call in 
action
754:                    sajax_request_type = 'GET' ;
755: sajax_do_call( 'wfSajaxToggleFCKeditor', ['hide'], function(){} ) ; //remember closing in session

extensions/SemanticForms/libs/SF_ajax_form_preview.js
43:     var aj = sajax_init_object();
44:     var aj2 = sajax_init_object();
70: // if (!oFCKeditor.ready) return false; //sajax_do_call in action - what do we do?

extensions/SemanticForms/libs/SF_autoedit.js
35:             sajax_request_type = 'POST';
37: sajax_do_call( 'SFAutoeditAPI::handleAutoEdit', data, function( ajaxHeader ){

extensions/SemanticForms/libs/SF_submit.js
55:                     sajax_request_type = 'POST';
58: sajax_do_call( 'SFAutoeditAPI::handleAutoEdit', new Array(collectData( form ), false), function( ajaxHeader ){

extensions/SemanticResultFormats/formats/slideshow/resources/ext.srf.slideshow.js
415:                    sajax_request_type = 'POST';
418: sajax_do_call( 'SRFSlideShow::handleGetResult', [ results[index][0], template, printrequests ], function( ajaxHeader ){

--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to