웹, HTML

IE 컨텍스트 메뉴(오른쪽 팝업) 관련 스크립트 참조

디버그정 2008. 9. 18. 04:55

Increasing N54 Edit boxes

This is a code Mr.Pip has created. I've copied it from his forum.
It enables your MS-InternetExplorer to increase the tiny
Header and Footer boxes on n54 Edit/Options page by a simple mouse-click.


1.) Create a new htm file.
Copy and paste the HTM code below and save the file as nw54edit.htm to your C:\\windows\\web\\ folder.


<script type="text/javascript">
<!--
var parentWin = external.menuArguments;
var parentDoc = parentWin.document;
if (parentDoc.title == "My Account: Forums: Edit: Opti
ons")||(parentDoc.title == "My Account: Indexes: Edit: Options")){
parentDoc.postform.header.cols=80;
parentDoc.postform.header.rows=20;
parentDoc.postform.footer.cols=80;
parentDoc.postform.footer.rows=20;
}
else {alert("Information\n\nThis command cannot be run this at this time!")}
-->
</script>

Update from Mr.Pip's:
you may add:
  parentDoc.postform.description.cols=80;
  parentDoc.postform.description.rows=20;
if you want to increase the Descriptionbox, too.
2.) Next create a reg file.
Copy and paste the Reg code below and save it as "nw54edit.reg" also in folder
c:\\windows\\web\\ :


REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Nw54 AdminEdit]
@="file://c:\\windows\\web\\nw54edit.htm"
"Contexts"=dword:00000001

If you save the files in a folder other then the windows\web folder
you must edit the reg file and change the line:

@="file://c:\\windows\\web\\nw54edit.htm"

to reflect your folder path.

3.) Now close the browser, execute the reg file, open up the browser to your Network54 Edit/Options-page.

When you right-click on the page to bring up the contex menu you'll see a new entry named
Nw54 AdminEdit. Just click on it and it will increase the boxes on the Nw54 Forum/Edit page. :-)

If you don't know how to write those files you may download them from here:
(RightClick the link and 'Save Target as...' ... to Windows/Web-folder, and if this is your Win-location.)
http://network54.com/Realm/n54_files/nw54edit.htm
http://network54.com/Realm/n54_files/nw54edit.reg


All these scripts and text copied from Mr.Pip's forum: Some more useful Context Menu Options
Browser Source, Mark Text, Google, View Link Source, Safe Frame, Links List, Text2Url, ViewRealm.

View Realm files in New Window

Add ViewRealm to your context menu.
View the files from your Realm<<Edit<<Files-page by highlighting and right-click the file's name in Preview window, click on ViewRealm in your context menu, and the file will open in new window from where you can copy the URL from the browser bar.
(http://www.network54.com/My_Account/Realms/Edit/Files?realmid= xxxx) X= your Realm No.
Note: Be aware this will only work with one Realm Name. If you have more than one Realm you have to change these two file's names and the target-Name in the html file.
The here used Realm is "Realm/n54_files/", if your Realm's name is perhaps ..."/garden/" then you have to add a second couple of re-named *.view.html (and the *.reg file) to *.viewrealm_garden or *.viewrealm1 or so and change it in the html file, too. And don't forget to change the new name on your new *.reg file, it will make more clear in your context menu which Realm to preview.
if(selectedtext.match("http://www.network54.com/Realm/_garden/") ) window.open(selectedtext); else window.open('http://www.network54.com/Realm/_garden/' + selectedtext);}
viewrealm.htm:
----------------------------
<script language="JavaScript" defer>
if (external.menuArguments){
var selectedtext=external.menuArguments.document.selection.createRange().text; if(selectedtext){
if(selectedtext.match("http://www.network54.com/Realm/n54_files/") ) window.open(selectedtext);

else window.open('http://www.network54.com/Realm/n54_files/'
+ selectedtext);}
else external.menuArguments.alert("No text has been selected")}
</script>


viewrealm.reg
-------------------------
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\ViewRealm]
@="file://C:\\windows\\web\\viewrealm.html"
"contexts"=dword:00000011
Top

