Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* This is my paypal.js code */
- (function()
- {
- var paypalButtonData = {};
- CKEDITOR.dialog.add( 'paypalChooseButton', function( editor )
- {
- var lang = editor.lang.paypal;
- return {
- title : CKEDITOR.env.ie ? lang.dlgTitle : lang.title,
- minWidth : 300,
- minHeight : 250,
- contents : [
- {
- id: 'paypal1',
- label: '',
- title: '',
- expand: false,
- padding: 0,
- elements: [
- {
- type: 'select',
- id: 'CKpaypal-currency',
- label: lang.labelButtontype + ' *',
- items: [ ['Please select one:', ''],['Single Item', 'paypalCreateSingleButton'],['Multi Choice Button', 'paypalCreateMultiButton']],
- validate: function()
- {
- if( this.getValue() === '' )
- {
- document.getElementById( 'CKpaypal-validationMessages' ).innerHTML = lang.validatecurrency;
- return false;
- };
- },
- commit: function()
- {
- paypalButtonData.buttonType = this.getValue();
- }
- },
- {
- type: 'html',
- html: '<div id="CKpaypal-validationMessages" style="color:red;font-weight:bold;margin-top:20px;"></div>'
- }
- ]
- }
- ],
- onOk: function()
- {
- this.commitContent();
- console.log( paypalButtonData );
- editor.openDialog( paypalButtonData.buttonType );
- return;
- },
- onShow: function()
- {
- paypalButtonData = {};
- document.getElementById( 'CKpaypal-validationMessages' ).innerHTML = '';
- return;
- }
- };
- });
- })();
Add Comment
Please, Sign In to add comment