Ticket #439: 439.2.patch

File 439.2.patch, 10.3 KB (added by martinkou, 21 months ago)
  • _whatsnew.html

     
    3737        <p> 
    3838                New Features and Improvements:</p> 
    3939        <ul> 
    40                 <li></li> 
     40                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/439">#439</a>] Added a new 
     41                        right-click menu open for opening links in the editor.</li> 
    4142        </ul> 
    4243        <p> 
    4344                Fixed Bugs:</p> 
  • editor/_source/commandclasses/fck_othercommands.js

     
    300300        var state = FCK.GetNamedCommandState( this.Name ) ; 
    301301 
    302302        // Check that it isn't an anchor 
    303         if ( state == FCK_TRISTATE_OFF && FCK.EditMode == FCK_EDITMODE_WYSIWYG ) 
     303        if ( state == FCK_TRISTATE_OFF ) 
    304304        { 
    305305                var oLink = FCKSelection.MoveToAncestorNode( 'A' ) ; 
    306306                var bIsAnchor = ( oLink && oLink.name.length > 0 && oLink.href.length == 0 ) ; 
     
    311311        return state ; 
    312312} 
    313313 
     314FCKVisitLinkCommand = function() 
     315{ 
     316        this.Name = 'VisitLink'; 
     317} 
     318FCKVisitLinkCommand.prototype = 
     319{ 
     320        GetState : function() 
     321        { 
     322                if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ) 
     323                        return FCK_TRISTATE_DISABLED ; 
     324                var state = FCK.GetNamedCommandState( 'Unlink' ) ; 
     325 
     326                if ( state == FCK_TRISTATE_OFF ) 
     327                { 
     328                        var el = FCKSelection.MoveToAncestorNode( 'A' ) ; 
     329                        if ( !el.href ) 
     330                                state = FCK_TRISTATE_DISABLED ; 
     331                } 
     332 
     333                return state ; 
     334        }, 
     335 
     336        Execute : function() 
     337        { 
     338                var el = FCKSelection.MoveToAncestorNode( 'A' ) ; 
     339                var url = el.getAttribute( '_fcksavedurl' ) ; 
     340 
     341                // Check if it's a full URL, a full URL includes the scheme name, see RFC3986. 
     342                // If not full URL, we'll need to apply the BaseHref setting. 
     343                if ( ! /^[A-Za-z][0-9A-Za-z+-.]*:/.test( url ) ) 
     344                { 
     345                        var baseHref = FCKConfig.BaseHref ; 
     346                        var parentWindow = FCK.GetInstanceObject( 'parent' ) ; 
     347                        if ( !baseHref ) 
     348                        { 
     349                                baseHref = parentWindow.document.location.href ; 
     350                                baseHref = baseHref.substring( 0, baseHref.lastIndexOf( '/' ) + 1 ) ; 
     351                        } 
     352 
     353                        if ( /^\//.test( url ) ) 
     354                        { 
     355                                try 
     356                                { 
     357                                        baseHref = baseHref.match( /^([A-Za-z][0-9A-Za-z+-.]*:[\/]+[^\/]+)/ )[1] ; 
     358                                } 
     359                                catch ( e ) 
     360                                { 
     361                                        baseHref = parentWindow.document.location.protocol + '://' + parentWindow.parent.document.location.host ; 
     362                                } 
     363                        } 
     364 
     365                        url = baseHref + url ; 
     366                } 
     367 
     368                if ( !window.open( url, 'FCKVisitLink' ) ) 
     369                        alert( FCKLang.VisitLinkBlocked ) ; 
     370        } 
     371} ; 
     372 
    314373// FCKSelectAllCommand 
    315374var FCKSelectAllCommand = function() 
    316375{ 
  • editor/_source/internals/fck_contextmenu.js

     
    131131                                        if ( bInsideLink ) 
    132132                                                menu.AddItem( 'Link', FCKLang.EditLink          , 34 ) ; 
    133133                                        menu.AddItem( 'Unlink'  , FCKLang.RemoveLink    , 35 ) ; 
     134                                        menu.AddSeparator() ; 
     135                                        menu.AddItem( 'VisitLink', FCKLang.VisitLink, 34 ) ; 
    134136                                } 
    135137                        }} ; 
    136138 
  • editor/_source/internals/fckcommands.js

     
    5151                case 'Templates'        : oCommand = new FCKDialogCommand( 'Templates'  , FCKLang.DlgTemplatesTitle             , 'dialog/fck_template.html'    , 380, 450 ) ; break ; 
    5252                case 'Link'                     : oCommand = new FCKDialogCommand( 'Link'               , FCKLang.DlgLnkWindowTitle             , 'dialog/fck_link.html'                , 400, 300 ) ; break ; 
    5353                case 'Unlink'           : oCommand = new FCKUnlinkCommand() ; break ; 
     54                case 'VisitLink'        : oCommand = new FCKVisitLinkCommand() ; break ; 
    5455                case 'Anchor'           : oCommand = new FCKDialogCommand( 'Anchor'             , FCKLang.DlgAnchorTitle                , 'dialog/fck_anchor.html'              , 370, 160 ) ; break ; 
    5556                case 'AnchorDelete'     : oCommand = new FCKAnchorDeleteCommand() ; break ; 
    5657                case 'BulletedList'     : oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp             , 'dialog/fck_listprop.html?UL' , 370, 160 ) ; break ; 
  • editor/lang/en-au.js

     
    4444InsertLinkLbl           : "Link", 
    4545InsertLink                      : "Insert/Edit Link", 
    4646RemoveLink                      : "Remove Link", 
     47VisitLink                       : "Open Link", 
    4748Anchor                          : "Insert/Edit Anchor", 
    4849AnchorDelete            : "Remove Anchor", 
    4950InsertImageLbl          : "Image", 
     
    157158NoActiveX                       : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", 
    158159BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", 
    159160DialogBlocked           : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", 
     161VisitLinkBlocked        : "It was not possible to open a new window. Make sure all popup blockers are disabled.", 
    160162 
    161163// Dialogs 
    162164DlgBtnOK                        : "OK", 
  • editor/lang/en-ca.js

     
    4444InsertLinkLbl           : "Link", 
    4545InsertLink                      : "Insert/Edit Link", 
    4646RemoveLink                      : "Remove Link", 
     47VisitLink                       : "Open Link", 
    4748Anchor                          : "Insert/Edit Anchor", 
    4849AnchorDelete            : "Remove Anchor", 
    4950InsertImageLbl          : "Image", 
     
    157158NoActiveX                       : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", 
    158159BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", 
    159160DialogBlocked           : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", 
     161VisitLinkBlocked        : "It was not possible to open a new window. Make sure all popup blockers are disabled.", 
    160162 
    161163// Dialogs 
    162164DlgBtnOK                        : "OK", 
  • editor/lang/en-uk.js

     
    4444InsertLinkLbl           : "Link", 
    4545InsertLink                      : "Insert/Edit Link", 
    4646RemoveLink                      : "Remove Link", 
     47VisitLink                       : "Open Link", 
    4748Anchor                          : "Insert/Edit Anchor", 
    4849AnchorDelete            : "Remove Anchor", 
    4950InsertImageLbl          : "Image", 
     
    157158NoActiveX                       : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", 
    158159BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", 
    159160DialogBlocked           : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", 
     161VisitLinkBlocked        : "It was not possible to open a new window. Make sure all popup blockers are disabled.", 
    160162 
    161163// Dialogs 
    162164DlgBtnOK                        : "OK", 
  • editor/lang/en.js

     
    4444InsertLinkLbl           : "Link", 
    4545InsertLink                      : "Insert/Edit Link", 
    4646RemoveLink                      : "Remove Link", 
     47VisitLink                       : "Open Link", 
    4748Anchor                          : "Insert/Edit Anchor", 
    4849AnchorDelete            : "Remove Anchor", 
    4950InsertImageLbl          : "Image", 
     
    157158NoActiveX                       : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", 
    158159BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", 
    159160DialogBlocked           : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", 
     161VisitLinkBlocked        : "It was not possible to open a new window. Make sure all popup blockers are disabled.", 
    160162 
    161163// Dialogs 
    162164DlgBtnOK                        : "OK", 
  • editor/lang/zh-cn.js

     
    4444InsertLinkLbl           : "超链接", 
    4545InsertLink                      : "插入/编辑超链接", 
    4646RemoveLink                      : "取消超链接", 
     47VisitLink                       : "打开超链接", 
    4748Anchor                          : "插入/编辑锚点链接", 
    4849AnchorDelete            : "清除锚点链接", 
    4950InsertImageLbl          : "图象", 
     
    157158NoActiveX                       : "浏览器安全设置限制了本编辑器的某些功能。您必须启用安全设置中的“运行 ActiveX 控件和插件”,否则将出现某些错误并缺少功能。", 
    158159BrowseServerBlocked : "无法打开资源浏览器,请确认是否启用了禁止弹出窗口。", 
    159160DialogBlocked           : "无法打开对话框窗口,请确认是否启用了禁止弹出窗口或网页对话框(IE)。", 
     161VisitLinkBlocked        : "无法打开新窗口,请确认是否启用了禁止弹出窗口或网页对话框(IE)。", 
    160162 
    161163// Dialogs 
    162164DlgBtnOK                        : "确定", 
  • editor/lang/zh.js

     
    4444InsertLinkLbl           : "超連結", 
    4545InsertLink                      : "插入/編輯超連結", 
    4646RemoveLink                      : "移除超連結", 
     47VisitLink                       : "開啟超連結", 
    4748Anchor                          : "插入/編輯錨點", 
    4849AnchorDelete            : "移除錨點", 
    4950InsertImageLbl          : "影像", 
     
    157158NoActiveX                       : "瀏覽器的安全性設定限制了本編輯器的某些功能。您必須啟用安全性設定中的「執行ActiveX控制項與外掛程式」項目,否則本編輯器將會出現錯誤並缺少某些功能", 
    158159BrowseServerBlocked : "無法開啟資源瀏覽器,請確定所有快顯視窗封鎖程式是否關閉", 
    159160DialogBlocked           : "無法開啟對話視窗,請確定所有快顯視窗封鎖程式是否關閉", 
     161VisitLinkBlocked        : "無法開啟新視窗,請確定所有快顯視窗封鎖程式是否關閉", 
    160162 
    161163// Dialogs 
    162164DlgBtnOK                        : "確定",