<link href="../fonts/font.css" rel="stylesheet" type="text/css">

<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fa">
		<id>https://wiki.imaroof.ir/index.php?action=history&amp;feed=atom&amp;title=%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C%3AGadget-BugStatusUpdate.js</id>
		<title>مدیاویکی:Gadget-BugStatusUpdate.js - تاریخچهٔ ویرایش‌ها</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.imaroof.ir/index.php?action=history&amp;feed=atom&amp;title=%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C%3AGadget-BugStatusUpdate.js"/>
		<link rel="alternate" type="text/html" href="https://wiki.imaroof.ir/index.php?title=%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C:Gadget-BugStatusUpdate.js&amp;action=history"/>
		<updated>2026-08-02T06:53:46Z</updated>
		<subtitle>تاریخچهٔ ویرایش‌های این صفحه در ویکی</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://wiki.imaroof.ir/index.php?title=%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C:Gadget-BugStatusUpdate.js&amp;diff=34&amp;oldid=prev</id>
		<title>Admin: صفحه‌ای تازه حاوی «/*  * Bug Status Update Gadget  *  * Authors:  * Written by Rob Moen (robm) (originally from mw:User:Robmoen/bugStatusUpdate.js).  * Po...» ایجاد کرد</title>
		<link rel="alternate" type="text/html" href="https://wiki.imaroof.ir/index.php?title=%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C:Gadget-BugStatusUpdate.js&amp;diff=34&amp;oldid=prev"/>
				<updated>2016-02-27T11:02:19Z</updated>
		
		<summary type="html">&lt;p&gt;صفحه‌ای تازه حاوی «/*  * Bug Status Update Gadget  *  * Authors:  * Written by Rob Moen (robm) (originally from &lt;a href=&quot;https://www.mediawiki.org/wiki/%D8%B5%D9%81%D8%AD%D9%87_%D8%A7%D8%B5%D9%84%DB%8C:User:Robmoen/bugStatusUpdate.js&quot; class=&quot;extiw&quot; title=&quot;mw:User:Robmoen/bugStatusUpdate.js&quot;&gt;mw:User:Robmoen/bugStatusUpdate.js&lt;/a&gt;).  * Po...» ایجاد کرد&lt;/p&gt;
&lt;p&gt;&lt;b&gt;صفحهٔ تازه&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/*&lt;br /&gt;
 * Bug Status Update Gadget&lt;br /&gt;
 *&lt;br /&gt;
 * Authors:&lt;br /&gt;
 * Written by Rob Moen (robm) (originally from [[mw:User:Robmoen/bugStatusUpdate.js]]).&lt;br /&gt;
 * Ported to Phabricator by Matthew Flaschen (Mattflaschen (WMF))&lt;br /&gt;
 *&lt;br /&gt;
 * Description:&lt;br /&gt;
 *  Finds and updates bug status templates on a page.&lt;br /&gt;
 *  Makes 1 JSONP request to phabricator-bug-status API (maintained by Matthew Flaschen)&lt;br /&gt;
 *  (which passes the request to Phabricator's Conduit API)&lt;br /&gt;
 *&lt;br /&gt;
 * Maintained at: [[mw:MediaWiki:Gadget-BugStatusUpdate.js]]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
( function( $ ){&lt;br /&gt;
	var	ids = [],&lt;br /&gt;
		target = 'https://tools.wmflabs.org/phabricator-bug-status/queryTasks';&lt;br /&gt;
&lt;br /&gt;
	var getParams = function( ids ) {&lt;br /&gt;
		return $.param( { ids: JSON.stringify( ids ) } );&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	// Get the Phabricator task id numbers on the page&lt;br /&gt;
	// The template should provide a data attribute, for simplicity and probably better performance.  There&lt;br /&gt;
	// should also be a class, so it could quickly be found.  E.g.&lt;br /&gt;
	// data-phabricator-task=&amp;quot;123&amp;quot; class=&amp;quot;trakfab ...&amp;quot; ...&lt;br /&gt;
	// This could then be selected easily, and the number could be accessed with .data( 'phabricatorTask' )&lt;br /&gt;
	$( '.mw-trackedTemplate a[title^=&amp;quot;phabricator:T&amp;quot;]' ).each( function() {&lt;br /&gt;
		var titleMatch = $( this ).attr( 'title' ).match( /phabricator:T(\d*)/ );&lt;br /&gt;
		if ( titleMatch !== null ) {&lt;br /&gt;
			ids.push( parseInt( titleMatch[1], 10 ) );&lt;br /&gt;
		}&lt;br /&gt;
	});&lt;br /&gt;
&lt;br /&gt;
	// Do not query if no ids were found&lt;br /&gt;
	if ( !ids.length ) {&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Make jsonp&lt;br /&gt;
	$.ajax( {&lt;br /&gt;
		url: target,&lt;br /&gt;
		dataType: 'jsonp',&lt;br /&gt;
		data: getParams( ids ),&lt;br /&gt;
		success: function ( data ) {&lt;br /&gt;
&lt;br /&gt;
			var		color = {&lt;br /&gt;
						&amp;quot;resolved&amp;quot;: &amp;quot;green&amp;quot;&lt;br /&gt;
					},&lt;br /&gt;
					statusProps = {&lt;br /&gt;
						'font-weight': 'bold',&lt;br /&gt;
						'text-transform': 'uppercase'&lt;br /&gt;
					},&lt;br /&gt;
					phid, taskInfo, taskNumber, selector,&lt;br /&gt;
					trackedTemplate, $taskLink, $title, $item,&lt;br /&gt;
					$status;&lt;br /&gt;
&lt;br /&gt;
			for( phid in data ) {&lt;br /&gt;
				taskInfo = data[phid];&lt;br /&gt;
				taskNumber = taskInfo.id;&lt;br /&gt;
				// Find the right task to update&lt;br /&gt;
				selector = '.mw-trackedTemplate a[title^=&amp;quot;phabricator:T' +  taskNumber + '&amp;quot;]';&lt;br /&gt;
				$taskLink = $( selector );&lt;br /&gt;
				$title = $taskLink.find( '.trakfab-T' + taskNumber );&lt;br /&gt;
				if ( $title ) {&lt;br /&gt;
					$title.text( taskInfo.title );&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				$item = $taskLink.closest( '.mw-trackedTemplate' );&lt;br /&gt;
				if( $item ) {&lt;br /&gt;
					// Find child, if exists&lt;br /&gt;
					// This is very fragile; this needs a class.&lt;br /&gt;
					$status = $item.children( 'span' );&lt;br /&gt;
&lt;br /&gt;
					// Create the status element if it does not exist&lt;br /&gt;
					if( $status.length === 0 ) {&lt;br /&gt;
						$status = $( '&amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;' )&lt;br /&gt;
							.css( statusProps );&lt;br /&gt;
						$item.append( '&amp;lt;br&amp;gt;', $status );&lt;br /&gt;
					}&lt;br /&gt;
&lt;br /&gt;
					// Update the status element&lt;br /&gt;
					// This matches Template:Tracked itself, where only resolved has a color&lt;br /&gt;
					// defined for Phabricator (everything else is black).&lt;br /&gt;
					$status&lt;br /&gt;
						.text( taskInfo.statusName )&lt;br /&gt;
						.css( 'color', color[taskInfo.status] || 'black' );&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	} );&lt;br /&gt;
})( jQuery );&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>