Google application
Posted by: baysao
Date: May 11, 2008 06:31AM

In Firefox, there is sidebar that could use to display useful information. I was hearing in there, people using Google applications(Google Notebook,Gtalk,GReader,GMail,GDocument,GCalendar...) which has built for mobile application to display in sidebar. In K-Meleon, in this moment sidebar isn't, i think about using javascripts to popup small windows to view page contents. That is very similar sidebar in firefox. Very usefuls.
Here is my macro GApplication.kmm . Hoping useful for you guys.
Use: To use this macro, you have to turn off function Popup blocker or add exceptions rule to popup except www.google.com address.

Quote


# Macro name : GApplication.kmm
# author: ThanhVu(baysao@gmail.com)
# Macros make google application more usefuls. To use this macro, you have to disable function Automatic block popup in kmeleon.

GNote{
injectJS("NFW=window.open(\"http://www.google.com/notebook/ig?hl=__MSG_locale__\",\"popFrameless\",\"scrollbars,width=214,height=398\");NFW.blur();NFW.resizeTo(214,398);NFW.moveTo(260,100);window.focus();NFW.focus()");
}
GCalEvent{
injectJS("NFW=window.open(\"http://www.google.com/calendar/m\",\"popFrameless\",\"scrollbars,width=214,height=398\");NFW.blur();NFW.resizeTo(214,398);NFW.moveTo(260,100);window.focus();NFW.focus()");
}
GCal{
injectJS("NFW=window.open(\"http://www.google.com/calendar/gadget?up_showAgenda=false&upt_showAgenda=hidden&up_calendarFeeds=(%7B%7D)&upt_calendarFeeds=hidden&up_firstDay=0&upt_firstDay=enum&up_dateFormat=0&upt_dateFormat=enum&up_timeFormat=1:00pm&upt_timeFormat=enum&up_calendarFeedsImported=0&upt_calendarFeedsImported=hidden&up_showCalendar2=1&upt_showCalendar2=bool&lang=en&country=us&.lang=en&.country=us&synd=ig&mid=0&parent=&libs=9yKJTwdwCZw/lib/libcore.js,DXEULJSfpLM/lib/libdynamic-height.js,c64nWSZKWFg/lib/libsetprefs.js\",\"popFrameless\",\"scrollbars,width=214,height=398\");NFW.blur();NFW.resizeTo(214,398);NFW.moveTo(260,100);window.focus();NFW.focus()");
}

GTalk{
injectJS("NFW=window.open(\"http://talkgadget.google.com/talkgadget/client\",\"popFrameless\",\"scrollbars,width=214,height=398\");NFW.blur();NFW.resizeTo(214,398);NFW.moveTo(260,100);window.focus();NFW.focus()");
}
GMail{
injectJS("NFW=window.open(\"http://m.gmail.com\",\"popFrameless\",\"scrollbars,width=214,height=398\");NFW.blur();NFW.resizeTo(214,398);NFW.moveTo(260,100);window.focus();NFW.focus()");
}
GDocs{
injectJS("NFW=window.open(\"http://docs.google.com/m\",\"popFrameless\",\"scrollbars,width=214,height=398\");NFW.blur();NFW.resizeTo(214,398);NFW.moveTo(260,100);window.focus();NFW.focus()");
}
GReader{
injectJS("NFW=window.open(\"http://www.google.com/reader/m/view\",\"popFrameless\",\"scrollbars,width=214,height=398\");NFW.blur();NFW.resizeTo(214,398);NFW.moveTo(260,100);window.focus();NFW.focus()");
}

# ----- PRIVATE
$Gpopup_menu="Google &Application";
_GPopup_BuildMenu{
setmenu($Gpopup_menu,macro,"Google &Notebook",GNote);
setmenu($Gpopup_menu,macro,"Google Calendar &QuickEvent",GCalEvent);
setmenu($Gpopup_menu,macro,"Google &Calendar",GCal);
setmenu($Gpopup_menu,macro,"Google &Talk",GTalk);
setmenu($Gpopup_menu,macro,"Google &Mail",GMail);
setmenu($Gpopup_menu,macro,"Google &Document",GDocs);
setmenu($Gpopup_menu,macro,"Google &Reader",GReader);
setmenu(DocumentSave,popup,$Gpopup_menu);
}
_GPopup_BuildAccel{
setaccel("CTRL ALT N","macros(GNote)");
setaccel("CTRL ALT Q","macros(GCalEvent)");
setaccel("CTRL ALT C","macros(GCal)");
setaccel("CTRL ALT T","macros(GTalk)");
setaccel("CTRL ALT M","macros(GMail)");
setaccel("CTRL ALT D","macros(GDocs)");
setaccel("CTRL ALT R","macros(GReader)");
}
$OnInit=$OnInit."_GPopup_BuildMenu;_GPopup_BuildAccel;";

# ------------------------------------------------------------------------------------------------------------------
$macroModules=$macroModules."GApplication;";


Or view in GoogleDocs



