[geeklog-hg] geeklog: Added a property to advanced_editor.js for mobile
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Mon Aug 12 22:00:53 EDT 2013
changeset 9249:cb73971db89e
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/cb73971db89e
user: dengen <taharaxp at gmail.com>
date: Tue Aug 13 10:59:30 2013 +0900
description:
Added a property to advanced_editor.js for mobile
diffstat:
public_html/javascript/advanced_editor.js | 11 +++++++++--
public_html/javascript/staticpages_adveditor.js | 7 +------
public_html/javascript/storyeditor_adveditor.js | 8 +-------
3 files changed, 11 insertions(+), 15 deletions(-)
diffs (89 lines):
diff -r 558a578f5126 -r cb73971db89e public_html/javascript/advanced_editor.js
--- a/public_html/javascript/advanced_editor.js Tue Aug 13 02:40:47 2013 +0900
+++ b/public_html/javascript/advanced_editor.js Tue Aug 13 10:59:30 2013 +0900
@@ -39,13 +39,13 @@
AdvancedEditor.ValModeAdvanced = 'adveditor';
+AdvancedEditor.ValAutoToolbar = true;
+
AdvancedEditor.api = [];
AdvancedEditor.editor = 'ckeditor';
AdvancedEditor.newEditor = function(options) {
- var elem;
- var bar = 1;
if (geeklogEditorName) {
this.editor = geeklogEditorName;
}
@@ -58,9 +58,15 @@
if (options.ValModeAdvanced) {
this.ValModeAdvanced = options.ValModeAdvanced;
}
+
+ var bar = 1;
if (options.toolbar !== false) {
bar = options.toolbar;
}
+ if (this.ValAutoToolbar === true &&
+ navigator.userAgent.match(/iPhone|Android|IEMobile/i)) {
+ bar = 0;
+ }
for (var i = 0; i < this.TextareaId.length; i++) {
this.api[this.editor].newEditor(this.TextareaId[i].advanced, {toolbar:bar});
@@ -68,6 +74,7 @@
this.addEventListener();
+ var elem;
elem = document.getElementById(this.ContainerId);
if (elem) elem.style.display = '';
diff -r 558a578f5126 -r cb73971db89e public_html/javascript/staticpages_adveditor.js
--- a/public_html/javascript/staticpages_adveditor.js Tue Aug 13 02:40:47 2013 +0900
+++ b/public_html/javascript/staticpages_adveditor.js Tue Aug 13 10:59:30 2013 +0900
@@ -27,17 +27,12 @@
// | |
// +---------------------------------------------------------------------------+
-var bar = 1;
-if (navigator.userAgent.match(/iPhone|Android|IEMobile/i)) {
- bar = 0;
-}
-
window.onload = function() {
AdvancedEditor.newEditor({
TextareaId:[
{plain:'html_content', advanced:'adv_content'}
],
- toolbar:bar
+ toolbar:1
});
}
diff -r 558a578f5126 -r cb73971db89e public_html/javascript/storyeditor_adveditor.js
--- a/public_html/javascript/storyeditor_adveditor.js Tue Aug 13 02:40:47 2013 +0900
+++ b/public_html/javascript/storyeditor_adveditor.js Tue Aug 13 10:59:30 2013 +0900
@@ -27,19 +27,13 @@
// | |
// +---------------------------------------------------------------------------+
-var bar = 1;
-if (navigator.userAgent.match(/iPhone|Android|IEMobile/i)) {
- bar = 0;
-}
-
window.onload = function() {
AdvancedEditor.newEditor({
TextareaId:[
{plain:'introtext', advanced:'introhtml'},
{plain:'bodytext', advanced:'bodyhtml' }
],
- ValModeAdvanced:'adveditor',
- toolbar:bar,
+ toolbar:1,
});
}
More information about the geeklog-cvs
mailing list