From d4db56760a152b2737951bedf020c5b234bc8a11 Mon Sep 17 00:00:00 2001
From: Peter Krautzberger
Date: Fri, 21 Apr 2017 11:09:14 +0200
Subject: [PATCH] change path variable
---
dist/README.md | 4 ++--
dist/arabic.js | 2 +-
dist/unpacked/arabic.js | 2 +-
gulpfile.js | 2 +-
src/z-load-complete.js | 2 +-
testcases/index.html | 8 ++++----
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dist/README.md b/dist/README.md
index 3680cdc..94708f4 100644
--- a/dist/README.md
+++ b/dist/README.md
@@ -17,11 +17,11 @@ and [configure](http://mathjax.readthedocs.org/en/latest/configuration.html) the
Then you'll need to include the `arabic.js` as an extension, here's an example configuration:
- MathJax.Ajax.config.path["Contrib"] = "//cdn.mathjax.org/mathjax/contrib";
+ MathJax.Ajax.config.path["arabic"] = "//path/to/arabic/";
MathJax.Hub.Config({
extensions: [
- "[Contrib]/arabic/arabic.js"
+ "[arabic]/arabic.js"
]
});
diff --git a/dist/arabic.js b/dist/arabic.js
index 52aad49..ecbaea6 100644
--- a/dist/arabic.js
+++ b/dist/arabic.js
@@ -24,4 +24,4 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-MathJax.Hub.Register.StartupHook("HTML-CSS Jax Require",function(){MathJax.Hub.Config({"HTML-CSS":{styles:{".MathJax .mfliph":{display:"inline-block !important","-moz-transform":"scaleX(-1)","-webkit-transform":"scaleX(-1)","-o-transform":"scaleX(-1)",transform:"scaleX(-1)","-ms-filter":"fliph",filter:"fliph"},".MathJax .mar":{"font-style":"normal !important"},".MathJax .mar > span":{"font-style":"normal !important"}}}})}),MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){MathJax.Hub.Register.StartupHook("Arabic TeX Ready",function(){var a=MathJax.ElementJax.mml,t=function(t){var r=a[t].prototype.toHTML;a[t].Augment({toHTML:function(){var a=r.apply(this,arguments);if(this.arabicFlipH){var t=document.createElement("span");for(t.className="mfliph","ar"===this.arabicFontLang&&(t.className+=" mar");a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t)}return a}})};["mfrac","mi","mn","mo","mrow","ms","msqrt","msubsup","mroot","mtext"].forEach(t),MathJax.Hub.Register.StartupHook("HTML-CSS mtable Ready",function(){t("mtable"),MathJax.Hub.Startup.signal.Post("Arabic mtable Ready")}),MathJax.Hub.Startup.signal.Post("Arabic Ready")})}),MathJax.Extension.Arabic={version:"1.0.0",config:MathJax.Hub.CombineConfig("Arabic",{dict:{Zero:["zero","Text",["0","\u0635\u0641\u0631"]],Radius:["radius","Text",["r","\u0646\u0642"]],Area:["Area","Text",["A","\u0645"]]},identifiersMap:{a:"\u0623",b:"\u0628",c:"\u062c\u0640",x:"\u0633",y:"\u0635",z:"\u0639",n:"\u0646",f:"\u0642",g:"\u062c\u0640",h:"\u0647\u0640",k:"\u0643",r:"\u0631",t:"\u062a",d:"\u062f",e:"\u0647\u0640",m:"\u0645",l:"\u0644",sin:"\u062c\u0627",cos:"\u062c\u062a\u0627",tan:"\u0638\u0627",cot:"\u0638\u062a\u0627",sec:"\u0642\u0627",csc:"\u0642\u062a\u0627",log:"\u0644\u0648"},numbersMap:{0:"\u0660",1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669"},operatorsMap:{",":"\u060c",";":"\u061b",lim:"\u0646\u0647\u0640\u0640\u0627"},isArabicPage:"ar"===document.documentElement.lang}),arabicLanguageRegExp:/([\u0600-\u06FF]+)/g,TeX:function(a,t){return function(r){var n,e=MathJax.InputJax.TeX;n="ar"===this.stack.env.lang?t:a,this.Push(e.Parse(n).mml())}},Text:function(a,t){return MathJax.Extension.Arabic.TeX(a,"\\fliph{\\text{"+t+"}}")},Symbols:function(a,t){var r=t.replace(MathJax.Extension.Arabic.arabicLanguageRegExp,"\\fliph{\\text{$1}}");return MathJax.Extension.Arabic.TeX(a,r)}},MathJax.Hub.Startup.signal.Post("Arabic TeX Startup"),MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var a=MathJax.InputJax.TeX,t=MathJax.Extension.Arabic,r=a.Parse.prototype.mmlToken,n=MathJax.Hub.config.Arabic.dict,e=function(){var a=/[\\^$.*+?()[\]{}|]/g;return function(t){return t.replace(a,"\\$&")}}(),i=function(a){var t=Object.keys(a).sort(function(a,t){return t.length-a.length});return new RegExp(t.map(e).join("|"),"gi")};a.Definitions.Add({macros:{ar:"HandleArabic",alwaysar:"MarkAsArabic",fliph:"HandleFlipHorizontal",transx:"TranslateTeX",transt:"TranslateText",transs:"TranslateSymbols"}});var o=a.Stack.Item.array,s=o.prototype.clearEnv;o.Augment({clearEnv:function(){var a=this.env.lang;s.apply(this,arguments),a&&(this.env.lang=a)}}),a.Definitions.Add({macros:function(){var a={};return Object.keys(n).forEach(function(t){var r=n[t][0];a[r]=t}),a}()}),a.Parse.Augment(function(){var a={};return Object.keys(n).forEach(function(r){var e=n[r][1],i=n[r][2];a[r]=t[e].apply(null,i)}),a}()),a.Parse.Augment({flipHorizontal:function(a){return a.arabicFlipH=!a.arabicFlipH,a},arabicNumber:function(){var a=/[0-9]/g,t=MathJax.Hub.config.Arabic.numbersMap,r=function(a){return t[a]};return function(t){var n=t.data[0].data[0],e=n.replace(a,r);return e!==n&&(t.data[0].data[0]=e,t.arabicFontLang="ar"),this.flipHorizontal(t)}}(),arabicIdentifier:function(){var a=MathJax.Hub.config.Arabic.identifiersMap,t=i(a),r=function(t){return a[t.toLowerCase()]};return function(a){var n=a.data[0].data[0];if("chars"===a.data[0].type){var e=n.replace(t,r);e!==n&&(a.data[0].data[0]=e,a.arabicFontLang="ar")}return this.flipHorizontal(a)}}(),arabicOperator:function(){var a=MathJax.Hub.config.Arabic.operatorsMap,t=i(a),r=function(t){return a[t]};return function(a){var n=a.data[0].data[0],e=n.replace(t,r);return e!==n&&(a=this.flipHorizontal(a),a.arabicFontLang="ar",a.data[0].data[0]=e),a}}(),_getArgumentMML:function(a){var t=this.ParseArg(a);return t.inferred&&1===t.data.length?t=t.data[0]:delete t.inferred,t},mmlToken:function(a){var t=r.call(this,a);return"ar"===this.stack.env.lang&&this.markArabicToken(t),t},markArabicToken:function(a){return"mn"===a.type?this.arabicNumber(a):"mi"===a.type?this.arabicIdentifier(a):"mo"===a.type?this.arabicOperator(a):a},HandleArabic:function(a){MathJax.Hub.config.Arabic.isArabicPage&&this.MarkAsArabic(a)},TranslateTeX:function(a){var r=this.GetArgument(a),n=this.GetArgument(a),e=t.TeX(r,n);return e.call(this,a)},TranslateText:function(a){var r=this.GetArgument(a),n=this.GetArgument(a),e=t.Text(r,n);return e.call(this,a)},TranslateSymbols:function(a){var r=this.GetArgument(a),n=this.GetArgument(a),e=t.Symbols(r,n);return e.call(this,a)},MarkAsArabic:function(a){var t=this.stack.env.lang;this.stack.env.lang="ar";var r=this._getArgumentMML(a);this.stack.env.lang=t,this.Push(this.flipHorizontal(r))},HandleFlipHorizontal:function(a){var t=this._getArgumentMML(a);this.Push(this.flipHorizontal(t))}}),MathJax.Hub.Startup.signal.Post("Arabic TeX Ready")}),MathJax.Ajax.loadComplete("[Contrib]/arabic/arabic.js");
\ No newline at end of file
+MathJax.Hub.Register.StartupHook("HTML-CSS Jax Require",function(){MathJax.Hub.Config({"HTML-CSS":{styles:{".MathJax .mfliph":{display:"inline-block !important","-moz-transform":"scaleX(-1)","-webkit-transform":"scaleX(-1)","-o-transform":"scaleX(-1)",transform:"scaleX(-1)","-ms-filter":"fliph",filter:"fliph"},".MathJax .mar":{"font-style":"normal !important"},".MathJax .mar > span":{"font-style":"normal !important"}}}})}),MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){MathJax.Hub.Register.StartupHook("Arabic TeX Ready",function(){var a=MathJax.ElementJax.mml,t=function(t){var r=a[t].prototype.toHTML;a[t].Augment({toHTML:function(){var a=r.apply(this,arguments);if(this.arabicFlipH){var t=document.createElement("span");for(t.className="mfliph","ar"===this.arabicFontLang&&(t.className+=" mar");a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t)}return a}})};["mfrac","mi","mn","mo","mrow","ms","msqrt","msubsup","mroot","mtext"].forEach(t),MathJax.Hub.Register.StartupHook("HTML-CSS mtable Ready",function(){t("mtable"),MathJax.Hub.Startup.signal.Post("Arabic mtable Ready")}),MathJax.Hub.Startup.signal.Post("Arabic Ready")})}),MathJax.Extension.Arabic={version:"1.0.0",config:MathJax.Hub.CombineConfig("Arabic",{dict:{Zero:["zero","Text",["0","\u0635\u0641\u0631"]],Radius:["radius","Text",["r","\u0646\u0642"]],Area:["Area","Text",["A","\u0645"]]},identifiersMap:{a:"\u0623",b:"\u0628",c:"\u062c\u0640",x:"\u0633",y:"\u0635",z:"\u0639",n:"\u0646",f:"\u0642",g:"\u062c\u0640",h:"\u0647\u0640",k:"\u0643",r:"\u0631",t:"\u062a",d:"\u062f",e:"\u0647\u0640",m:"\u0645",l:"\u0644",sin:"\u062c\u0627",cos:"\u062c\u062a\u0627",tan:"\u0638\u0627",cot:"\u0638\u062a\u0627",sec:"\u0642\u0627",csc:"\u0642\u062a\u0627",log:"\u0644\u0648"},numbersMap:{0:"\u0660",1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669"},operatorsMap:{",":"\u060c",";":"\u061b",lim:"\u0646\u0647\u0640\u0640\u0627"},isArabicPage:"ar"===document.documentElement.lang}),arabicLanguageRegExp:/([\u0600-\u06FF]+)/g,TeX:function(a,t){return function(r){var n,e=MathJax.InputJax.TeX;n="ar"===this.stack.env.lang?t:a,this.Push(e.Parse(n).mml())}},Text:function(a,t){return MathJax.Extension.Arabic.TeX(a,"\\fliph{\\text{"+t+"}}")},Symbols:function(a,t){var r=t.replace(MathJax.Extension.Arabic.arabicLanguageRegExp,"\\fliph{\\text{$1}}");return MathJax.Extension.Arabic.TeX(a,r)}},MathJax.Hub.Startup.signal.Post("Arabic TeX Startup"),MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var a=MathJax.InputJax.TeX,t=MathJax.Extension.Arabic,r=a.Parse.prototype.mmlToken,n=MathJax.Hub.config.Arabic.dict,e=function(){var a=/[\\^$.*+?()[\]{}|]/g;return function(t){return t.replace(a,"\\$&")}}(),i=function(a){var t=Object.keys(a).sort(function(a,t){return t.length-a.length});return new RegExp(t.map(e).join("|"),"gi")};a.Definitions.Add({macros:{ar:"HandleArabic",alwaysar:"MarkAsArabic",fliph:"HandleFlipHorizontal",transx:"TranslateTeX",transt:"TranslateText",transs:"TranslateSymbols"}});var o=a.Stack.Item.array,s=o.prototype.clearEnv;o.Augment({clearEnv:function(){var a=this.env.lang;s.apply(this,arguments),a&&(this.env.lang=a)}}),a.Definitions.Add({macros:function(){var a={};return Object.keys(n).forEach(function(t){var r=n[t][0];a[r]=t}),a}()}),a.Parse.Augment(function(){var a={};return Object.keys(n).forEach(function(r){var e=n[r][1],i=n[r][2];a[r]=t[e].apply(null,i)}),a}()),a.Parse.Augment({flipHorizontal:function(a){return a.arabicFlipH=!a.arabicFlipH,a},arabicNumber:function(){var a=/[0-9]/g,t=MathJax.Hub.config.Arabic.numbersMap,r=function(a){return t[a]};return function(t){var n=t.data[0].data[0],e=n.replace(a,r);return e!==n&&(t.data[0].data[0]=e,t.arabicFontLang="ar"),this.flipHorizontal(t)}}(),arabicIdentifier:function(){var a=MathJax.Hub.config.Arabic.identifiersMap,t=i(a),r=function(t){return a[t.toLowerCase()]};return function(a){var n=a.data[0].data[0];if("chars"===a.data[0].type){var e=n.replace(t,r);e!==n&&(a.data[0].data[0]=e,a.arabicFontLang="ar")}return this.flipHorizontal(a)}}(),arabicOperator:function(){var a=MathJax.Hub.config.Arabic.operatorsMap,t=i(a),r=function(t){return a[t]};return function(a){var n=a.data[0].data[0],e=n.replace(t,r);return e!==n&&(a=this.flipHorizontal(a),a.arabicFontLang="ar",a.data[0].data[0]=e),a}}(),_getArgumentMML:function(a){var t=this.ParseArg(a);return t.inferred&&1===t.data.length?t=t.data[0]:delete t.inferred,t},mmlToken:function(a){var t=r.call(this,a);return"ar"===this.stack.env.lang&&this.markArabicToken(t),t},markArabicToken:function(a){return"mn"===a.type?this.arabicNumber(a):"mi"===a.type?this.arabicIdentifier(a):"mo"===a.type?this.arabicOperator(a):a},HandleArabic:function(a){MathJax.Hub.config.Arabic.isArabicPage&&this.MarkAsArabic(a)},TranslateTeX:function(a){var r=this.GetArgument(a),n=this.GetArgument(a),e=t.TeX(r,n);return e.call(this,a)},TranslateText:function(a){var r=this.GetArgument(a),n=this.GetArgument(a),e=t.Text(r,n);return e.call(this,a)},TranslateSymbols:function(a){var r=this.GetArgument(a),n=this.GetArgument(a),e=t.Symbols(r,n);return e.call(this,a)},MarkAsArabic:function(a){var t=this.stack.env.lang;this.stack.env.lang="ar";var r=this._getArgumentMML(a);this.stack.env.lang=t,this.Push(this.flipHorizontal(r))},HandleFlipHorizontal:function(a){var t=this._getArgumentMML(a);this.Push(this.flipHorizontal(t))}}),MathJax.Hub.Startup.signal.Post("Arabic TeX Ready")}),MathJax.Ajax.loadComplete("[arabic]/arabic.js");
\ No newline at end of file
diff --git a/dist/unpacked/arabic.js b/dist/unpacked/arabic.js
index 22cc11a..c85e4da 100644
--- a/dist/unpacked/arabic.js
+++ b/dist/unpacked/arabic.js
@@ -439,4 +439,4 @@ MathJax.Hub.Register.StartupHook('TeX Jax Ready', function () {
});
// This file starting with the letter `z` to make sure it gets concatenated last!
-MathJax.Ajax.loadComplete("[Contrib]/arabic/unpacked/arabic.js");
+MathJax.Ajax.loadComplete("[arabic]/unpacked/arabic.js");
diff --git a/gulpfile.js b/gulpfile.js
index 905c561..0d536fb 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -61,7 +61,7 @@ gulp.task('scripts-pack', function () {
preserveComments: 'some'
}))
.pipe(replace(arabicCharsRegExp, unicodeEscapeArabicChars))
- .pipe(replace('[Contrib]/arabic/unpacked/arabic.js', '[Contrib]/arabic/arabic.js'))
+ .pipe(replace('[arabic]/unpacked/arabic.js', '[arabic]/arabic.js'))
.pipe(gulp.dest('/code/dist/'));
});
diff --git a/src/z-load-complete.js b/src/z-load-complete.js
index 5bace5f..bc65370 100644
--- a/src/z-load-complete.js
+++ b/src/z-load-complete.js
@@ -1,2 +1,2 @@
// This file starting with the letter `z` to make sure it gets concatenated last!
-MathJax.Ajax.loadComplete("[Contrib]/arabic/unpacked/arabic.js");
+MathJax.Ajax.loadComplete("[arabic]/unpacked/arabic.js");
diff --git a/testcases/index.html b/testcases/index.html
index b47a0c8..a9d8ef1 100644
--- a/testcases/index.html
+++ b/testcases/index.html
@@ -69,12 +69,12 @@
var arabicExtensionPath;
if (isLocalDevelopment) {
- MathJax.Ajax.config.path["Contrib"] = "/extensions";
- arabicExtensionPath = "[Contrib]/arabic/unpacked/arabic.js";
+ MathJax.Ajax.config.path["arabic"] = "/extensions/arabic";
+ arabicExtensionPath = "[arabic]/unpacked/arabic.js";
MathJax.Ajax.config.path["Test"] = "/testcases/test-extensions";
} else {
- MathJax.Ajax.config.path["Contrib"] = "//edraak.github.io/arabic-extension-static";
- arabicExtensionPath = "[Contrib]/arabic/arabic.js";
+ MathJax.Ajax.config.path["arabic"] = "//edraak.github.io/arabic-extension-static/arabic";
+ arabicExtensionPath = "[arabic]/arabic.js";
MathJax.Ajax.config.path["Test"] = "//edraak.github.io/arabic-mathjax-dev/testcases/test-extensions";
}