Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/ckeditor/plugins/my_link/plugin.js
Show First 20 Lines • Show All 353 Lines • ▼ Show 20 Line(s) | |||||
this.allowOnChange = false; | this.allowOnChange = false; | ||||
dialog.getContentElement('info', 'url').setValue( this.getValue() ); | dialog.getContentElement('info', 'url').setValue( this.getValue() ); | ||||
this.allowOnChange = true; | this.allowOnChange = true; | ||||
load_page_anchors( this.getValue(), dialog ); | load_page_anchors( this.getValue(), dialog ); | ||||
}, | }, | ||||
setup : function( data ) { | setup : function( data ) { | ||||
var $me = this; | var $me = this; | ||||
var $link_url = data.url.url; | var $link_url = data.url ? data.url.url : ''; | ||||
var $ajax_url = CKEDITOR.basePath.replace( /core.*$/, 'admin/index.php?events[fck]=OnLoadCmsTree&admin=1' ); | var $ajax_url = CKEDITOR.basePath.replace( /core.*$/, 'admin/index.php?events[fck]=OnLoadCmsTree&admin=1' ); | ||||
var $internal_page_anchors = this.getDialog().getContentElement( 'info', 'internalPageAnchors' ); | var $internal_page_anchors = this.getDialog().getContentElement( 'info', 'internalPageAnchors' ); | ||||
$('#' + $internal_page_anchors.domId).data('anchor', data.internal_anchor); | $('#' + $internal_page_anchors.domId).data('anchor', data.internal_anchor); | ||||
$.ajax( | $.ajax( | ||||
{ | { | ||||
type: 'GET', | type: 'GET', | ||||
Show All 12 Lines | |||||
var real_url = $node.attr('real_url'); | var real_url = $node.attr('real_url'); | ||||
$internal_page_mapping[cms_page] = real_url; | $internal_page_mapping[cms_page] = real_url; | ||||
$me.add( $node.attr('title').replace(/&/g, '&') , cms_page ); | $me.add( $node.attr('title').replace(/&/g, '&') , cms_page ); | ||||
if ( $link_url && $link_url.match(cms_page + '$') ) { | if ( $link_url && $link_url.match(cms_page + '$') ) { | ||||
$me.setValue(cms_page); | $me.setValue(cms_page); | ||||
load_page_anchors( cms_page, this.getDialog() ); | load_page_anchors( cms_page, $me.getDialog() ); | ||||
} | } | ||||
} | } | ||||
); | ); | ||||
// undo CKEditor default "htmlspecialchars" on all HTML | // undo CKEditor default "htmlspecialchars" on all HTML | ||||
$('option', '#' + $me.domId).each( | $('option', '#' + $me.domId).each( | ||||
function ($index) { | function ($index) { | ||||
var $option = $(this), | var $option = $(this), | ||||
▲ Show 20 Lines • Show All 295 Lines • ▼ Show 20 Line(s) | |||||
delete this._.selectedElement; | delete this._.selectedElement; | ||||
} | } | ||||
}; | }; | ||||
} | } | ||||
} | } | ||||
); | ); | ||||
} | } | ||||
)(); | )(); | ||||
No newline at end of file |