OSDN Git Service

CKEditorリンク先URL作成プラグインのバグ修正。 v2.7.14
authornaoki hirata <naoki@magic3.org>
Sun, 3 Nov 2013 08:37:09 +0000 (17:37 +0900)
committernaoki hirata <naoki@magic3.org>
Sun, 3 Nov 2013 08:37:09 +0000 (17:37 +0900)
include/global.php
include/sql/update_widgets.sql
scripts/ckeditor4.2.0/plugins/linkinfo/dialogs/linkinfo.js
scripts/ckeditor4.2.0/plugins/linkinfo/lang/en.js
scripts/ckeditor4.2.0/plugins/linkinfo/lang/ja.js
scripts/m3/ckconfig_direct.js

index 29ca4e1..e168d59 100644 (file)
@@ -48,8 +48,8 @@ define('M3_ENCODING', 'UTF-8');       // 内部エンコーディング
 // ########## システム関係 ##########
 // システム基本情報
 define('M3_SYSTEM_NAME',                       'Magic3');              // システム名称
-define('M3_SYSTEM_VERSION',                    '2.7.13');              // システムのバージョン
-define('M3_SYSTEM_RELEASE_DATE',       '2013/10/26');  // システムのリリース日付
+define('M3_SYSTEM_VERSION',                    '2.7.14');              // システムのバージョン
+define('M3_SYSTEM_RELEASE_DATE',       '2013/11/3');   // システムのリリース日付
 define('M3_SYSTEM_ID',                         'M3');                  // コンポーネント識別用ID
 define('M3_SYSTEM_DESCRIPTION',                'Magic3 is open source cms and web communication platform.');           // システムの説明
 define('M3_SYSTEM_MIN_MEMORY',         '16M');                 // 最小メモリ使用量
index 349f470..80e0ad9 100644 (file)
@@ -414,11 +414,11 @@ INSERT INTO _widgets
 DELETE FROM _widgets WHERE wd_id = 'm/content';\r
 INSERT INTO _widgets\r
 (wd_id,      wd_name,       wd_type,   wd_content_type, wd_edit_content, wd_version, wd_author,      wd_copyright, wd_license, wd_official_level, wd_description, wd_device_type, wd_mobile, wd_has_admin, wd_initialized, wd_install_dt, wd_create_dt) VALUES\r
-('m/content', 'æ±\8eç\94¨ã\82³ã\83³ã\83\86ã\83³ã\83\84 - ã\82³ã\83³ã\83\86ã\83³ã\83\84', 'content', 'content', true,       '1.0.0',    'Naoki Hirata', 'Magic3.org', 'GPL',      10, '汎用コンテンツを表示。', 1,              true,      true,         true,              now(),         now());\r
+('m/content', 'æ±\8eç\94¨ã\82³ã\83³ã\83\86ã\83³ã\83\84 - ã\83¡ã\82¤ã\83³', 'content', 'content', true,       '1.0.0',    'Naoki Hirata', 'Magic3.org', 'GPL',      10, '汎用コンテンツを表示。', 1,              true,      true,         true,              now(),         now());\r
 DELETE FROM _widgets WHERE wd_id = 'm/pc_content';\r
 INSERT INTO _widgets\r
 (wd_id,      wd_name,          wd_type, wd_content_type, wd_version, wd_params, wd_author,      wd_copyright, wd_license, wd_official_level, wd_description, wd_device_type, wd_mobile, wd_has_admin, wd_initialized, wd_install_dt, wd_create_dt) VALUES\r
-('m/pc_content', '汎用コンテンツ - PC共通コンテンツ', 'content', 'content',  '2.0.0',    '',        'Naoki Hirata', 'Magic3.org', 'GPL',      10, 'PCの汎用コンテンツを自動的に携帯用に変換して表示。', 1,              true,      true,         true,              now(),         now());\r
+('m/pc_content', '汎用コンテンツ(PC共通) - メイン', 'content', 'content',  '2.0.0',    '',        'Naoki Hirata', 'Magic3.org', 'GPL',      10, 'PCの汎用コンテンツを自動的に携帯用に変換して表示。', 1,              true,      true,         true,              now(),         now());\r
 DELETE FROM _widgets WHERE wd_id = 'm/content_search_box';\r
 INSERT INTO _widgets\r
 (wd_id,                  wd_name,              wd_version, wd_author,      wd_copyright, wd_license, wd_official_level, wd_description, wd_device_type,         wd_mobile, wd_has_admin, wd_initialized, wd_install_dt, wd_create_dt) VALUES\r
