Add files via upload
Paypal plugin for TinyMCE
This commit is contained in:
parent
fc3c4e5bc9
commit
5bcef9123e
28
bl-plugins/tinymce/tinymce/plugins/paypal/plugin.min.js
vendored
Normal file
28
bl-plugins/tinymce/tinymce/plugins/paypal/plugin.min.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
tinymce.PluginManager.add('paypal', function(editor, url) {
|
||||
// Add a button that opens a window
|
||||
editor.addButton('paypal', {
|
||||
text: 'Paypal',
|
||||
icon: false,
|
||||
onclick: function() {
|
||||
// Open window
|
||||
editor.windowManager.open({
|
||||
title: 'Paypal Bludit plugin',
|
||||
body: [
|
||||
{type: 'textbox', name: 'email', label: 'Your Paypal email'},
|
||||
{type: 'textbox', name: 'title', label: 'Title'},
|
||||
{type: 'textbox', name: 'price', label: 'Price'},
|
||||
{type: 'textbox', name: 'currency', label: 'Currency'},
|
||||
{type: 'textbox', name: 'url', label: 'Redirect to url after payment'}
|
||||
],
|
||||
onsubmit: function(e) {
|
||||
// Insert content when the window form is submitted
|
||||
|
||||
var button="<form action='https://www.paypal.com/cgi-bin/webscr' method='post'><input type='hidden' name='business' value='"+e.data.email+"'><input type='hidden' name='cmd' value='_xclick'><input type='hidden' name='item_name' value='"+e.data.title+"'><input type='hidden' name='amount' value='"+e.data.price+"'><input type='hidden' name='currency_code' value='"+e.data.currency+"'><input type='hidden' name='return' value='"+e.data.url+"'><input type='image' name='submit' border='0'src='https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif' alt='Buy Now'>";
|
||||
editor.insertContent(button);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user