This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/views/admin/assets/create.js.erb

21 lines
1000 B
Plaintext
Raw Normal View History

2012-05-16 07:33:54 +00:00
// Uncomment and change this document.domain value if you are loading the script cross subdomains
// document.domain = 'moxiecode.com';
2012-05-16 08:22:50 +00:00
var returnurl = "<%= @asset.data.url %>";
2012-05-17 11:40:30 +00:00
var returntitle = "<%= show_all_fields(@asset, 'title') %>";
var returndescription = "<%= show_all_fields(@asset, 'description') %>";
2012-05-16 08:22:50 +00:00
var win = tinyMCEPopup.getWindowArg("window");
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = returnurl;
win.document.getElementById(tinyMCEPopup.getWindowArg("alt")).value = returndescription;
win.document.getElementById(tinyMCEPopup.getWindowArg("title")).value = returntitle;
2012-05-16 08:22:50 +00:00
if (typeof(win.ImageDialog) != "undefined") {
// we are, so update image dimensions...
if (win.ImageDialog.getImageData)
win.ImageDialog.getImageData();
// ... and preview if necessary
if (win.ImageDialog.showPreviewImage)
win.ImageDialog.showPreviewImage(returnurl);
}
tinyMCEPopup.close();