Edited 4 time(s). Last edit at 05/12/2008 09:08PM by baysao.

Google blogger
Posted by: baysao
Date: May 11, 2008 05:16PM

I include macro to quick open new tab for blogging with Blogger
Hoping it usefuls.

Quote

# Macro name: blogger.kmm
# Author: Thanh Vu(baysao@gmail.com)
# Macro help quick open new post in blogger
# Macro depend macro Gapplication.kmm

$_blogger_conf="kmeleon.general.bloggerID";
Blogger{
$__userid=getpref(STRING, $_blogger_conf);
$__userid=="" ? &Blogger_set : "";
$__userid=="" ? "" : &Blogger_run;
}

Blogger_run{
$OpenURL="http://www.blogger.com/post-create.g?blogID=".$__userid;
&OpenURL_InNew;
}

Blogger_set{
$__userid=prompt("Set your blog ID: ", "Blogger setup");
$__userid=="" ? "" : setpref(STRING, $_blogger_conf, $__userid);
}

_Blogger_BuildMenu{
setmenu($Gpopup_menu,macro,"Set &ID Blogger",Blogger_set);
setmenu($Gpopup_menu,macro,"Google &Blogger",Blogger);
}

_Blogger_BuildAccel{
setaccel("CTRL ALT B","macros(Blogger)");
}
$OnInit=$OnInit."_Blogger_BuildMenu;_Blogger_BuildAccel;";

# ------------------------------------------------------------------------------------------------------------------
$macroModules=$macroModules."blogger;";


Re: Google application
Posted by: desga2
Date: May 11, 2008 08:45PM

Both codes added to MacroLibrary.

Thanks to shared code.

K-Meleon in Spanish

Re: Google application
Posted by: baysao
Date: May 11, 2008 09:46PM

I add blogger.kmm to GApplication.kmm and adding macro to support Google Translate. You can translate selected text or page with Google Translate to any language that Google is supported. There are small changes in javascript popup: make new post with Blogger now will popup in windows insteads open new tab. Please update in MacroLibrary.
Quote

# Macro name : GApplication.kmm
# author: ThanhVu(baysao a cong gmail dot com)
# Macros make google application more usefuls. To use this macro, you have to disable function Automatic block popup in kmeleon.

GNote{
injectJS("window.open(\"http://www.google.com/notebook/ig?hl=__MSG_locale__\",\"popFrameless\",\"scrollbars,width=214,height=398\");");
}
GCalEvent{
injectJS("window.open(\"http://www.google.com/calendar/m\",\"popFrameless\",\"scrollbars,width=214,height=398\");");
}
GCal{
injectJS("window.open(\"http://www.google.com/calendar/gadget?up_showAgenda=false&upt_showAgenda=hidden&up_calendarFeeds=(%7B%7D)&upt_calendarFeeds=hidden&up_firstDay=0&upt_firstDay=enum&up_dateFormat=0&upt_dateFormat=enum&up_timeFormat=1:00pm&upt_timeFormat=enum&up_calendarFeedsImported=0&upt_calendarFeedsImported=hidden&up_showCalendar2=1&upt_showCalendar2=bool&lang=en&country=us&.lang=en&.country=us&synd=ig&mid=0&parent=&libs=9yKJTwdwCZw/lib/libcore.js,DXEULJSfpLM/lib/libdynamic-height.js,c64nWSZKWFg/lib/libsetprefs.js\",\"popFrameless\",\"scrollbars,width=214,height=398\");");
}

GTalk{
injectJS("window.open(\"http://talkgadget.google.com/talkgadget/client\",\"popFrameless\",\"scrollbars,width=214,height=398\");");
}
GMail{
injectJS("window.open(\"http://m.gmail.com\",\"popFrameless\",\"scrollbars,width=214,height=398\");");
}
GDocs{
injectJS("window.open(\"http://docs.google.com/m\",\"popFrameless\",\"scrollbars,width=214,height=398\");");
}
GReader{
injectJS("window.open(\"http://www.google.com/reader/m/view\",\"popFrameless\",\"scrollbars,width=214,height=398\");");
}
$_blogger_conf="kmeleon.general.bloggerID";
Blogger{
$__userid=getpref(STRING, $_blogger_conf);
$__userid=="" ? &Blogger_set : "";
$__userid=="" ? "" : &Blogger_run;
}

Blogger_run{
$OpenURL="http://www.blogger.com/post-create.g?blogID=".$__userid;
$link="window.open('";
$link=$link.$OpenURL;
$link=$link."','popFrameless','scrollbars,width=750,height=398')";
injectJS($link);
}

Blogger_set{
$__userid=prompt("Set your blog ID: ", "Blogger setup");
$__userid=="" ? "" : setpref(STRING, $_blogger_conf, $__userid);
}


