Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
noblogs-wp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
39
Issues
39
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ai
noblogs-wp
Commits
1ece4eae
Commit
1ece4eae
authored
Jan 14, 2017
by
lucha
Committed by
agata
Oct 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removing unneeded options for mathjax-latex
parent
9e4b566b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
53 deletions
+7
-53
wp-content/plugins/mathjax-latex/class-mathjax-latex-admin.php
...ntent/plugins/mathjax-latex/class-mathjax-latex-admin.php
+3
-1
wp-content/plugins/mathjax-latex/class-mathjax-latex.php
wp-content/plugins/mathjax-latex/class-mathjax-latex.php
+3
-1
wp-content/plugins/mathjax-latex/mathjax-latex-admin.php
wp-content/plugins/mathjax-latex/mathjax-latex-admin.php
+1
-51
No files found.
wp-content/plugins/mathjax-latex/class-mathjax-latex-admin.php
View file @
1ece4eae
...
...
@@ -105,6 +105,8 @@ EOT;
'kblog_mathjax_use_wplatex_syntax'
);
// AI patch: do not use cloudfare CDN
/*
$use_cdn = get_option( 'kblog_mathjax_use_cdn', true ) ? 'checked="true"' : '';
$this->admin_table_row(
...
...
@@ -123,7 +125,7 @@ EOT;
"<input type='textbox' name='kblog_mathjax_custom_location' id='kblog_mathjax_custom_location' $custom_location $custom_location_disabled>",
'kblog_mathjax_custom_location'
);
*/
$options
=
$this
->
config_options
();
$select_string
=
"<select name='kblog_mathjax_config' id='kblog_mathjax_config'>
\n
"
;
...
...
wp-content/plugins/mathjax-latex/class-mathjax-latex.php
View file @
1ece4eae
...
...
@@ -150,13 +150,15 @@ class MathJax_Latex {
return
;
}
// AI patch: remove the use of the cloudfare CDN!
// initialise option for existing MathJax-LaTeX users
/*
if ( get_option( 'kblog_mathjax_use_cdn' ) || ! get_option( 'kblog_mathjax_custom_location' ) ) {
$mathjax_location = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js';
} else {
$mathjax_location = get_option( 'kblog_mathjax_custom_location' );
}
*/
$mathjax_url
=
$mathjax_location
.
'?config='
.
get_option
(
'kblog_mathjax_config'
);
wp_enqueue_script
(
'mathjax'
,
$mathjax_url
,
false
,
MATHJAX_VERSION
,
false
);
...
...
wp-content/plugins/mathjax-latex/mathjax-latex-admin.php
View file @
1ece4eae
...
...
@@ -105,25 +105,6 @@ EOT;
'kblog_mathjax_use_wplatex_syntax'
);
$use_cdn
=
get_option
(
'kblog_mathjax_use_cdn'
,
true
)
?
'checked="true"'
:
''
;
$this
->
admin_table_row
(
'Use MathJax CDN Service?'
,
'Allows use of the MathJax hosted content delivery network. By using this, you are agreeing to the <a href="http://www.mathjax.org/download/mathjax-cdn-terms-of-service/">MathJax CDN Terms of Service</a>.'
,
"<input type='checkbox' name='kblog_mathjax_use_cdn' id='use_cdn' value='1'
$use_cdn
/>"
,
'use_cdn'
);
$custom_location_disabled
=
get_option
(
'kblog_mathjax_use_cdn'
,
true
)
?
'disabled="disabled"'
:
''
;
$custom_location
=
"value='"
.
esc_attr
(
get_option
(
'kblog_mathjax_custom_location'
,
''
)
)
.
"'"
;
$this
->
admin_table_row
(
'Custom MathJax location?'
,
'If you are not using the MathJax CDN enter the location of your MathJax script.'
,
"<input type='textbox' name='kblog_mathjax_custom_location' id='kblog_mathjax_custom_location'
$custom_location
$custom_location_disabled
>"
,
'kblog_mathjax_custom_location'
);
$options
=
$this
->
config_options
();
$select_string
=
"<select name='kblog_mathjax_config' id='kblog_mathjax_config'>
\n
"
;
...
...
@@ -148,9 +129,6 @@ EOT;
public
function
config_options
()
{
$options
=
array
(
'default'
,
'Accessible'
,
'TeX-AMS_HTML'
,
'TeX-AMS-MML_HTMLorMML'
,
);
return
$options
;
...
...
@@ -169,25 +147,12 @@ EOT;
update_option
(
'kblog_mathjax_latex_inline'
,
sanitize_text_field
(
wp_unslash
(
$_POST
[
'kblog_mathjax_latex_inline'
]
)
)
);
// input var okay
}
update_option
(
'kblog_mathjax_use_wplatex_syntax'
,
array_key_exists
(
'kblog_mathjax_use_wplatex_syntax'
,
$_POST
)
);
// input var okay
update_option
(
'kblog_mathjax_use_cdn'
,
array_key_exists
(
'kblog_mathjax_use_cdn'
,
$_POST
)
);
// input var okay
if
(
array_key_exists
(
'kblog_mathjax_custom_location'
,
$_POST
)
&&
isset
(
$_POST
[
'kblog_mathjax_custom_location'
]
)
)
{
// input var okay
update_option
(
'kblog_mathjax_custom_location'
,
esc_url_raw
(
wp_unslash
(
$_POST
[
'kblog_mathjax_custom_location'
]
)
)
);
// input var okay
}
if
(
array_key_exists
(
'kblog_mathjax_config'
,
$_POST
)
&&
isset
(
$_POST
[
'kblog_mathjax_config'
]
)
&&
// input var okay
in_array
(
sanitize_text_field
(
wp_unslash
(
$_POST
[
'kblog_mathjax_config'
]
)
),
$this
->
config_options
(),
true
)
// input var okay
)
{
update_option
(
'kblog_mathjax_config'
,
sanitize_text_field
(
wp_unslash
(
$_POST
[
'kblog_mathjax_config'
]
)
)
);
// input var okay
}
}
public
function
table_head
()
{
?>
<div
class=
'wrap'
id=
'mathjax-latex-options'
>
<h2>
Mathjax-Latex
by Kblog
</h2>
<h2>
Mathjax-Latex
</h2>
<form
id=
'mathjaxlatex'
name=
'mathjaxlatex'
action=
''
method=
'POST'
>
<?php
wp_nonce_field
(
'kblog_mathjax_latex_save_action'
,
'kblog_mathjax_latex_save_field'
,
true
);
?>
<table
class=
'form-table'
>
...
...
@@ -203,21 +168,6 @@ EOT;
</form>
</div>
<script
type=
"text/javascript"
>
jQuery
(
function
(
$
)
{
if
(
typeof
(
$
.
fn
.
prop
)
!==
'
function
'
)
{
return
;
// ignore this for sites with jquery
<
1.6
}
// enable or disable the cdn input field when checking/unchuecking the "use cdn" checkbox
var
cdn_check
=
$
(
'
#use_cdn
'
),
cdn_location
=
$
(
'
#kblog_mathjax_custom_location
'
);
cdn_check
.
change
(
function
()
{
var
checked
=
cdn_check
.
is
(
'
:checked
'
);
cdn_location
.
prop
(
'
disabled
'
,
checked
);
});
});
</script>
<?php
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment