Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
6a39ffaa
Commit
6a39ffaa
authored
Jan 20, 2019
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove conversion button from WYSIWYG
parent
be31ff21
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
112 deletions
+0
-112
qa-plugin.php
qa-plugin/wysiwyg-editor/qa-plugin.php
+0
-1
qa-wysiwyg-ajax.php
qa-plugin/wysiwyg-editor/qa-wysiwyg-ajax.php
+0
-67
qa-wysiwyg-editor.php
qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php
+0
-39
qa-wysiwyg-lang-default.php
qa-plugin/wysiwyg-editor/qa-wysiwyg-lang-default.php
+0
-5
No files found.
qa-plugin/wysiwyg-editor/qa-plugin.php
View file @
6a39ffaa
...
...
@@ -42,5 +42,4 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
qa_register_plugin_module
(
'editor'
,
'qa-wysiwyg-editor.php'
,
'qa_wysiwyg_editor'
,
'WYSIWYG Editor'
);
qa_register_plugin_module
(
'page'
,
'qa-wysiwyg-upload.php'
,
'qa_wysiwyg_upload'
,
'WYSIWYG Upload'
);
qa_register_plugin_module
(
'page'
,
'qa-wysiwyg-ajax.php'
,
'qa_wysiwyg_ajax'
,
'WYSIWYG Editor AJAX handler'
);
qa_register_plugin_phrases
(
'qa-wysiwyg-lang-*.php'
,
'wysiwyg'
);
qa-plugin/wysiwyg-editor/qa-wysiwyg-ajax.php
deleted
100644 → 0
View file @
be31ff21
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php
Description: Editor module class for WYSIWYG editor plugin
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
More about this license: http://www.question2answer.org/license.php
*/
class
qa_wysiwyg_ajax
{
public
function
match_request
(
$request
)
{
return
$request
==
'wysiwyg-editor-ajax'
;
}
// Fix path to WYSIWYG editor smileys
public
function
process_request
(
$request
)
{
require_once
QA_INCLUDE_DIR
.
'qa-app-posts.php'
;
// smiley replacement regexes
$rxSearch
=
'<(img|a)([^>]+)(src|href)="([^"]+)/wysiwyg-editor/plugins/smiley/images/([^"]+)"'
;
$rxReplace
=
'<$1$2$3="$4/wysiwyg-editor/ckeditor/plugins/smiley/images/$5"'
;
qa_suspend_event_reports
(
true
);
// avoid infinite loop
// prevent race conditions
$locks
=
array
(
'posts'
,
'categories'
,
'users'
,
'users AS lastusers'
,
'userpoints'
,
'words'
,
'titlewords'
,
'contentwords'
,
'tagwords'
,
'words AS x'
,
'posttags'
,
'options'
);
foreach
(
$locks
as
&
$tbl
)
$tbl
=
'^'
.
$tbl
.
' WRITE'
;
qa_db_query_sub
(
'LOCK TABLES '
.
implode
(
','
,
$locks
));
$sql
=
'SELECT postid, title, content FROM ^posts WHERE format="html" '
.
'AND content LIKE "%/wysiwyg-editor/plugins/smiley/images/%" '
.
'AND content RLIKE \''
.
$rxSearch
.
'\' '
.
'LIMIT 5'
;
$result
=
qa_db_query_sub
(
$sql
);
$numPosts
=
0
;
while
((
$post
=
qa_db_read_one_assoc
(
$result
,
true
))
!==
null
)
{
$newcontent
=
preg_replace
(
"#
$rxSearch
#"
,
$rxReplace
,
$post
[
'content'
]);
qa_post_set_content
(
$post
[
'postid'
],
$post
[
'title'
],
$newcontent
);
$numPosts
++
;
}
qa_db_query_raw
(
'UNLOCK TABLES'
);
qa_suspend_event_reports
(
false
);
echo
$numPosts
;
}
}
qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php
View file @
6a39ffaa
...
...
@@ -57,40 +57,6 @@ class qa_wysiwyg_editor
'wysiwyg_editor_upload_max_size_display'
=>
'wysiwyg_editor_upload_images_field'
,
));
// handle AJAX requests to 'wysiwyg-editor-ajax'
$js
=
array
(
'function wysiwyg_editor_ajax(totalEdited) {'
,
' $.ajax({'
,
' url: '
.
qa_js
(
qa_path
(
'wysiwyg-editor-ajax'
))
.
','
,
' success: function(response) {'
,
' var postsEdited = parseInt(response, 10);'
,
' var $btn = $("#wysiwyg_editor_ajax");'
,
' if (isNaN(postsEdited)) {'
,
' $btn.text('
.
qa_js
(
qa_lang_html
(
'wysiwyg/error'
))
.
');'
,
' }'
,
' else if (postsEdited < 5) {'
,
' $btn.text('
.
qa_js
(
qa_lang_html
(
'wysiwyg/all_posts_converted'
))
.
');'
,
' }'
,
' else {'
,
' totalEdited += postsEdited;'
,
' $btn.text('
.
qa_js
(
qa_lang_html
(
'wysiwyg/updating_posts'
)
.
' '
)
.
' + totalEdited)'
,
' window.setTimeout(function() {'
,
' wysiwyg_editor_ajax(totalEdited);'
,
' }, 1000);'
,
' }'
,
' }'
,
' });'
,
'}'
,
'$("#wysiwyg_editor_ajax").click(function() {'
,
' wysiwyg_editor_ajax(0);'
,
' return false;'
,
'});'
,
);
$ajaxHtml
=
qa_lang_html
(
'wysiwyg/update_broken_images'
)
.
' '
.
'<button id="wysiwyg_editor_ajax">'
.
qa_lang_html
(
'wysiwyg/click_here'
)
.
'</button> '
.
'<script>'
.
implode
(
"
\n
"
,
$js
)
.
'</script>'
;
return
array
(
'ok'
=>
$saved
?
qa_lang_html
(
'admin/options_saved'
)
:
null
,
...
...
@@ -118,11 +84,6 @@ class qa_wysiwyg_editor
'value'
=>
qa_html
(
number_format
(
$this
->
bytes_to_mega
(
qa_opt
(
'wysiwyg_editor_upload_max_size'
)),
1
)),
'tags'
=>
'name="wysiwyg_editor_upload_max_size_field"'
,
),
array
(
'type'
=>
'custom'
,
'html'
=>
$ajaxHtml
,
),
),
'buttons'
=>
array
(
...
...
qa-plugin/wysiwyg-editor/qa-wysiwyg-lang-default.php
View file @
6a39ffaa
...
...
@@ -20,14 +20,9 @@
*/
return
array
(
'all_posts_converted'
=>
'All posts converted.'
,
'allow_images'
=>
'Allow images to be uploaded'
,
'allow_other_content'
=>
'Allow other content to be uploaded, e.g. Flash, PDF'
,
'characters'
=>
'characters'
,
'click_here'
=>
'click here'
,
'error'
=>
'ERROR'
,
'maximum_size'
=>
'Maximum size of uploads:'
,
'mb_max_x'
=>
'MB (max ^)'
,
'update_broken_images'
=>
'Update broken images from old CKeditor Smiley plugin:'
,
'updating_posts'
=>
'Updating posts...'
,
);
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