[Pkg-javascript-commits] [mathjax] 02/02: Replace local_accessibility_menu.diff with upstream patch.
Dmitry Shachnev
mitya57 at moszumanska.debian.org
Thu Jun 29 19:51:28 UTC 2017
This is an automated email from the git hooks/post-receive script.
mitya57 pushed a commit to branch master
in repository mathjax.
commit c2acbbfe49f6e1b3293574761f4843d587b3e6ec
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date: Thu Jun 29 22:50:55 2017 +0300
Replace local_accessibility_menu.diff with upstream patch.
---
debian/changelog | 2 +
.../patches/dont_use_default_as_property_name.diff | 131 ++++++++++++++
debian/patches/local_accessibility_menu.diff | 199 ---------------------
debian/patches/series | 2 +-
4 files changed, 134 insertions(+), 200 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 26cc401..9ab40a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ mathjax (2.7.1-1) UNRELEASED; urgency=medium
* New upstream release.
* Update packer and combiner code to the latest upstream version.
+ * Replace local_accessibility_menu.diff with upstream patch to fix
+ syntax in a11y extensions (dont_use_default_as_property_name.diff).
-- Dmitry Shachnev <mitya57 at debian.org> Thu, 29 Jun 2017 17:03:24 +0300
diff --git a/debian/patches/dont_use_default_as_property_name.diff b/debian/patches/dont_use_default_as_property_name.diff
new file mode 100644
index 0000000..100acdd
--- /dev/null
+++ b/debian/patches/dont_use_default_as_property_name.diff
@@ -0,0 +1,131 @@
+Description: do not use default as a property name, to make yui-compressor not fail
+Origin: upstream, https://github.com/mathjax/MathJax-a11y/commit/8bfb77d0c6a751e5
+Last-Update: 2017-06-29
+
+--- a/unpacked/extensions/a11y/accessibility-menu.js
++++ b/unpacked/extensions/a11y/accessibility-menu.js
+@@ -43,7 +43,7 @@
+ var Accessibility = EXTENSIONS["accessibility-menu"] = {
+ version: '1.2.2',
+ prefix: '', //'Accessibility-',
+- default: {},
++ defaults: {},
+ modules: [],
+ MakeOption: function(name) {
+ return Accessibility.prefix + name;
+@@ -52,11 +52,11 @@
+ return SETTINGS[Accessibility.MakeOption(option)];
+ },
+ AddDefaults: function() {
+- var keys = KEYS(Accessibility.default);
++ var keys = KEYS(Accessibility.defaults);
+ for (var i = 0, key; key = keys[i]; i++) {
+ var option = Accessibility.MakeOption(key);
+ if (typeof(SETTINGS[option]) === 'undefined') {
+- SETTINGS[option] = Accessibility.default[key];
++ SETTINGS[option] = Accessibility.defaults[key];
+ }
+ }
+ },
+@@ -87,7 +87,7 @@
+ }
+ },
+ Register: function(module) {
+- Accessibility.default[module.option] = false;
++ Accessibility.defaults[module.option] = false;
+ Accessibility.modules.push(module);
+ },
+ Startup: function() {
+--- a/unpacked/extensions/a11y/collapsible.js
++++ b/unpacked/extensions/a11y/collapsible.js
+@@ -94,7 +94,7 @@
+ punctuated: {
+ endpunct: NOCOLLAPSE,
+ startpunct: NOCOLLAPSE,
+- default: 12
++ value: 12
+ }
+ },
+ //
+@@ -108,7 +108,7 @@
+ text: "...",
+ appl: {
+ "limit function": "lim",
+- default: "f()"
++ value: "f()"
+ },
+ fraction: "/",
+ sqrt: "\u221A",
+@@ -119,14 +119,14 @@
+ vector: {
+ binomial: "(:)",
+ determinant: "|:|",
+- default: "\u27E8:\u27E9"
++ value: "\u27E8:\u27E9"
+ },
+ matrix: {
+ squarematrix: "[::]",
+ rowvector: "\u27E8\u22EF\u27E9",
+ columnvector: "\u27E8\u22EE\u27E9",
+ determinant: "|::|",
+- default: "(::)"
++ value: "(::)"
+ },
+ cases: "{:",
+ infixop: {
+@@ -134,11 +134,11 @@
+ subtraction: "\u2212",
+ multiplication: "\u22C5",
+ implicit: "\u22C5",
+- default: "+"
++ value: "+"
+ },
+ punctuated: {
+ text: "...",
+- default: ","
++ value: ","
+ }
+ },
+
+@@ -265,10 +265,10 @@
+ else if (this.COLLAPSE[type] && this.MARKER[type]) {
+ var role = mml.attr["data-semantic-role"];
+ var complexity = this.COLLAPSE[type];
+- if (typeof(complexity) !== "number") complexity = complexity[role] || complexity.default;
++ if (typeof(complexity) !== "number") complexity = complexity[role] || complexity.value;
+ if (mml.complexity > complexity) {
+ var marker = this.MARKER[type];
+- if (typeof(marker) !== "string") marker = marker[role] || marker.default;
++ if (typeof(marker) !== "string") marker = marker[role] || marker.value;
+ mml = this.MakeAction(this.Marker(marker),mml);
+ }
+ }
+@@ -348,7 +348,7 @@
+ Collapse_appl: function (mml) {
+ if (this.UncollapseChild(mml,2,2)) {
+ var marker = this.MARKER.appl;
+- marker = marker[mml.attr["data-semantic-role"]] || marker.default;
++ marker = marker[mml.attr["data-semantic-role"]] || marker.value;
+ mml = this.MakeAction(this.Marker(marker),mml);
+ }
+ return mml;
+--- a/unpacked/extensions/a11y/explorer.js
++++ b/unpacked/extensions/a11y/explorer.js
+@@ -37,7 +37,7 @@
+ //
+ // Default configurations.
+ //
+- default: {
++ defaults: {
+ walker: 'syntactic',
+ highlight: 'none',
+ background: 'blue',
+@@ -56,7 +56,7 @@
+ },
+
+ addDefaults: function() {
+- var defaults = MathJax.Hub.CombineConfig('explorer', Assistive.default);
++ var defaults = MathJax.Hub.CombineConfig('explorer', Assistive.defaults);
+ var keys = Object.keys(defaults);
+ for (var i = 0, key; key = keys[i]; i++) {
+ if (typeof(SETTINGS[Assistive.prefix + key]) === 'undefined') {
diff --git a/debian/patches/local_accessibility_menu.diff b/debian/patches/local_accessibility_menu.diff
deleted file mode 100644
index fd16a93..0000000
--- a/debian/patches/local_accessibility_menu.diff
+++ /dev/null
@@ -1,199 +0,0 @@
-Description: load accessibility-menu.js from local extensions directory
- This extension was loaded from external source, which is considered a privacy
- breach. Instead we can install it and load from a local path.
- .
- This file is copied from MathJax-a11y repository, the changes are:
- - replacing the file path in loadComplete call;
- - using *['default'] instead of *.default to make yui-compressor happy.
-Author: Dmitry Shachnev <mitya57 at debian.org>
-Forwarded: not-needed
-Last-Update: 2017-02-28
-
---- /dev/null
-+++ b/unpacked/extensions/accessibility-menu.js
-@@ -0,0 +1,185 @@
-+/*************************************************************
-+ *
-+ * [Contrib]/a11y/accessibility-menu.js
-+ *
-+ * A thin extension to add opt-in menu items for the accessibility
-+ * extensions in the a11y contributed directory.
-+ *
-+ * ---------------------------------------------------------------------
-+ *
-+ * Copyright (c) 2016 The MathJax Consortium
-+ *
-+ * Licensed under the Apache License, Version 2.0 (the "License");
-+ * you may not use this file except in compliance with the License.
-+ * You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+(function(HUB,EXTENSIONS) {
-+ var SETTINGS = HUB.config.menuSettings;
-+ var ITEM, MENU; // filled in when MathMenu extension loads
-+
-+ var BIND = (Function.prototype.bind ? function (f,t) {return f.bind(t)} :
-+ function (f,t) {return function () {f.apply(t,arguments)}});
-+ var KEYS = Object.keys || function (obj) {
-+ var keys = [];
-+ for (var id in obj) {if (obj.hasOwnProperty(id)) keys.push(id)}
-+ return keys;
-+ };
-+
-+ //
-+ // Set up the a11y path,if it isn't already in place
-+ //
-+ var PATH = MathJax.Ajax.config.path;
-+ if (!PATH.a11y) PATH.a11y =
-+ (PATH.Contrib ? PATH.Contrib + "/a11y" :
-+ (String(location.protocol).match(/^https?:/) ? "" : "http:") +
-+ "//cdn.mathjax.org/mathjax/contrib/a11y");
-+
-+ var Accessibility = EXTENSIONS["accessibility-menu"] = {
-+ version: '1.1',
-+ prefix: '', //'Accessibility-',
-+ 'default': {},
-+ modules: [],
-+ MakeOption: function(name) {
-+ return Accessibility.prefix + name;
-+ },
-+ GetOption: function(option) {
-+ return SETTINGS[Accessibility.MakeOption(option)];
-+ },
-+ AddDefaults: function() {
-+ var keys = KEYS(Accessibility['default']);
-+ for (var i = 0, key; key = keys[i]; i++) {
-+ var option = Accessibility.MakeOption(key);
-+ if (typeof(SETTINGS[option]) === 'undefined') {
-+ SETTINGS[option] = Accessibility['default'][key];
-+ }
-+ }
-+ },
-+ // Attaches the menu items;
-+ AddMenu: function() {
-+ var items = Array(this.modules.length);
-+ for (var i = 0, module; module = this.modules[i]; i++) items[i] = module.placeHolder;
-+ var menu = MENU.FindId('Accessibility');
-+ if (menu) {
-+ items.unshift(ITEM.RULE());
-+ menu.submenu.items.push.apply(menu.submenu.items,items);
-+ } else {
-+ var renderer = (MENU.FindId("Settings","Renderer")||{}).submenu;
-+ if (renderer) {
-+ // move AssitiveMML and InTabOrder from Renderer to Accessibility menu
-+ items.unshift(ITEM.RULE());
-+ items.unshift(renderer.items.pop());
-+ items.unshift(renderer.items.pop());
-+ }
-+ items.unshift("Accessibility");
-+ var menu = ITEM.SUBMENU.apply(ITEM.SUBMENU,items);
-+ var locale = MENU.IndexOfId('Locale');
-+ if (locale) {
-+ MENU.items.splice(locale,0,menu);
-+ } else {
-+ MENU.items.push(ITEM.RULE(), menu);
-+ }
-+ }
-+ },
-+ Register: function(module) {
-+ Accessibility['default'][module.option] = false;
-+ Accessibility.modules.push(module);
-+ },
-+ Startup: function() {
-+ ITEM = MathJax.Menu.ITEM;
-+ MENU = MathJax.Menu.menu;
-+ for (var i = 0, module; module = this.modules[i]; i++) module.CreateMenu();
-+ this.AddMenu();
-+ },
-+ LoadExtensions: function () {
-+ var extensions = [];
-+ for (var i = 0, module; module = this.modules[i]; i++) {
-+ if (SETTINGS[module.option]) extensions.push(module.module);
-+ }
-+ return (extensions.length ? HUB.Startup.loadArray(extensions) : null);
-+ }
-+ };
-+
-+ var ModuleLoader = MathJax.Extension.ModuleLoader = MathJax.Object.Subclass({
-+ option: '',
-+ name: ['',''],
-+ module: '',
-+ placeHolder: null,
-+ submenu: false,
-+ extension: null,
-+ Init: function(option, name, module, extension, submenu) {
-+ this.option = option;
-+ this.name = [name.replace(/ /g,''),name];
-+ this.module = module;
-+ this.extension = extension;
-+ this.submenu = (submenu || false);
-+ },
-+ CreateMenu: function() {
-+ var load = BIND(this.Load,this);
-+ if (this.submenu) {
-+ this.placeHolder =
-+ ITEM.SUBMENU(this.name,
-+ ITEM.CHECKBOX(["Activate","Activate"],
-+ Accessibility.MakeOption(this.option), {action: load}),
-+ ITEM.RULE(),
-+ ITEM.COMMAND(["OptionsWhenActive","(Options when Active)"],null,{disabled:true})
-+ );
-+ } else {
-+ this.placeHolder = ITEM.CHECKBOX(
-+ this.name, Accessibility.MakeOption(this.option), {action: load}
-+ );
-+ }
-+ },
-+ Load: function() {
-+ HUB.Queue(["Require",MathJax.Ajax,this.module,["Enable",this]]);
-+ },
-+ Enable: function(menu) {
-+ var extension = MathJax.Extension[this.extension];
-+ if (extension) {
-+ extension.Enable(true,true);
-+ MathJax.Menu.saveCookie();
-+ }
-+ }
-+ });
-+
-+ Accessibility.Register(
-+ ModuleLoader(
-+ 'collapsible', 'Collapsible Math', '[a11y]/collapsible.js', 'collapsible'
-+ )
-+ );
-+ Accessibility.Register(
-+ ModuleLoader(
-+ 'autocollapse', 'Auto Collapse', '[a11y]/auto-collapse.js', 'auto-collapse'
-+ )
-+ );
-+ Accessibility.Register(
-+ ModuleLoader(
-+ 'explorer', 'Explorer', '[a11y]/explorer.js', 'explorer', true
-+ )
-+ );
-+
-+ Accessibility.AddDefaults();
-+
-+ HUB.Register.StartupHook('End Extensions', function () {
-+ HUB.Register.StartupHook('MathMenu Ready', function () {
-+ Accessibility.Startup();
-+ HUB.Startup.signal.Post('Accessibility Menu Ready');
-+ },5); // run before other extensions' menu hooks even if they are loaded first
-+ },5);
-+
-+ MathJax.Callback.Queue(
-+ ["LoadExtensions",Accessibility],
-+ ["loadComplete",MathJax.Ajax,"[MathJax]/extensions/accessibility-menu.js"]
-+ );
-+
-+})(MathJax.Hub,MathJax.Extension);
-+
-+
diff --git a/debian/patches/series b/debian/patches/series
index 401b012..2b4ce2a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,3 @@
no_extra_fonts.diff
update_url.diff
-local_accessibility_menu.diff
+dont_use_default_as_property_name.diff
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/mathjax.git
More information about the Pkg-javascript-commits
mailing list