Annotation of kupu/silva/lookupwindowscripts.js, revision 1.1

1.1     ! dwinter     1: // document lookup for links
        !             2: 
        !             3: objLookupWindow = null;
        !             4: objTextArea = null;
        !             5: objReferenceFormat = null;
        !             6: objAppendValue = false;
        !             7: 
        !             8: function openObjectLookupWindow(url_to_open, folder_context) {
        !             9:   // open the lookup window, will be called by getObjectReference
        !            10:   url_to_open = url_to_open + '?folder_context=' + folder_context;
        !            11:   width = 760;
        !            12:   height = 500;
        !            13:   leftPos = (screen.width - width) / 2;
        !            14:   topPos = (screen.height - height) / 2;
        !            15:   aspects = 'toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height + ',left=' + leftPos + ',top=' + topPos;
        !            16:   objLookupWindow = window.open(url_to_open, 'ObjectLookupWindow', aspects);
        !            17:   objLookupWindow.focus();
        !            18: }
        !            19: 
        !            20: function getObjectReference(url, format, folder_context) {
        !            21:   // should be called by pagetemplate
        !            22:   referenceFormat = format;
        !            23:   openObjectLookupWindow(url, folder_context);
        !            24: }
        !            25: 
        !            26: function insertObjectReference(id, reference, wndw) {
        !            27:   // Is called by the window if the user selected an object
        !            28:   var text = referenceFormat.replace('_id_', id).replace('_reference_', reference);
        !            29:   var linktool = kupu.getTool('linktool');
        !            30:   linktool.createLink(text);
        !            31:   wndw.close();
        !            32: }
        !            33: 
        !            34: // Image asset lookup
        !            35: 
        !            36: lookupWindow = null;
        !            37: textArea = null;
        !            38: referenceFormat = null;
        !            39: appendValue = false;
        !            40: // Called from getAssetReference
        !            41: function openAssetLookupWindow(url_to_open, folder_context) {
        !            42:   // Do the opening
        !            43:   url_to_open = url_to_open + '&folder_context=' + folder_context;
        !            44:   width = 760;
        !            45:   height = 500;
        !            46:   leftPos = (screen.width - width) / 2;
        !            47:   topPos = (screen.height - height) / 2;
        !            48:   aspects = 'toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width='+width+',height='+height+',left='+leftPos+',top='+topPos;
        !            49:   lookupWindow = window.open(
        !            50:     url_to_open, 'AssetLookupWindow', aspects);
        !            51:   lookupWindow.focus();
        !            52: }
        !            53: // Called from "asset lookup window"
        !            54: function insertAssetReference(id, reference, wndw) {
        !            55:   // for Kupu we need to place the image as well
        !            56:   var imagetool = kupu.getTool('imagetool');
        !            57: 
        !            58:   imagetool.createImage(reference);
        !            59:   // Close LookupWindow
        !            60:   wndw.close();
        !            61: }
        !            62: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>