Browser Source

Add Browser Source to your context menu: View the source code after the browser has rendered it, an example to view the web pages source code and the browsers rendered source code can be seen here at the bottom of the page.
browsersrc.htm:
----------------------------
<SCRIPT LANGUAGE="JavaScript" defer>

var viewWin; var docSource;
docSource = external.menuArguments.document.all.tags("HTML")[0].outerHTML
viewWin=window.open("","sourceWin","width=800,height=600
,scrollbars=yes,resizable=yes");
viewWin.document.write("<html><basefont size=2 family=Verda
na><title>Browser Source</title><body></body></html>");

viewWin.document.close();
viewWin.document.body.innerText = docSource;
</SCRIPT>


browsersrc.reg
-------------------------
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Show &Browser Source]
@="file://c:\\windows\\Web\\browsersrc.htm"

"Contexts"=dword:00000001
Top

Mark Text

Add Mark Text to your context menu: Is similar to the "Find" prompt on the edit menu except "Mark Text" does not search the 1st found then goes to what it found but search's the whole page and highlights all references it finds at once, which I find comes in handy on big pages.

marktext.htm:
---------------------------
<SCRIPT>
var parentWin = external.menuArguments;
var parentDoc = parentWin.document;
var searchText = parentWin.prompt("Text to mark:","");
if (searchText != null && searchText != ''){
var searchRange = parentDoc.body.createTextRange();

for (i=0; searchRange.findText(searchText)!=false; i++){
searchRange.pasteHTML("<span style='background:#66FF66;'>"
+
searchRange.text + "</span>");
}
parentWin.alert(i + " items marked.");}
else{alert("Nothing to mark!");}

</SCRIPT>

marktext.reg:
---------------------------
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Mark Te&xt]
@="file://c:\\windows\\web\\marktext.htm"
"Contexts"=dword:00000001
Top

Google Search

Add Google to your context menu: By highlighting text on a page and selecting Google will open a new window to google searching the highlighted text, and if you select Google without highlighting any text the a prompt will display asking for your search term.

google.html:
-------------------------
<script language="javascript" defer>

var parentWin = external.menuArguments;
var parentDoc = parentWin.document;
var select = parentDoc.selection;
var selectedtext = select.createRange().text;
if(selectedtext){open("http://www.google.com/search?q="
+escape(selectedtext)+"&num=50")}
else{
void(q=parentWin.prompt('Enter text to search using Google.
You can also highlight a word on this web page before clicking Google.',''));

if(q)open('http://www.google.com/search?q='+escape(q)+'&num=50')
}
</script>

google.reg:
-------------------------
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Google]
@="file://C:\\windows\\web\\google.html"
"contexts"=dword:00000011
Top

View Link Source

Add View Link Source to your context menu: View the source code of web pages without going to the site by right clicking on hyperlinks and hyperlinked images or highlighting URL's which are in plain text.

linksource.html:
-----------------------------
<script language="javascript" defer>
if (external.menuArguments){
var selectedtext = external.menuArguments.document.selection.createRange().text;
if(selectedtext){
if(selectedtext.match("http://") ) window.open('view-source:' + selectedtext);

else window.open('view-source:http://' + selectedtext); }
else{
var clickelement = external.menuArguments.event.srcElement;
if ( clickelement.tagName == 'IMG' )
window.open('view-source:' + clickelement.parentElement.href);
else window.open('view-source:' + clickelement.href); }}

</script>

linksource.reg:
-----------------------------
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\View Link Source]
@="C:\\windows\\web\\linksource.html"
"contexts"=dword:00000032
Top

Safe Frame

Add Safe Frame to your context menu: When you select "Safe Frame" on a hyperlink, it will open the hyperlink in a new window inside an iframe which has its security set to restricted, (using your settings in the Internet Explorer's Restricted Sites Zone). An example of a Safe Viewer using your IE's Restricted Sites Zone.
This allows me to view sites I deem unsafe.

safeframe.htm:
-----------------------------
<SCRIPT LANGUAGE="JavaScript" defer> 

var safeWin, suspectLink;
suspectLink = external.menuArguments.event.srcElement.href safeWin=window.open("","safeWin","width=800,height=600,scrollbars=no,res izable=yes,status=yes");
safeWin.document.write("<html><title>Safe Browse</title><body bgco lor=red topmargin=5 rightmargin=5 bottommargin=5 leftmargin=5 border=0>");

safeWin.document.write("<iframe id=i1 name=i1 security='restricted' style='wid th:100%; height:100%;'></iframe>");
safeWin.document.write("</body></html>");

safeWin.document.close();
if (suspectLink.indexOf("@") > 0){safeWin.window.alert("Thi s is a mailto link! " + suspectLink); safeWin.close();}
else{safeWin.document.all.i1.src = suspectLink;}
</SCRIPT>

safeframe.reg:
-----------------------
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Safe Frame]
@="file://c:\\windows\\web\\safeframe.htm"
"Contexts"=dword:00000020 
Top

Links List

This one display's all the links on the page beeing viewed in a popup window.
urllist.htm:
---------------------------
<script language=javascript defer>
var dlProgress=window.open("", "_blank", "scrollbars=yes, resizable=yes, status=yes, width=400, height=600");
dlProgress.document.open();
dlProgress.document.write ("<html><head><title>Links list</title></head><body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0>");
dlProgress.document.write ("<font style=\"font:8pt Verdana, Arial, Helvetica, Sans-serif; line-height:12pt;\">");
dlProgress.document.write ("<script language=javascript>function navigateClose(str){if (document.my_parent != null){document.my_parent.location.href=str;window.close();}else{alert(\"Please wait until the list has populated.\");}}<\/script>");
dlProgress.document.write ("&nbsp;List of all links in <b>" + external.menuArguments.document.title + "</b>:<ol>");
var links = external.menuArguments.document.links;
for (i = 0; i < links.length; i++){
if ( links(i).innerText != "" && links(i).innerText != " "){
dlProgress.document.write ("<li><A HREF='javascript:navigateClose(\"" + links(i).href + "\")' TITLE=" + links(i).href + ">" + links(i).innerText + "</a><BR>");}
else{dlProgress.document.write("<li><A HREF='javascript:navigateClose(\"" + links(i).href + "\")'>" + links(i).href + "</a><BR>");}
}
dlProgress.document.write ("</ol><center><a href='javascript:window.close()' style=\"color:#FF0000;text-decoration:none\">close</a></center><BR></body>");
dlProgress.document.write ("</font></html>");
dlProgress.document.close();
dlProgress.document.my_parent = external.menuArguments;
</script>


urllist.reg:
--------------------------
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\&Links List]
@="file://c:\\windows\\web\\urllist.htm"
"Contexts"=dword:00000001
Top

Text2Url

Because of boards such as the Nw54 Support board have HTML disabled and URL's and hyperlinks are not rendered to html I wrote this context menu option to make it easy to view them by highlighting the text, selecting "Text2Url" on the context menu.
Create 2 files named "viewurl.html" and "viewurl.reg" Copy and paste the 1st code to viewurl.html and the 2nd code to viewurl.reg and save them to your windows\web folder. Double click on "viewurl.reg" or select "Merge" to import into the registry. Next time IE is opened the new selection should appear on the context menu .
If you save the files to another location remember to change the location in the viewurl.reg file
note
When selecting text, the selection does not have to include http://

viewurl.html code:
--------------------------------
<script language="javascript" defer>
if (external.menuArguments){
var selectedtext=external.menuArguments.document.selection.createRange().text;
if(selectedtext){
if(selectedtext.match("http://") ) window.open(selectedtext);
else window.open('http://' + selectedtext);}
else external.menuArguments.alert("No text has been selected")}

</script>

viewurl.reg code:
-------------------------------
REGEDIT4   
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Text2Url]
@="C:\\windows\\web\\viewurl.html"
"contexts"=dword:00000011

    1/2004 © Ed Home/BilgeRat