GTranslate_ru{
$lang="ru";&GTranslate;
}
GTranslate_en{
$lang="en";&GTranslate;
}
GTranslate_fr{
$lang="fr";&GTranslate;
}
GTranslate_es{
$lang="es";&GTranslate;
}
GTranslate_pt{
$lang="pt";&GTranslate;
}
GTranslate_de{
$lang="de";&GTranslate;
}
GTranslate_nl{
$lang="nl";&GTranslate;
}
GTranslate_it{
$lang="it";&GTranslate;
}
GTranslate_el{
$lang="el";&GTranslate;
}
GTranslate_ko{
$lang="ko";&GTranslate;
}
GTranslate_ja{
$lang="ja";&GTranslate;
}
GTranslate_zh{
$lang="zh";&GTranslate;
}
GTranslate_zt{
$lang="zt";&GTranslate;
}

GTranslate_other{
$lang=prompt("Two-letter target language code:","Language code","vi");&GTranslate;
}
GTranslate{
$lang="&langpair=auto|".$lang;
$link="var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=''){window.open('http://translate.google.com/translate_t?text='+t+'&hl=en";
$link=$link.$lang;
$link=$link."&tbb=1&ie='+e,'popFrameless','scrollbars,width=750,height=398');}else{window.open('http://translate.google.com/translate?u='+escape(location.href)+'&hl=en";
$link=$link.$lang;
$link=$link."&tbb=1&ie='+e,'popFrameless','scrollbars,width=750,height=398');};";
injectJS($link);
}

# ----- PRIVATE
$Gpopup_menu="Google &Application";
$g_selection="Google &Translate";
$g_selection_link="Google &Translate";
_GPopup_BuildMenu{
setmenu($Gpopup_menu,macro,"Google &Notebook",GNote);
setmenu($Gpopup_menu,macro,"Google Calendar &QuickEvent",GCalEvent);
setmenu($Gpopup_menu,macro,"Google &Calendar",GCal);
setmenu($Gpopup_menu,macro,"Google &Talk",GTalk);
setmenu($Gpopup_menu,macro,"Google &Mail",GMail);
setmenu($Gpopup_menu,macro,"Google &Document",GDocs);
setmenu($Gpopup_menu,macro,"Google &Reader",GReader);
setmenu($Gpopup_menu,macro,"Set &ID Blogger",Blogger_set);
setmenu($Gpopup_menu,macro,"Google &Blogger",Blogger);

## google translate
setmenu($g_selection,macro,"to &English", GTranslate_en);
setmenu($g_selection,macro,"to &French", GTranslate_fr);
setmenu($g_selection,macro,"to &Russian", GTranslate_ru);
setmenu($g_selection,macro,"to &Spanish", GTranslate_es);
setmenu($g_selection,macro,"to &Portuguese", GTranslate_pt);
setmenu($g_selection,macro,"to &German", GTranslate_de);
setmenu($g_selection,macro,"to &Dutch", GTranslate_nl);
setmenu($g_selection,macro,"to &Italian", GTranslate_it);
setmenu($g_selection,macro,"to Gr&eek", GTranslate_el);
setmenu($g_selection,macro,"to &Korean", GTranslate_ko);
setmenu($g_selection,macro,"to &Japanese", GTranslate_ja);
setmenu($g_selection,macro,"to &Chinese (Traditional)", GTranslate_zt);
setmenu($g_selection,macro,"to Chi&nese (Simplified)", GTranslate_zh);
setmenu($g_selection,macro,"&To (Specify Language)...",GTranslate_other);
## end google translate

setmenu($Gpopup_menu,popup,$g_selection);
setmenu(Selection,popup,$g_selection);
setmenu(LinkSave,popup,$g_selection);
setmenu(Document,popup,$Gpopup_menu);
}
_GPopup_BuildAccel{
setaccel("CTRL ALT N","macros(GNote)");
setaccel("CTRL ALT Q","macros(GCalEvent)");
setaccel("CTRL ALT C","macros(GCal)");
setaccel("CTRL ALT T","macros(GTalk)");
setaccel("CTRL ALT M","macros(GMail)");
setaccel("CTRL ALT D","macros(GDocs)");
setaccel("CTRL ALT R","macros(GReader)");
setaccel("CTRL ALT B","macros(Blogger)");
}
$OnInit=$OnInit."_GPopup_BuildMenu;_GPopup_BuildAccel;";

# ------------------------------------------------------------------------------------------------------------------
$macroModules=$macroModules."GApplication;";

or view in Google docs



Edited 1 time(s). Last edit at 05/11/2008 09:48PM by baysao.

Re: Google application
Posted by: desga2
Date: May 11, 2008 11:48PM

I updated MacroLibrary, but you must remmember that you can do it. MacroLibrary is a Wiki page online editable. You only need a registred user that is same user and password to login in this Forum.

Please spend a little of your time in learn how to edit a Wiki page and add your codes to MacroLibrary by your self.

Thanks.

K-Meleon in Spanish

Re: Google application
Posted by: baysao
Date: May 12, 2008 12:04AM

Thanks desga2.

K-Meleon forum is powered by Phorum.