Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/60904
Change subject: Remove unused ext.cite.taghook module.
......................................................................
Remove unused ext.cite.taghook module.
Change-Id: Iccde164396d48eac2d2eaae3487b6bb9c1fc0022
---
D js/lib/ext.cite.taghook.ref.js
1 file changed, 0 insertions(+), 169 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid
refs/changes/04/60904/1
diff --git a/js/lib/ext.cite.taghook.ref.js b/js/lib/ext.cite.taghook.ref.js
deleted file mode 100644
index c359597..0000000
--- a/js/lib/ext.cite.taghook.ref.js
+++ /dev/null
@@ -1,169 +0,0 @@
-"use strict";
-
-var Util = require( './mediawiki.Util.js' ).Util,
- $ = require( './fakejquery' );
-/**
- * The ref / references tags don't do any fancy HTML, so we can actually
- * implement this in terms of parse tree manipulations, skipping the need
- * for renderer-specific plugins as well.
- *
- * Pretty neat huh!
- */
-
-MWRefTagHook = function( env ) {
- if (!('cite' in env)) {
- env.cite = {
- refGroups: {}
- };
- }
- var refGroups = env.cite.refGroups;
-
- var getRefGroup = function(group) {
- if (!(group in refGroups)) {
- var refs = [],
- byName = {};
- refGroups[group] = {
- refs: refs,
- byName: byName,
- add: function(node, options) {
- var ref;
- if (options.name && options.name in
byName) {
- ref = byName[options.name];
- } else {
- var n = refs.length;
- var key = n + '';
- if (options.name) {
- key = options.name +
'-' + key;
- }
- ref = {
- node: node,
- index: n,
- groupIndex: n, // @fixme
- name: options.name,
- group: options.group,
- key: key,
- target: 'cite_note-' +
key,
- linkbacks: []
- };
- refs[n] = ref;
- if (options.name) {
- byName[options.name] =
ref;
- }
- }
- ref.linkbacks.push(
- 'cite_ref-' + ref.key + '-' +
ref.linkbacks.length
- );
- return ref;
- }
- };
- }
- return refGroups[group];
- };
-
- this.execute = function( node ) {
- var options = $.extend({
- name: null,
- group: null
- }, node.params);
-
- var group = getRefGroup(options.group ),
- ref = group.add(node, options),
- linkback = ref.linkbacks[ref.linkbacks.length - 1],
- bits = [];
- if (options.group) {
- bits.push(options.group);
- }
- bits.push(Util.formatNum( ref.groupIndex + 1 ));
-
- return {
- type: 'span',
- attrs: {
- id: linkback,
- 'class': 'reference'
- },
- content: [
- {
- type: 'hashlink',
- target: '#' + ref.target,
- content: [
- '[' + bits.join(' ') + ']'
- ]
- }
- ],
- origNode: node
- };
- };
-};
-
-MWReferencesTagHook = function( env ) {
- if (!('cite' in env)) {
- env.cite = {
- refGroups: {}
- };
- }
- var refGroups = env.cite.refGroups,
- arrow = '↑';
-
- var renderLine = function( ref ) {
- var out = {
- type: 'li',
- attrs: {
- id: 'cite-note-' + ref.target
- },
- content: []
- };
- if (ref.linkbacks.length === 1) {
- out.content.push({
- type: 'hashlink',
- target: '#' + ref.linkbacks[0],
- content: [
- arrow
- ]
- });
- } else {
- out.content.push(arrow);
- $.each(ref.linkbacks, function(i, linkback) {
- out.content.push({
- type: 'hashlink',
- target: '#' + ref.linkbacks[0],
- content: [
- Util.formatNum( ref.groupIndex
+ '.' + i)
- ]
- });
- });
- }
- out.content.push(' ');
- out.content.push({
- type: 'placeholder',
- content: ref.node.content || []
- });
- return out;
- };
- this.execute = function( node ) {
- var options = $.extend({
- name: null,
- group: null
- }, node.params);
- if (options.group in refGroups) {
- var group = refGroups[options.group],
- listItems = $.map(group.refs, renderLine);
- return {
- type: 'ol',
- attrs: {
- 'class': 'references'
- },
- content: listItems,
- origNode: node
- };
- } else {
- return {
- type: 'placeholder',
- origNode: node
- };
- }
- };
-};
-
-if (typeof module === "object") {
- module.exports.MWRefTagHook = MWRefTagHook;
-}
--
To view, visit https://gerrit.wikimedia.org/r/60904
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iccde164396d48eac2d2eaae3487b6bb9c1fc0022
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits