View Source as Popup Windows
Posted by: George Hall
Date: December 29, 2013 07:44AM

Viewing Source would work better as a popup windows becuase we would able to Scroll Bars to thorughly read the whole pages source.

The perfect example of this the K-Meleon Extesnion "Tab All Windows"
When select view source it is launched in the same window of the web page as a new tab.

Its easier to read the souitce code that way. We can scroll up, down, left, and right when the source code is in a new tab.

We can also scrol to part pf the source code copy selected text. Which can not be done with view source without extension "Tab All Windows"

Re: View Source as Popup Windows
Posted by: rodocop
Date: December 29, 2013 07:07PM

I cannot recommend this extension. I've tried this and it was very inconvenient to use setup windows like tabs.

Re: View Source as Popup Windows
Posted by: George Hall
Date: December 29, 2013 09:10PM

I did not say we had to use "Tab All Windows" Extension.

I suggessted treat view source code as a popup window. A popup window can use the scroll bars to move up, down, left, and right.


A popup window can scroll with cursor keys. Also a popup window can coppy and paste text.

All this posible if the scroll bars are enbaled on view source.

Re: View Source as Popup Windows
Posted by: rodocop
Date: December 29, 2013 09:15PM

Hmmm...

I see the source code in all-scrolling window already.
Moreover I can set the preferred text editor to open source code in. Enough for me.

What do you suggest more?

Re: View Source as Popup Windows
Posted by: siria
Date: December 29, 2013 10:27PM

+1
Ah, source code... Frankly it's bugging myself too and wished a couple times it would open in a normal tab instead that naked window without any buttons, toolbars, and no menus. Can't quite remember now what for, but had really missed it sometimes. And guess it had somehow worked already as a tab in an older KM version, but not sure anymore.

But like rodocop I can't quite understand the question:
Quote
George Hall
Viewing Source would work better as a popup windows becuase we would able to Scroll Bars to thorughly read the whole pages source.

It DOES work like that, as it should. There are scrollbars, text can be highlighted and copied, keyboard shortcuts work fine, in KM1.6b2.5
Instead of scrollbars I'm only missing the toolbars, menus and buttons.
There must be something wrong if you don't have scrollbars, perhaps an old version or some bug?

Couldn't resist now and make a tiny extract of taballwindows, just for source code nothing else. Seems to work, nice little macro now, finally source in a normal tab smiling smiley Still hope that some day there will be a native option in the prefs, just like the ones desga added awhile ago for page properties (F2>Browsing>WindowDiversion)

Re: View Source as Popup Windows
Posted by: George Hall
Date: December 29, 2013 11:52PM

I did not remember that soutce code had the scroll bars because i did use a voew source code as window in a long time.

I just thought it worked better with all the menu and status bar. It is easier to read when it is launched in a browser tab.

If it worked the same ways as in the tab bar it would be a improvement.

I used "Tab All Windows" extension to view source code and I liked it better as browser tab just it would look when we goto web page in a browser tab or window.

Re: View Source as Popup Windows
Posted by: siria
Date: December 30, 2013 12:21AM

So just like me, you prefer it in a normal tab. But I understand that others may prefer it without toolbars, just to see more code.

Meanwhile remembered what I didn't like: The popup window is too small, not maximized, grmpf. Anyone remember how, somewhere sometime, long ago it could open maximized? Is there still a way, or again? And the popup window has no search buttons. Yes the search bar does appear after using the shortcut Ctrl+F, if a user knows. And sometimes I want to wrap or unwrap the lines, have a function for it in the View menu, but couldn't access the menu. Except if first looking for its shortcut. Could also become a bit bothersome on a netbook with those ultralow screens and hidden system bars, since the new window has no tabs for easy switching back and forth. Perhaps there were also other missed functions occasionally. Nothing dramatic of course ;-)

Re: View Source as Popup Windows
Posted by: naruman offline
Date: December 30, 2013 08:31AM

I was have macro to open source code for pages & links in tabs long time age:


$SourcePort = "view-source:";

#------------------------------

Page_source{
$ViwePage = $SourcePort.$URL;
opentab($ViwePage);
}

Link_source{
$ViwePage = $SourcePort.$LinkURL;
opentab($ViwePage);
}


# ----- PRIVATE ----------------------------------------------------

_SourceViwe_BuildMenu{
setaccel("CTRL 1","macros(Page_source)");
setmenu(Document,macro,"Viwe Source",Page_source,-1);
setmenu(LinkOpenExternal,macro,"Viwe Source",Link_source,-1);
}

#--------

$OnInit=$OnInit."_SourceViwe_BuildMenu;";


Add 'boolean' pref to about:config [km 1.6]:

view_source.wrap_long_lines set to true

ِِAlso you can use bookmak :

javascript:location="view-source:"+location

Re: View Source as Popup Windows
Posted by: rodocop
Date: December 30, 2013 11:55AM

siria,

I solve this problem by defining my preferred text editor for source code view.

It makes possible both window maximizing and word wrap when needed.

Re: View Source as Popup Windows
Posted by: Mala Okeh
Date: December 30, 2013 01:24PM

Very fine macro, naruman, thank you.
One further question : is the bookmark mentioned to open the view source in a tab complete? It doesn't do anything when I use it. Does one have to fill in a location?

thx

Mala

Re: View Source as Popup Windows
Posted by: naruman offline
Date: December 31, 2013 08:48AM

Quote
Mala Okeh

One further question : is the bookmark mentioned to open the view source in a tab complete? It doesn't do anything when I use it. Does one have to fill in a location?

It's complete & you don't need to fill in a location.

you only need to enable jave script [F7] & make sure that Bookmarks open in current tab [ preferences (F2) \Netscape Bookmarks\general].

Also you can paste it in URL bar & click enter [ with jave script enable].

Re: View Source as Popup Windows
Posted by: George Hall
Date: December 31, 2013 02:49PM

Quote
naruman offline
I was have macro to open source code for pages & links in tabs long time age:


$SourcePort = "view-source:";

#------------------------------

Page_source{
$ViwePage = $SourcePort.$URL;
opentab($ViwePage);
}

Link_source{
$ViwePage = $SourcePort.$LinkURL;
opentab($ViwePage);
}


# ----- PRIVATE ----------------------------------------------------

_SourceViwe_BuildMenu{
setaccel("CTRL 1","macros(Page_source)");
setmenu(Document,macro,"Viwe Source",Page_source,-1);
setmenu(LinkOpenExternal,macro,"Viwe Source",Link_source,-1);
}

#--------

$OnInit=$OnInit."_SourceViwe_BuildMenu;";


Add 'boolean' pref to about:config [km 1.6]:

view_source.wrap_long_lines set to true

ِِAlso you can use bookmak :

javascript:location="view-source:"+location

If someone wants top open in a new windows.

I modified the macro to open a new windows instead of a new tab

The following macro does it.

SourcePort = "view-source:";

#------------------------------

Page_source{
$ViwePage = $SourcePort.$URL;
opennew($ViwePage);
}

Link_source{
$ViwePage = $SourcePort.$LinkURL;
opennew($ViwePage);
}


# ----- PRIVATE ----------------------------------------------------

_SourceViwe_BuildMenu{
setaccel("CTRL 1","macros(Page_source)");
setmenu(Document,macro,"Viwe Source",Page_source,-1);
setmenu(LinkOpenExternal,macro,"Viwe Source",Link_source,-1);
}

#--------

$OnInit=$OnInit."_SourceViwe_BuildMenu;";

With both separate macros you can choose to open new tab or a new window by selecting one of them and leaving the other unchecked.

by sle

Re: View Source as Popup Windows
Posted by: siria
Date: December 31, 2013 06:22PM

Cool, I had no idea there is actually a KM pref for source code line wrapping, and a possibility to open links as source code, thanx naruman!
Will add those menu options to my own flavor of macro too and when finally finished publish it, but knowing you guys someone will probably be faster than me snail ;-)

Re: View Source as Popup Windows
Posted by: George Hall
Date: December 31, 2013 09:54PM

View is spelled wrong as Viwe in both macros. The macros should be the following with spelling corrections:


For viewing Source in a new tab:

$SourcePort = "view-source:";

#------------------------------

Page_source{
$ViewPage = $SourcePort.$URL;
opentab($ViewPage);
}

Link_source{
$ViewPage = $SourcePort.$LinkURL;
opentab($ViewPage);
}


