2 * Magic3標準追加用JavaScriptライブラリ
\r
6 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
\r
8 * @package Magic3 Framework
\r
9 * @author 平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
\r
10 * @copyright Copyright 2006-2013 Magic3 Project.
\r
11 * @license http://www.gnu.org/copyleft/gpl.html GPL License
\r
12 * @version SVN: $Id: m3plus1.6.1.js 6010 2013-05-19 11:38:31Z fishbone $
\r
13 * @link http://www.magic3.org
\r
16 function m3UpdateParentWindow()
\r
18 var href = window.opener.location.href.split('#');
\r
19 window.opener.location.href = href[0];
\r
21 // 各種端末用プレビューウィンドウ表示
\r
22 function m3ShowPreviewWindow(type, url)
\r
41 window.open(url, "", "toolbar=no,menubar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height);
\r
44 * TextAreaをHTMLエディターに変更
\r
46 * @param string id TextAreaタグのIDまたはname
\r
47 * @param bool isMobile 携帯用のツールバー表示
\r
50 function m3_setHtmlEditor(id, isMobile)
\r
52 var oFCKeditor = new FCKeditor(id);
\r
53 oFCKeditor.BasePath = M3_ROOT_URL + '/scripts/fckeditor2.6.6/';
\r
54 oFCKeditor.Config['CustomConfigurationsPath'] = M3_ROOT_URL + '/scripts/m3/fckconfig.js';
\r
55 if (isMobile == null || isMobile == false){
\r
56 oFCKeditor.ToolbarSet = "M3Default"; // ツールバーリソース名
\r
58 oFCKeditor.ToolbarSet = "M3MobileDefault"; // ツールバーリソース名
\r
60 oFCKeditor.Width = "100%";
\r
61 oFCKeditor.Height = "100%";
\r
62 oFCKeditor.Value = 'This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.';
\r
63 oFCKeditor.ReplaceTextarea();
\r
66 * TextAreaをWYSIWYGエディターに変更
\r
68 * @param string id TextAreaタグのIDまたはname
\r
69 * @param int height エディター領域の高さ
\r
70 * @param bool toolbarVisible ツールバーを表示するかどうか
\r
71 * @param string barType ツールバータイプ(full=全項目,layout=レイアウト用)
\r
74 function m3SetWysiwygEditor(id, height, toolbarVisible, barType)
\r
76 if (M3_WYSIWYG_EDITOR == 'ckeditor'){
\r
78 config['customConfig'] = M3_ROOT_URL + '/scripts/m3/ckconfig.js';
\r
79 if (height) config['height'] = height;
\r
80 if (toolbarVisible != null && !toolbarVisible) config['toolbarStartupExpanded'] = false;
\r
85 config['toolbar'] = 'Full';
\r
88 config['toolbar'] = 'Layout';
\r
92 config['toolbar'] = 'Full';
\r
94 CKEDITOR.replace(id, config);
\r
96 var oFCKeditor = new FCKeditor(id);
\r
97 oFCKeditor.BasePath = M3_ROOT_URL + '/scripts/fckeditor2.6.6/';
\r
98 oFCKeditor.Config['CustomConfigurationsPath'] = M3_ROOT_URL + '/scripts/m3/fckconfig.js';
\r
99 oFCKeditor.ToolbarSet = "M3Default"; // ツールバーリソース名
\r
100 if (height) oFCKeditor.Height = String(height) + 'px';
\r
101 oFCKeditor.Value = 'This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.';
\r
102 oFCKeditor.ReplaceTextarea();
\r