@@ -488,7 +488,7 @@ INSERT INTO _widgets
 DELETE FROM _widgets WHERE wd_id = 's/content';\r
 INSERT INTO _widgets\r
 (wd_id,       wd_parent_id, wd_name,      wd_type, wd_content_type,   wd_edit_content, wd_version, wd_author,      wd_copyright, wd_license, wd_official_level, wd_description, wd_device_type, wd_add_script_lib, wd_add_script_lib_a, wd_has_admin, wd_enable_operation, wd_initialized, wd_launch_index, wd_cache_type, wd_view_control_type, wd_release_dt, wd_install_dt, wd_create_dt) VALUES\r
-('s/content', 'default_content', 'æ±\8eç\94¨ã\82³ã\83³ã\83\86ã\83³ã\83\84 - ã\82³ã\83³ã\83\86ã\83³ã\83\84', 'content',       'content', true, '2.3.0',    'Naoki Hirata', 'Magic3.org', 'GPL',      10,                '画像やテキストからできた汎用コンテンツを表示。', 2,         '', 'content_detail=jquery.tablednd', true, true,         true,           0, 2, 2, '2012-08-18', now(), now());\r
+('s/content', 'default_content', 'æ±\8eç\94¨ã\82³ã\83³ã\83\86ã\83³ã\83\84 - ã\83¡ã\82¤ã\83³', 'content',       'content', true, '2.3.0',    'Naoki Hirata', 'Magic3.org', 'GPL',      10,                '画像やテキストからできた汎用コンテンツを表示。', 2,         '', 'content_detail=jquery.tablednd', true, true,         true,           0, 2, 2, '2012-08-18', now(), now());\r
 DELETE FROM _widgets WHERE wd_id = 's/slide_menu';\r
 INSERT INTO _widgets\r
 (wd_id,        wd_name,           wd_type, wd_version, wd_author,      wd_copyright, wd_license, wd_official_level, wd_description, wd_device_type, wd_add_script_lib, wd_add_script_lib_a,                         wd_has_admin, wd_use_instance_def, wd_initialized, wd_cache_type, wd_view_control_type, wd_release_dt, wd_install_dt, wd_create_dt) VALUES\r
index 7b4649c..be36c12 100644 (file)
@@ -25,6 +25,7 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
                var pageNo = 1;
 
                // コンテンツプレビュークリア
+               dialog.getContentElement('tab_basic', 'url').setValue('');
                $('#content_text').text('');
                
                // Ajaxでページ情報を取得
@@ -40,7 +41,45 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
                        alert('通信に失敗しました。');
                });
        }
