Ticket #2386: 2386_4.patch
File 2386_4.patch, 3.7 KB (added by , 16 years ago) |
---|
-
FCKeditorSajax.body.php
93 93 } 94 94 95 95 function wfSajaxSearchArticleFCKeditor( $term ) { 96 global $wgContLang, $wgOut ;96 global $wgContLang, $wgOut, $wgExtraNamespaces; 97 97 $limit = 10; 98 98 $ns = NS_MAIN; 99 99 100 100 $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) ); 101 101 102 if (strpos( $term, "Category:") === 0) {102 if (strpos(strtolower($term), "category:") === 0) { 103 103 $ns = NS_CATEGORY; 104 104 $term = substr($term, 9); 105 105 $prefix = "Category:"; 106 106 } 107 else if (strpos( $term, ":Category:") === 0) {107 else if (strpos(strtolower($term), ":category:") === 0) { 108 108 $ns = NS_CATEGORY; 109 109 $term = substr($term, 10); 110 110 $prefix = ":Category:"; 111 111 } 112 else if (strpos(strtolower($term), "media:") === 0) { 113 $ns = NS_IMAGE; 114 $term = substr($term, 6); 115 $prefix = "Media:"; 116 } 117 else if (strpos(strtolower($term), ":image:") === 0) { 118 $ns = NS_IMAGE; 119 $term = substr(strtolower($term), 7); 120 $prefix = ":Image:"; 121 } 122 else if ( strpos($term,":") && is_array($wgExtraNamespaces )) { 123 $pos = strpos($term,":"); 124 $find_ns = array_search(substr($term,0,$pos),$wgExtraNamespaces); 125 if ($find_ns) { 126 $ns = $find_ns; 127 $prefix = substr($term,0,$pos+1); 128 $term = substr($term,$pos+1); 129 } 130 } 112 131 113 132 $term1 = str_replace( ' ', '_', $wgContLang->ucfirst( $term ) ); 114 133 $term2 = str_replace( ' ', '_', $wgContLang->lc( $term ) ); -
plugins/mediawiki/dialogs/link.html
192 192 var aLinks = oLink ? [ oLink ] : oEditor.FCK.CreateLink( sUri ) ; 193 193 194 194 // If no selection, no links are created, so use the uri as the link text (by dom, 2006-05-26) 195 var noTitle = false; 195 196 var aHasSelection = ( aLinks.length > 0 ) ; 196 197 if ( !aHasSelection ) 197 198 { 198 sInnerHtml = sUri; 199 sInnerHtml = realUri; 200 noTitle = true; 199 201 200 202 var oLinkPathRegEx = new RegExp("//?([^?\"']+)([?].*)?$") ; 201 var asLinkPath = oLinkPathRegEx.exec( sUri ) ;203 var asLinkPath = oLinkPathRegEx.exec( realUri ) ; 202 204 if (asLinkPath != null) 203 205 sInnerHtml = asLinkPath[1]; // use matched path 204 206 … … 223 225 else 224 226 oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML 225 227 228 if ( noTitle ) 229 SetAttribute( oLink, '_fcknotitle','true'); 226 230 } 227 231 228 232 // Select the (first) link. -
plugins/mediawiki/fckplugin.js
403 403 //#2223 404 404 if (htmlNode.getAttribute( '_fcknotitle' ) && htmlNode.getAttribute( '_fcknotitle' ) == "true") 405 405 { 406 var test Inner = FCKConfig.ProtectedSource.Revert(htmlNode.innerHTML, 0);406 var testHref = FCKConfig.ProtectedSource.Revert(href, 0); 407 407 if (href.toLowerCase().StartsWith( 'category:' )) testInner = 'Category:'+testInner; 408 testInner = testInner.replace(/&/, "&") 409 if ( testInner == FCKConfig.ProtectedSource.Revert(href, 0) ) pipeline = false; 408 if (testHref.toLowerCase().StartsWith( 'rtecolon' ) ) 409 testHref = testHref.replace( /rtecolon/, ":" ) ; 410 testInner = testInner.replace( /&/, "&" ) ; 411 if ( testInner == testHref ) pipeline = false ; 410 412 } 411 413 if (href.toLowerCase().StartsWith( 'rtecolon' )) //change 'rtecolon=' => ':' in links 412 414 {