Changing size and feature of new window in Fusion viewer “invoke URL”

本文介绍如何通过编辑FusionViewer源代码来修改使用'invokeURL'命令打开的新浏览器窗口的属性,包括使其可调整大小及显示菜单栏等。


By Daniel Du

If you use “invoke URL” command of fusion viewer and select “New Window” as target to open a new browser window, you may find this window is fixed, not resizable, no memubar, no status bar, and no location bar.

image

If you want to change the features of this window, please keep reading.

Actually it is hard-coded in fusion viewer, you can edit the source code, please open C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2013\www\fusion\widgets\InvokeURL.js in your favorite text editor, refer to around line 40:

Fusion.Widget.InvokeURL = OpenLayers.Class(Fusion.Widget, {

    uiClass: Jx.Button,

   sFeatures: 'menubar=no,location=no,resizable=no,status=no',

and also refer to line 124 for the usage of it:

var pageElement = $(this.sTarget);

if ( pageElement ) {

    pageElement.src = url;

else {

   window.open(url, this.sTarget, this.sFeatures);

  }

It is a parameter passed to JavaScript function window.open, please refer to this link for detailed information to set suitable value you need.

Finally, to apply your changes, you need to switch to debug mode by editing the script reference in template html page. As I said in previous post, for Fusion Viewer, let’s say you are using the “slate” template, please open C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2013\www\fusion\templates\mapguide\slate\index.html with your favorite text editor, I am using notepad++, change following code:

<script type="text/javascript" 
src="../../../lib/fusionSF-compressed.js"></script>

to

<script type="text/javascript" 
src="../../../lib/fusion.js"></script>

Of cause you can also re-compress all JavaScript files with your changes using tools like YUI compressor to improve performance, I will not cover how to use YUI compressor in this blog, please search yourself, I bet you can get many resources about that topic, and this post may be helpful as well.

Hope this helps.

作者: 峻祁连
邮箱:junqilian@163.com 
出处: http://junqilian.cnblogs.com 
转载请保留此信息。




本文转自峻祁连. Moving to Cloud/Mobile博客园博客,原文链接:http://www.cnblogs.com/junqilian/archive/2012/08/31/2665374.html ,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值