-       
+               // コンテンツタイプを取得
+       function updateContentType()
+       {
+               var elementId = '#' + dialog.getContentElement('tab_basic', 'content_type').getInputElement().$.id;
+               
+               // Ajaxでコンテンツタイプを取得
+               m3_ajax_request('', 'task=linkinfo&act=getcontenttype&accesspoint=' + accessPoint, function(request, retcode, jsondata){                // 正常終了
+                       // コンテンツ種別選択メニューを更新
+                       $('option', elementId).remove();
+                       if (jsondata.contenttype){
+                               $.each(jsondata.contenttype, function(index, item) {
+                                       $(elementId).get(0).options[$(elementId).get(0).options.length] = new Option(item[1], item[0]);
+                               });
+                       }
+                       
+                       // デフォルトのコンテンツリストを取得
+                       updateContentList();
+               }, function(request){           // 異常終了
+                       alert('通信に失敗しました。');
+               });
+       }
+       // ページリストを取得
+       function updatePageList()
+       {
+               var elementId = '#' + dialog.getContentElement('tab_basic', 'page_list').getInputElement().$.id;
+
+               // Ajaxでページ情報を取得
+               m3_ajax_request('', 'task=linkinfo&act=getpage&accesspoint=' + accessPoint, function(request, retcode, jsondata){               // 正常終了
+                       // ページ選択メニューを更新
+                       $('option', elementId).remove();
+                       if (jsondata.pagelist){
+                               $.each(jsondata.pagelist, function(index, item) {
+                                       $(elementId).get(0).options[$(elementId).get(0).options.length] = new Option(item[1], item[0]);
+                               });
+                       }
+               }, function(request){           // 異常終了
+                       alert('通信に失敗しました。');
+               });
+       }
        // ダイアログ上の項目の表示制御
        function updateItems()
        {
@@ -51,21 +90,21 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
                        case 'content':
                                dialog.getContentElement('tab_basic', 'content_type').getElement().show();
                                dialog.getContentElement('tab_basic', 'content_list').getElement().show();
-                               dialog.getContentElement('tab_basic', 'page').getElement().hide();
+                               dialog.getContentElement('tab_basic', 'page_list').getElement().hide();
                                dialog.getContentElement('tab_basic', 'content_label').getElement().show();
                                $('#content_text').show();
                                break;
                        case 'page':
                                dialog.getContentElement('tab_basic', 'content_type').getElement().hide();
                                dialog.getContentElement('tab_basic', 'content_list').getElement().hide();
-                               dialog.getContentElement('tab_basic', 'page').getElement().show();
+                               dialog.getContentElement('tab_basic', 'page_list').getElement().show();
                                dialog.getContentElement('tab_basic', 'content_label').getElement().hide();
                                $('#content_text').hide();
                                break;
                        case 'others':
                                dialog.getContentElement('tab_basic', 'content_type').getElement().hide();
                                dialog.getContentElement('tab_basic', 'content_list').getElement().hide();
-                               dialog.getContentElement('tab_basic', 'page').getElement().hide();
+                               dialog.getContentElement('tab_basic', 'page_list').getElement().hide();
                                dialog.getContentElement('tab_basic', 'content_label').getElement().hide();
                                $('#content_text').hide();
                                break;
@@ -74,7 +113,9 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
        // URLを更新。必要項目が選択されていない場合はクリア。
        function updateUrl()
        {
-               var url = M3_ROOT_URL + '/index.php';
+               var url = M3_ROOT_URL;
+               if (accessPoint != '') url += '/' + accessPoint;
+               url += '/index.php';
                
                // リンク対象を取得
                var linkTarget = dialog.getValueOf('tab_basic', 'link_target');
@@ -103,13 +144,15 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
                                }
                                break;
                        case 'page':
-                               var pageSubId = dialog.getContentElement('tab_basic', 'page').getValue();
+                               var pageSubId = dialog.getContentElement('tab_basic', 'page_list').getValue();
                                switch (pageSubId){
                                        case '':
                                                url = '';
                                                break;
                                        case '_root':
-                                               url = M3_ROOT_URL + '/';
+                                               url = M3_ROOT_URL;
+                                               if (accessPoint != '') url += '/' + accessPoint;
+                                               url += '/';
                                                break;
                                        default:
                                                url += '?sub=' + pageSubId;
@@ -141,6 +184,20 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
                        accessPoint = _m3AccessPoint;           // アクセスポイント
                        dialog.getContentElement('tab_basic', 'url').setValue(_m3Url);
                },
+               onShow : function(){    // 再表示時イベント                     
+                       // ダイアログ項目の表示制御
+                       updateItems();
+                       
+                       // 起動時の初期値を設定
+                       $('#content_text').text('');// コンテンツプレビュークリア
+                       accessPoint = _m3AccessPoint;           // アクセスポイント
+                       dialog.getContentElement('tab_basic', 'url').setValue(_m3Url);
+                       
+                       // フレーム内にある場合は表示位置を調整
+                       if (window.parent != window.self){
+                               this.move(this.getPosition().x, 0);
+                       }
+               },
                contents: [
                        {
                                id: 'tab_basic',
@@ -169,24 +226,9 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
                                                items : [
                                                        [ '接続中', '' ]
                                                ],
-                                               onLoad : function(){            // 起動時イベント
-                                                       var elementId = '#' + this.getInputElement().$.id;
-
-                                                       // Ajaxでページ情報を取得
-                                                       m3_ajax_request('', 'task=linkinfo&act=getcontenttype&accesspoint=' + accessPoint, function(request, retcode, jsondata){                // 正常終了
-                                                               // コンテンツ種別選択メニューを更新
-                                                               $('option', elementId).remove();
-                                                               if (jsondata.contenttype){
-                                                                       $.each(jsondata.contenttype, function(index, item) {
-                                                                               $(elementId).get(0).options[$(elementId).get(0).options.length] = new Option(item[1], item[0]);
-                                                                       });
-                                                               }
-                                                               
-                                                               // デフォルトのコンテンツリストを取得
-                                                               updateContentList();
-                                                       }, function(request){           // 異常終了
-                                                               alert('通信に失敗しました。');
-                                                       });
+                                               onShow : function(){    // 選択値変更時イベント
+                                                       // コンテンツタイプ更新
+                                                       updateContentType();
                                                },
                                                onChange : function(){  // 選択値変更時イベント
                                                        // コンテンツリストを更新
@@ -226,28 +268,15 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
                                        },
                                        {
                                                type : 'select',
-                                               id : 'page',
-                                               label : editor.lang.linkinfo.page_title,
+                                               id : 'page_list',
+                                               label : editor.lang.linkinfo.page_list_title,
                                                items : [
                                                        [ '接続中', '' ]
                                                ],
-                                               onLoad : function(){            // 起動時イベント
-//                                                     this.getElement().hide();               // 初期時は項目を隠す
-                                                       
-                                                       var elementId = '#' + this.getInputElement().$.id;
-
-                                                       // Ajaxでページ情報を取得
-                                                       m3_ajax_request('', 'task=linkinfo&act=getpage', function(request, retcode, jsondata){          // 正常終了
-                                                               // ページ選択メニューを更新
-                                                               $('option', elementId).remove();
-                                                               if (jsondata.pagelist){
-                                                                       $.each(jsondata.pagelist, function(index, item) {
-                                                                               $(elementId).get(0).options[$(elementId).get(0).options.length] = new Option(item[1], item[0]);
-                                                                       });
-                                                               }
-                                                       }, function(request){           // 異常終了
-                                                               alert('通信に失敗しました。');
-                                                       });
+                                               //onLoad : function(){          // 起動時イベント
+                                               onShow : function(){            // 再表示イベント
+                                                       // ページリスト更新
+                                                       updatePageList();
                                                },
                                                onChange : function(){  // 選択値変更時イベント
                                                        // URLを更新
@@ -296,7 +325,7 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
                                                ],
                                                onLoad : function(){            // 起動時イベント
                                                        var elementId = '#' + this.getInputElement().$.id;
-
+                                                       
                                                        // Ajaxでページ情報を取得
                                                        m3_ajax_request('', 'task=linkinfo&act=getaccesspoint', function(request, retcode, jsondata){           // 正常終了
                                                                // アクセスポイント選択メニューを更新
@@ -307,11 +336,26 @@ CKEDITOR.dialog.add('linkinfoDialog', function(editor){
                                                                        });
                                                                }
                                                                // 項目を再選択
-                                                               //$(elementId).val(_m3AccessPoint);
                                                                $(elementId).val(accessPoint);
                                                        }, function(request){           // 異常終了
                                                                alert('通信に失敗しました。');
                                                        });
+                                               },
+                                               onShow : function(){            // 再表示イベント
+                                                       var elementId = '#' + this.getInputElement().$.id;
+                                                       
+                                                       // 項目を再選択
+                                                       $(elementId).val(accessPoint);
+                                               },
+                                               onChange : function(){
+                                                       // アクセスポイント変更
+                                                       accessPoint = dialog.getContentElement('tab_advanced', 'access_point').getValue();
+               
+                                                       // コンテンツタイプ更新
+                                                       updateContentType();
+                                                       
+                                                       // ページリスト更新
+                                                       updatePageList();
                                                }
                                        }
                                ]
index 03aa29c..f467c3c 100644 (file)
@@ -18,7 +18,7 @@ CKEDITOR.plugins.setLang( 'linkinfo', 'en', {
        tab_info_title: 'URL Info',
        tab_advanced_title: 'Advanced Settings',
        link_target_title: 'Select the link target.',
-       page_title: 'Page',
+       page_list_title: 'Page',
        content_type_title: 'Content Type',
        content_list_title: 'Content',
        access_point_title: 'Access Point',
index 273d4d3..ad4e57b 100644 (file)
@@ -18,7 +18,7 @@ CKEDITOR.plugins.setLang( 'linkinfo', 'ja', {
        tab_info_title: 'URL情報',
        tab_advanced_title: '高度な設定',
        link_target_title: 'リンク対象を選択してください。',
-       page_title: 'ページ',
+       page_list_title: 'ページ',
        content_type_title: 'コンテンツ種別',
        content_list_title: 'コンテンツ',
        access_point_title: 'アクセスポイント',
index 171331d..1c658c4 100644 (file)
@@ -29,15 +29,5 @@ CKEDITOR.editorConfig = function(config){
        // 追加プラグインの設定
        config.extraPlugins = 'linkinfo';
 };
-CKEDITOR.on('dialogDefinition', function(e){
-       var dialogName = e.data.name;
-       var dialogDefinition = e.data.definition;
-       dialogDefinition.onShow = function(){
-               // 呼び出し元がiframeの場合は、ダイアログの表示位置を修正
-               if (window.parent != window.self){
-                       this.move(this.getPosition().x, 0);
-               }
-       }
-})