<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="cs">
	<id>https://wikisofia.cz/w/index.php?action=history&amp;feed=atom&amp;title=U%C5%BEivatel%3AAdmin%2FTestVe.js</id>
	<title>Uživatel:Admin/TestVe.js - Historie editací</title>
	<link rel="self" type="application/atom+xml" href="https://wikisofia.cz/w/index.php?action=history&amp;feed=atom&amp;title=U%C5%BEivatel%3AAdmin%2FTestVe.js"/>
	<link rel="alternate" type="text/html" href="https://wikisofia.cz/w/index.php?title=U%C5%BEivatel:Admin/TestVe.js&amp;action=history"/>
	<updated>2026-04-20T20:11:33Z</updated>
	<subtitle>Historie editací této stránky</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wikisofia.cz/w/index.php?title=U%C5%BEivatel:Admin/TestVe.js&amp;diff=11318&amp;oldid=prev</id>
		<title>Admin: Založena nová stránka s textem „/**  * Adds dialog for selecting citation tempalte.  * Written by: User:ערן and User:Ravid ziv  */ (function () {   /************* Configuration…“</title>
		<link rel="alternate" type="text/html" href="https://wikisofia.cz/w/index.php?title=U%C5%BEivatel:Admin/TestVe.js&amp;diff=11318&amp;oldid=prev"/>
		<updated>2014-12-04T13:12:16Z</updated>

		<summary type="html">&lt;p&gt;Založena nová stránka s textem „&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;*  * Adds dialog for selecting citation tempalte.  * Written by: &lt;a href=&quot;/w/index.php?title=U%C5%BEivatel:%D7%A2%D7%A8%D7%9F&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Uživatel:ערן (stránka neexistuje)&quot;&gt;User:ערן&lt;/a&gt; and &lt;a href=&quot;/w/index.php?title=U%C5%BEivatel:Ravid_ziv&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Uživatel:Ravid ziv (stránka neexistuje)&quot;&gt;User:Ravid ziv&lt;/a&gt;: &lt;/span&gt; (function () {   /************* Configuration…“&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nová stránka&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/**&lt;br /&gt;
 * Adds dialog for selecting citation tempalte.&lt;br /&gt;
 * Written by: [[User:ערן]] and [[User:Ravid ziv]]&lt;br /&gt;
 */&lt;br /&gt;
(function () {&lt;br /&gt;
 &lt;br /&gt;
/************* Configuration section *******************************************/&lt;br /&gt;
 &lt;br /&gt;
	var DialogTitle = 'Select citation template';&lt;br /&gt;
	//Configurate the most common citation templates and their parameters here&lt;br /&gt;
	var CitationTemplates = {&lt;br /&gt;
	'Cite Web ': { template: {&lt;br /&gt;
			target: {&lt;br /&gt;
				href: 'Template:cite web',&lt;br /&gt;
				wt: 'cite web'&lt;br /&gt;
			},&lt;br /&gt;
			params: {&lt;br /&gt;
				'first': {wt: ''},&lt;br /&gt;
				'last': {wt: ''},&lt;br /&gt;
				'title': {wt: ''},&lt;br /&gt;
				'url': {wt: ''},&lt;br /&gt;
				'publisher': {wt: ''},&lt;br /&gt;
				'accessdate': {wt: ''}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	'Cite news': { template: {&lt;br /&gt;
			target: {&lt;br /&gt;
				href: 'Template:cite news',&lt;br /&gt;
				wt: 'cite news'&lt;br /&gt;
			},&lt;br /&gt;
			params: {&lt;br /&gt;
				'first': {wt: ''},&lt;br /&gt;
				'last': {wt: ''},&lt;br /&gt;
				'title': {wt: ''},&lt;br /&gt;
				'url': {wt: ''},&lt;br /&gt;
				'accessdate': {wt: ''},&lt;br /&gt;
				'newspaper': {wt: ''}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	'Cite book': { template: {&lt;br /&gt;
			target: {&lt;br /&gt;
				href: 'Template:cite book',&lt;br /&gt;
				wt: 'cite book'&lt;br /&gt;
			},&lt;br /&gt;
			params: {&lt;br /&gt;
				'first': {wt: ''},&lt;br /&gt;
				'last': {wt: ''},&lt;br /&gt;
				'date': {wt: ''},&lt;br /&gt;
				'publisher': {wt: ''},&lt;br /&gt;
				'location': {wt: ''},&lt;br /&gt;
				'isbn': {wt: ''},&lt;br /&gt;
				'page': {wt: ''},&lt;br /&gt;
				'url': {wt: ''}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	'Cite journal ': { template: {&lt;br /&gt;
				target: {&lt;br /&gt;
					href: 'Template:cite journal',&lt;br /&gt;
					wt: 'cite journal'&lt;br /&gt;
				},&lt;br /&gt;
				params: {&lt;br /&gt;
					'first': {wt: ''},&lt;br /&gt;
					'last': {wt: ''},&lt;br /&gt;
					'coauthors': {wt: ''},&lt;br /&gt;
					'journal': {wt: ''},&lt;br /&gt;
					'date': {wt: ''},&lt;br /&gt;
					'volume': {wt: ''},&lt;br /&gt;
					'series': {wt: ''},&lt;br /&gt;
					'issue': {wt: ''},&lt;br /&gt;
					'page': {wt: ''},&lt;br /&gt;
					'doi': {wt: ''},&lt;br /&gt;
					'pmid': {wt: ''},&lt;br /&gt;
					'url': {wt: ''},&lt;br /&gt;
					'accessdate': {wt: ''}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
 &lt;br /&gt;
/*************************** end of configuration section *********************/&lt;br /&gt;
ve.ui.VeUiMWCiteDialog = function VeUiMWCiteDialog( surface, config ) {&lt;br /&gt;
	// Configuration initialization&lt;br /&gt;
	config = ve.extendObject( { 'size': 'medium' }, config );&lt;br /&gt;
	// Parent constructor&lt;br /&gt;
	ve.ui.MWReferenceDialog.call( this, surface, config );&lt;br /&gt;
 &lt;br /&gt;
	this.followTransactions  = false;&lt;br /&gt;
 &lt;br /&gt;
};&lt;br /&gt;
 &lt;br /&gt;
/* Inheritance */&lt;br /&gt;
 &lt;br /&gt;
OO.inheritClass( ve.ui.VeUiMWCiteDialog, ve.ui.MWReferenceDialog );&lt;br /&gt;
 &lt;br /&gt;
/* Static Properties */&lt;br /&gt;
 &lt;br /&gt;
ve.ui.VeUiMWCiteDialog.static.name = 'Cite';&lt;br /&gt;
 &lt;br /&gt;
ve.ui.VeUiMWCiteDialog.static.title = DialogTitle;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
ve.ui.VeUiMWCiteDialog.prototype.initialize = function ( ) {&lt;br /&gt;
	ve.ui.MWReferenceDialog.prototype.initialize.call(this);&lt;br /&gt;
	// hide reference panel&lt;br /&gt;
	this.editPanel.$element.hide()&lt;br /&gt;
	this.$foot.hide();&lt;br /&gt;
 &lt;br /&gt;
	this.templatesPanel = new OO.ui.PanelLayout( {&lt;br /&gt;
		'$': this.$, 'scrollable': true, 'padded': true&lt;br /&gt;
	} );&lt;br /&gt;
 &lt;br /&gt;
	this.panels.addItems( [ this.templatesPanel ] );&lt;br /&gt;
 &lt;br /&gt;
	var buttons = [];&lt;br /&gt;
	for (var buttonName in CitationTemplates) {&lt;br /&gt;
		var button = new OO.ui.ButtonWidget( {&lt;br /&gt;
			'$': this.$,&lt;br /&gt;
			'label': buttonName,&lt;br /&gt;
		} );&lt;br /&gt;
		button.connect( this, { 'click': [ 'citeWeb', CitationTemplates[buttonName] ] } );&lt;br /&gt;
		buttons.push(button.$element);&lt;br /&gt;
	}&lt;br /&gt;
	this.templatesPanel.$element.append(buttons).show();&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
ve.ui.VeUiMWCiteDialog.prototype.useReference = function ( ref ) {&lt;br /&gt;
 &lt;br /&gt;
	this.followTransactions  = false;&lt;br /&gt;
	ve.ui.MWReferenceDialog.prototype.useReference.call(this, ref);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
ve.ui.VeUiMWCiteDialog.prototype.citeWeb = function( emptyTemplate ){&lt;br /&gt;
	this.referenceSurface.getSurface().getModel().getFragment().collapseRangeToEnd().insertContent([{'type': 'mwTransclusionInline','attributes': {'mw':&lt;br /&gt;
 	{&lt;br /&gt;
		parts: [ emptyTemplate ]&lt;br /&gt;
	}}}]);&lt;br /&gt;
	this.followTransactions  = true;&lt;br /&gt;
	this.referenceSurface.getSurface().execute('dialog', 'open', 'transclusion', null);&lt;br /&gt;
	var self = this;&lt;br /&gt;
	this.referenceSurface.getSurface().getDialogs().getWindow('transclusion').on(&lt;br /&gt;
		'close',function (data){&lt;br /&gt;
			if (data.action=='cancel')&lt;br /&gt;
			{&lt;br /&gt;
				self.close({ 'action': 'cancel' });&lt;br /&gt;
			}&lt;br /&gt;
		});&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
ve.ui.VeUiMWCiteDialog.prototype.onDocumentTransact = function () {&lt;br /&gt;
	if (!this.followTransactions) return;&lt;br /&gt;
	var data = this.referenceSurface.getSurface().getModel().getDocument().getFullData();&lt;br /&gt;
	for (var j=0;j&amp;lt;data.length;j++)&lt;br /&gt;
	{&lt;br /&gt;
		var node = data[j];&lt;br /&gt;
		if (node.type ===&amp;quot;mwTransclusionInline&amp;quot; &amp;amp;&amp;amp; node.hasOwnProperty('attributes') )&lt;br /&gt;
		{&lt;br /&gt;
			var params = node.attributes.mw.parts[0].template.params;&lt;br /&gt;
			this.close( { 'action': 'insert' } );&lt;br /&gt;
		}&lt;br /&gt;
	} &lt;br /&gt;
};&lt;br /&gt;
 &lt;br /&gt;
/* Registration */&lt;br /&gt;
 &lt;br /&gt;
ve.ui.dialogFactory.register( ve.ui.VeUiMWCiteDialog );&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
function CiteTool( toolGroup, config ) {&lt;br /&gt;
	OO.ui.Tool.call( this, toolGroup, config );&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
OO.inheritClass( CiteTool, OO.ui.Tool );&lt;br /&gt;
 &lt;br /&gt;
CiteTool.static.name = 'CiteTool';&lt;br /&gt;
CiteTool.static.title = 'Cite'&lt;br /&gt;
 &lt;br /&gt;
CiteTool.prototype.onSelect = function () {&lt;br /&gt;
	this.toolbar.getSurface().execute('dialog', 'open', 'Cite', null);&lt;br /&gt;
};&lt;br /&gt;
 &lt;br /&gt;
CiteTool.prototype.onUpdateState = function () {&lt;br /&gt;
	this.setActive( false );&lt;br /&gt;
};&lt;br /&gt;
 &lt;br /&gt;
ve.ui.toolFactory.register( CiteTool );&lt;br /&gt;
 &lt;br /&gt;
})();&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
</feed>