# ----- PRIVATE ----------------------------------------------------

_SourceView_BuildMenu{
setaccel("CTRL 1","macros(Page_source)");
setmenu(Document,macro,"View Source",Page_source,-1);
setmenu(LinkOpenExternal,macro,"View Source",Link_source,-1);
}

#--------

$OnInit=$OnInit."_SourceView_BuildMenu;";

For viewing source n a new window:

$SourcePort = "view-source:";

#------------------------------

Page_source{
$ViewPage = $SourcePort.$URL;
opennew($ViewPage);
}

Link_source{
$ViewPage = $SourcePort.$LinkURL;
opennew($ViewPage);
}


# ----- PRIVATE ----------------------------------------------------

_SourceView_BuildMenu{
setaccel("CTRL 1","macros(Page_source)");
setmenu(Document,macro,"View Source",Page_source,-1);
setmenu(LinkOpenExternal,macro,"View Source",Link_source,-1);
}

#--------

$OnInit=$OnInit."_SourceView_BuildMenu;";


Thanks for your work of naruman offline on his open source in a new tab macro.

Re: View Source as Popup Windows
Posted by: Geroge Hall
Date: January 04, 2014 08:54AM

I created to macros based on TabAllWindows one opens "Source Code" in a tab while the other open "Source Code" in a window

They are:

ViewSourceTab.kmm

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# --ViewSourceTab based on TabAllWindows v1.0- by jsnj -------------------------------------------------
#
# --by George Hall
# ------------------------------------------------------------------------------------------------------

ViewPageSource{
$_SourceExt=getpref(BOOL,"kmeleon.general.sourceEnabled");
$_SourceExt ? id(ID_VIEW_SOURCE)yawning smileypentab("view-source:".$URL);
}

ViewFrameSource{
$_SourceExt=getpref(BOOL,"kmeleon.general.sourceEnabled");
$_SourceExt ? id(ID_VIEW_FRAME_SOURCE)yawning smileypentab("view-source:".$FrameURL);
}

_ViewSource_BuildMenu{
setaccel("CTRL U","macros(ViewPageSource)");
setmenu("Page &Properties",command,"",ID_VIEW_SOURCE);
setmenu("Page Pro&perties",command,"",ID_VIEW_SOURCE);
setmenu("Page &Properties",macro,"So&urce Code",ViewPageSource);
setmenu("Page Pro&perties",macro,"So&urce Code",ViewPageSource);

setmenu("Frame &Properties",command,"",ID_VIEW_FRAME_SOURCE);
setmenu("Frame &Properties",macro,"So&urce Code",ViewFrameSource);
}

$OnSetup=$OnSetup."_ViewSource_BuildMenu;"
# ------------------------------------------------------------------------------------------------------------------

ViewSourceWindow.kmm

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# --ViewSourceWindow based on TabAllWindows v1.0- by jsnj ----------------------------------------------
#
# --by George Hall
# ------------------------------------------------------------------------------------------------------

ViewPageSource{
$_SourceExt=getpref(BOOL,"kmeleon.general.sourceEnabled");
$_SourceExt ? id(ID_VIEW_SOURCE)yawning smileypennew("view-source:".$URL);
}

ViewFrameSource{
$_SourceExt=getpref(BOOL,"kmeleon.general.sourceEnabled");
$_SourceExt ? id(ID_VIEW_FRAME_SOURCE)yawning smileypennew("view-source:".$FrameURL);
}

_ViewSource_BuildMenu{
setaccel("CTRL U","macros(ViewPageSource)");
setmenu("Page &Properties",command,"",ID_VIEW_SOURCE);
setmenu("Page Pro&perties",command,"",ID_VIEW_SOURCE);
setmenu("Page &Properties",macro,"So&urce Code",ViewPageSource);
setmenu("Page Pro&perties",macro,"So&urce Code",ViewPageSource);

setmenu("Frame &Properties",command,"",ID_VIEW_FRAME_SOURCE);
setmenu("Frame &Properties",macro,"So&urce Code",ViewFrameSource);
}

$OnSetup=$OnSetup."_ViewSource_BuildMenu;"
# ------------------------------------------------------------------------------------------------------------------

K-Meleon forum is powered by Phorum.