Hi
I cannot provide width,height parametr to make Confluence Insert link Dialog. So, the one that appears with default size is bigger one and it's not scrollable. Following is the code for the dialog:
(function($) { // The tab registers itself when the Link Browser is created. AJS.bind("dialog-created.link-browser", function (e, linkBrowser) { var key = 'demo', // This panel's key: must match the ID of the web-item link and panel template $linkField, // The jQueryfied link input element. thisPanel, // A reference to this panel, stored when the panel is created tab; // A reference to the tab // Define the available Link Browser Advanced tab methods. tab = linkBrowser.tabs[key] = { // called when the panel is created - register event handlers here createPanel: function (context) { thisPanel = context.baseElement; $linkField = thisPanel.find("input[name='destination']"); AJS.$.ajax({ url: AJS.contextPath() + "/rest/dreambroker-rest/1.0/dreambroker/videoList", type: "GET", dataType: "xml", success: function(data){ //alert("in success"); //alert('form found'); var vdoSelect = AJS.$("#videos"); vdoSelect.val(''); // vdoSelect.append("<option class='ddindent'>Select</option>"); AJS.$(data).find("video").each(function() { // alert("title=" + AJS.$(this).find("title").text() + "url=" + AJS.$(this).find("url").text()); var vdoTitle = AJS.$(this).find("title").text(); var vdoUrl = AJS.$(this).find("url").text(); vdoSelect.append("<option class='ddindent' value='"+ vdoUrl +"'>"+vdoTitle+"</option>"); }); return false; }, error: function(response) { alert("failed"); } }); thisPanel.find("form").keydown(function(e) { if(e.keyCode == 13 && !linkBrowser.isSubmitButtonEnabled()) { e.preventDefault(); } }); $linkField.keyup(function (e) { AJS.log("link field keyup"); var url = $linkField.val(); var linkObj = url ? Confluence.Link.makeExternalLink(url) : null; if (linkObj) { linkBrowser.setLink(linkObj); // will enable the Submit button when a URL is added } }); }, // Called when the panel is selected onSelect: function () { // Defer focus to after dialog is shown, gets around AJS.Dialog tabindex issues setTimeout(function() { $linkField.focus(); }); }, // Called when this panel is no longer selected onDeselect: function () { }, // Called when the submit button is clicked, before the location is retrieved preSubmit: function () { }, // Called before the dialog opens to determine which tab to highlight handlesLink: function (linkObj) { // return true if the link should be cause this panel to be selected when editing return false; } }; }); // AJS.$.ajax({ // }); })(jQuery);
The dialog gets created at the bold lines in the code, now I need to provide width, height parameters or scroll parameter. Can someone help me?
Thanks
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.