Разлика между версии на „МедияУики:Common.js“

От Читалие
Направо към: навигация, търсене
Ред 1: Ред 1:
 +
// Dynamic layouts
 +
if ( !self.ws_layouts ) {
 +
self.ws_layouts = {};
 +
}
 +
self.ws_layouts['Layout 1'] = {
 +
  '#text-wrap':"",
 +
  '#text-container':"" ,
 +
  '#text':"",
 +
  '.sidenote-right':"float:right;margin:0.5em;padding:3px;border:solid 1px gray;max-width:9em;text-indent:0em;text-align:left;",
 +
  '.sidenote-left':"float:left;margin:0.5em;padding:3px;border:solid 1px gray;max-width:9em;text-indent:0em;text-align:left;",
 +
  '.editsection':"display:none",
 +
  '#headertemplate':""
 +
};
 +
self.ws_layouts['Layout 2'] = {
 +
  '#text-wrap':"position:relative;margin-left:3em;margin-right:3em;",
 +
  '#text-container':"width:40em;margin:0px auto;" ,
 +
  '#text':"text-align:justify;",
 +
  '.sidenote-right':"position:absolute; left:37em;width:16em;text-indent:0em;text-align:left;",
 +
  '.sidenote-left':"position:absolute; right:37em;width:16em;text-indent:0em;text-align:right;",
 +
  '.editsection':"display:none",
 +
  '#headertemplate':""
 +
};
 +
self.ws_layouts['Layout 3'] = {
 +
  '#text-wrap':"margin-left:3em",
 +
  '#text-container':"position:relative; min-width:60em; float:left; width:100%; margin-right:-23em;" ,
 +
  '#text':"text-align:justify;margin-right:23em; text-indent:0em; padding-left:0px; padding-right:0px;width:auto; position:relative;",
 +
  '.sidenote-right':"position:absolute; right:-10em; width:9em; background-color:#eeeeee;text-indent:0em;text-align:left;",
 +
  '.sidenote-left':"position:absolute; right:-10em; width:9em; background-color:#eeeeee;text-indent:0em;text-align:left;",
 +
  '.editsection':"display:none",
 +
  '#headertemplate':"position:absolute; top:0em; right:-23em; width:21em;float:right; text-align:left;"
 +
};
 +
 +
self.proofreadpage_add_container = true;
 +
 +
mw.loader.load('http://wiki.workroom.chitanka.local/index.php?title=MediaWiki:PageNumbers.js&action=raw&ctype=text/javascript');
 +
 
jQuery(function($) {
 
jQuery(function($) {
 
var extraSymbols = [
 
var extraSymbols = [
Ред 42: Ред 78:
 
};
 
};
 
section.groups.insert.tools.horizline = {
 
section.groups.insert.tools.horizline = {
action: { type: "encapsulate", options: { pre: "----" } },
+
action: { type: "encapsulate", options: { pre: "----\n" } },
 
label: "Хоризонтална линия",
 
label: "Хоризонтална линия",
 
icon: '//upload.wikimedia.org/wikipedia/commons/b/b4/Toolbaricon_rule.png',
 
icon: '//upload.wikimedia.org/wikipedia/commons/b/b4/Toolbaricon_rule.png',

Версия от 08:54, 26 ноември 2012

// Dynamic layouts
if ( !self.ws_layouts ) {
 self.ws_layouts = {};
}
self.ws_layouts['Layout 1'] = {
   '#text-wrap':"", 
   '#text-container':"" , 
   '#text':"", 
   '.sidenote-right':"float:right;margin:0.5em;padding:3px;border:solid 1px gray;max-width:9em;text-indent:0em;text-align:left;",
   '.sidenote-left':"float:left;margin:0.5em;padding:3px;border:solid 1px gray;max-width:9em;text-indent:0em;text-align:left;",
   '.editsection':"display:none",
   '#headertemplate':"" 
};
self.ws_layouts['Layout 2'] = {
   '#text-wrap':"position:relative;margin-left:3em;margin-right:3em;", 
   '#text-container':"width:40em;margin:0px auto;" , 
   '#text':"text-align:justify;", 
   '.sidenote-right':"position:absolute; left:37em;width:16em;text-indent:0em;text-align:left;",
   '.sidenote-left':"position:absolute; right:37em;width:16em;text-indent:0em;text-align:right;",
   '.editsection':"display:none",
   '#headertemplate':"" 
};
self.ws_layouts['Layout 3'] = {
   '#text-wrap':"margin-left:3em",
   '#text-container':"position:relative; min-width:60em; float:left; width:100%; margin-right:-23em;" , 
   '#text':"text-align:justify;margin-right:23em; text-indent:0em; padding-left:0px; padding-right:0px;width:auto; position:relative;",
   '.sidenote-right':"position:absolute; right:-10em; width:9em; background-color:#eeeeee;text-indent:0em;text-align:left;",
   '.sidenote-left':"position:absolute; right:-10em; width:9em; background-color:#eeeeee;text-indent:0em;text-align:left;",
   '.editsection':"display:none",
   '#headertemplate':"position:absolute; top:0em; right:-23em; width:21em;float:right; text-align:left;" 
};

self.proofreadpage_add_container = true;

mw.loader.load('http://wiki.workroom.chitanka.local/index.php?title=MediaWiki:PageNumbers.js&action=raw&ctype=text/javascript');

jQuery(function($) {
	var extraSymbols = [
		{
			action: { type: "encapsulate", options: { pre: "⟨", post: "⟩" } },
			label: "⟨⟩"
		},
		"△", "▽", "◇", "`", "{{* * *}}", "{{?}}", "{{+}}"
	];
	var addExtraSymbols = function(pages, symbols) {
		$.each(symbols, function(i, symbol){
			pages.symbols.characters.push(symbol);
		});
	};
	var reorderPages = function(pages) {
		var newPages = {};
		newPages = {
			'symbols': pages.symbols,
			'greek': pages.greek,
			'cyrillic' : pages.cyrillic
		};
		$.each(pages, function(i, v){
			newPages[i] = pages[i];
		});
		return newPages;
	};
	$('#wpTextbox1').on('wikiEditor-toolbar-buildSection-characters', function (event, section) {
		addExtraSymbols(section.pages, extraSymbols);
		section.pages = reorderPages(section.pages);
	});
	$('#wpTextbox1').on('wikiEditor-toolbar-buildSection-main', function (event, section) {
		section.groups.format.tools.htmlbold = {
			action: { type: "encapsulate", options: { pre: "<b>", post: "</b>" } },
			label: "Получер текст чрез маркер <b>",
			icon: '//upload.wikimedia.org/wikipedia/commons/a/ae/Toolbaricon_bold_b.png',
			group: "format", section: "main", type: "button"
		};
		section.groups.format.tools.htmlitalic = {
			action: { type: "encapsulate", options: { pre: "<i>", post: "</i>" } },
			label: "Курсивен текст чрез маркер <i>",
			icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Toolbaricon_italic_i.png',
			type: "button"
		};
		section.groups.insert.tools.horizline = {
			action: { type: "encapsulate", options: { pre: "----\n" } },
			label: "Хоризонтална линия",
			icon: '//upload.wikimedia.org/wikipedia/commons/b/b4/Toolbaricon_rule.png',
			type: "button"
		};
	});
});