Archive

Archive for December, 2007

mirc.php for GeSHi

December 12th, 2007 1 comment

Seems there were a minor issue with the mirc.php file from GeSHi causing all code entries set to be parsed as mIRC scripts to stop with an error. Fixed (or rather made a dirty hack) it so my mIRC scripts once again could be highlighted :)

<?php
/*************************************************************************************
* mirc.php
* -----
* Author: Alberto 'Birckin' de Areba (Birckin@hotmail.com)
* Copyright: (c) 2006 Alberto de Areba
* Release Version: 1.0.7.20
* Date Started: 2006/05/29
*
* mIRC Scripting language file for GeSHi.
*
* CHANGES
* -------
* 2006/05/29 (1.0.0)
*   -  First Release
*
* 2007/12/12 (1.0.1) - Brian Schmidt Pedersen
*   -  Removed the forward slash from all mIRC keywords, since in actual
*       mIRC scripts, they're often written without the slash.
*   -  Entry 6 (timer parsing) under REGEXPS caused GeSHi to halt with an error
*       simple solution was to remove the slash(es)
*
*************************************************************************************
*
*     This file is part of GeSHi.
*
*   GeSHi is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
*   GeSHi is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*   GNU General Public License for more details.
*
*   You should have received a copy of the GNU General Public License
*   along with GeSHi; if not, write to the Free Software
*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
************************************************************************************/


$language_data = array (
    'LANG_NAME' => 'mIRC Scripting',
    'COMMENT_SINGLE' => array(
        1 => ';'
    ),
    'COMMENT_MULTI' => array(),
    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
    'QUOTEMARKS' => array(),
    'ESCAPE_CHAR' => '',
    'KEYWORDS' => array(
        1 => array(
            'alias', 'menu', 'dialog'
        ),
        2 => array(
            'if', 'elseif', 'else', 'while', 'return', 'goto'
        ),
        3 => array(
            'action', 'ajinvite', 'alias', 'aline', 'amsg', 'ame', 'anick',
            'aop','auser', 'avoice', 'auto', 'autojoin', 'away', 'background',
            'ban', 'beep', 'channel', 'clear', 'clearall', 'clipboard',
            'close', 'closemsg', 'color', 'copy', 'creq', 'ctcp', 'ctcpreply',
            'ctcps', 'dcc', 'dde', 'ddeserver', 'debug', 'describe', 'disable',
            'disconnect', 'dlevel', 'dll', 'dns', 'dqwindow', 'ebeeps', 'echo',
            'editbox', 'emailaddr', 'enable', 'events', 'exit', 'filter',
            'findtext', 'finger', 'flash', 'flood', 'flush', 'flushini',
            'font', 'fsend', 'fserve', 'fullname', 'ghide', 'gload', 'gmove',
            'gopts', 'gplay', 'gpoint', 'gqreq', 'groups', 'gshow', 'gsize',
            'gstop', 'gtalk', 'gunload', 'guser', 'halt', 'haltdef', 'help',
            'hop', 'ignore', 'inc', 'invite', 'join', 'kick', 'linesep',
            'links', 'list', 'load', 'loadbuf', 'localinfo', 'log', 'me',
            'mdi', 'mkdir', 'mnick', 'mode', 'msg', 'names', 'nick', 'noop',
            'notice', 'notify', 'omsg', 'onotice', 'part', 'partall', 'pdcc',
            'perform', 'ping', 'play', 'pop', 'protect', 'pvoice', 'qmsg',
            'qme', 'query', 'queryrn', 'quit', 'raw', 'remini', 'remote',
            'remove', 'rename', 'renwin', 'resetidle', 'rlevel', 'rmdir',
            'run', 'ruser', 'save', 'savebuf', 'save', 'saveini', 'say',
            'server', 'set', 'showmirc', 'sline', 'sound', 'speak', 'splay',
            'sreq', 'strip', 'time', 'timers', 'timestamp', 'titlebar',
            'tnick', 'tokenize', 'topic', 'ulist', 'unload', 'updatenl', 'url',
            'uwho', 'var', 'window', 'winhelp', 'write', 'writeini', 'who',
            'whois', 'whowas'
        )
    ),
    'SYMBOLS' => array(
        '(', ')', '{', '}', '[', ']', '|'
    ),
    'CASE_SENSITIVE' => array(
        GESHI_COMMENTS => true,
        1 => false,
        2 => false
    ),
    'STYLES' => array(
        'KEYWORDS' => array(
            1 => 'color: #994444;',
            2 => 'color: #000000; font-weight: bold;',
            3 => 'color: #990000; font-weight: bold;'
        ),
        'COMMENTS' => array(
            1 => 'color: #808080; font-style: italic;'
        ),
        'ESCAPE_CHAR' => array(),
        'BRACKETS' => array(
            0 => 'color: #FF0000;'
        ),
        'STRINGS' => array(),
        'NUMBERS' => array(
            0 => ''
        ),
        'METHODS' => array(),
        'SYMBOLS' => array(
            0 => 'color: #FF0000;'
        ),
        'REGEXPS' => array(
            0 => 'color: #000099;',
            1 => 'color: #990000;',
            2 => 'color: #888800;',
            3 => 'color: #888800;',
            4 => 'color: #000099;',
            5 => 'color: #000099;',
            6 => 'color: #990000; font-weight: bold;'
        ),
        'SCRIPT' => array()
    ),
    'URLS' => array(
        1 => '',
        2 => '',
        3 => '',
        4 => ''
    ),
    'OOLANG' => false,
    'OBJECT_SPLITTERS' => array(),
    'REGEXPS' => array(
        0 => '\$[^$][^ ,\(\)]*',
        1 => '(%|&).+?[^ ,\)]*',
        2 => '(#|@).+?[^ ,\)]*',
        3 => '-[a-z\d]+',
        4 => '(on|ctcp) (!|@|&)?(\d|\*):[a-zA-Z]+:',
        /*
        4 => array(
        GESHI_SEARCH => '((on|ctcp) (!|@|&)?(\d|\*):(Action|Active|Agent|AppActive|Ban|Chat|Close|Connect|Ctcp|CtcpReply|DccServer|DeHelp|DeOp|DeVoice|Dialog|Dns|Error|Exit|FileRcvd|FileSent|GetFail|Help|Hotlink|Input|Invite|Join|KeyDown|KeyUp|Kick|Load|Logon|MidiEnd|Mode|Mp3End|Nick|NoSound|Notice|Notify|Op|Open|Part|Ping|Pong|PlayEnd|Quit|Raw|RawMode|SendFail|Serv|ServerMode|ServerOp|Signal|Snotice|Start|Text|Topic|UnBan|Unload|Unotify|User|Mode|Voice|Wallops|WaveEnd):)',
        GESHI_REPLACE => '\\1',
        GESHI_MODIFIERS => 'i',
        GESHI_BEFORE => '',
        GESHI_AFTER => ''
        ),
        */

        5 => 'raw (\d|\*):',
        6 => 'timer(?!s\b)[0-9a-zA-Z_]+'
    ),
    'STRICT_MODE_APPLIES' => GESHI_NEVER,
    'SCRIPT_DELIMITERS' => array(),
    'HIGHLIGHT_STRICT_BLOCK' => array()
);
?>
Categories: Code Tags: , , , ,

Google Apps e-mail with Google Toolbar

December 12th, 2007 17 comments

So I’ve more or less switched to using only Google Apps‘ Webmail (Gmail with your own domain), making Thunderbird obsolete. To that end I’ve been trying to find a way to make mailto links launch my Google Apps composer window rather than the default Gmail composer window, and also how to make Gmail start by default in https (secure) mode rather than http (plain) mode.

In my search I’ve stumbled upon several resources, most pointing to using GreaseMonkey and a small script that re-writes all mailto links, another resource pointing to Gmail Manager saying it could handle Google Hosted Accounts (aka. Google Apps accounts), as well as some sites that explains how you fix the Gmail button for Google Toolbar to launch Gmail as https by default.

Of the resources pointed out in regards to the mailto handling, I found several GreaseMonkey scripts that did this job very well, although I didn’t really relish the idea of having that addon installed merely because I needed 1 script to handle mailto links, so I decided to try Gmail Manager instead

Gmail Manager was very easy to set up to handle Google Apps accounts in regards to checking e-mails, opening inbox and a few other minor things. All I had to do was type in my e-mail address and my password. Gmail Manager also handles mailto links, at least it opens my inbox when clicking a mailto link, but that isn’t enough for me, I want it to open the actual compose window. I decided it probably just was some hidden configuration option so I decided to muck around a bit in about:config, and behold: There I found “google.toolbar.mailto.providers.Gmail”, which contained the URL that Google Toolbar uses to open the composer window, when clicking mailto links.

So basically, all I had to do from the start was this:

Edit the Gmail button to open the Google Apps account instead of the Gmail account, and in https rather than http

  1. Go into Google Toolbar Options, under the Buttons tab
  2. Mark the Gmail button and click “Edit…”
  3. In the dialog that opens up click the “Use the advanced editor…” link
  4. There are 3 places that needs to be fixed:
    Change:

    http://mail.google.com/mail/?search=query&view=tl&start=0&init=1&fs=1&q={query}&source=navclient

    To:

    https://mail.google.com/a/MYDOMAIN.TLD?search=query&view=tl&start=0&init=1&fs=1&q={query}&source=navclient

    Change:

    http://mail.google.com/?source=navclient

    To:

    https://mail.google.com/a/MYDOMAIN.TLD?source=navclient

    Change:

    http://mail.google.com/mail?atom_browser_auth&source=navclient

    To:

    https://mail.google.com/a/MYDOMAIN.TLD?atom_browser_auth&source=navclient

    (Note: Replace MYDOMAIN.TLD with your own domain)

  5. Click “Save to Google Toolbar…”
  6. When/if asked to replace the Gmail button just click “Replace”.

Thanks to Stefano Savanelli for his comment referring to this following link where you can add a Google Apps e-mail button:
http://code.google.com/p/gtb-gmail-apps-button/

Now the Gmail button is fixed, now to make Google Toolbar send e-mail using the Google Apps account:

  1. Enable “Send with Gmail” in the Google Toolbar Options, under the More tab.
  2. Open about:config and locate “google.toolbar.mailto.providers.Gmail” (filtering by “gmail” makes it easier to find).
  3. Change the value
    From:

    firetool-mail:http://mail.google.com/mail/?view=cm&amp;fs=1@to=to&amp;subject=su&amp;body=body&amp;cc=cc&amp;bcc=bcc&amp;name=Gmail

    To:

    firetool-mail:https://mail.google.com/a/MYDOMAIN.TLD?view=cm&amp;fs=1&amp;tf=1@to=to&amp;subject=su&amp;body=body&amp;cc=cc&amp;bcc=bcc&amp;name=Gmail

    (Note: Replace MYDOMAIN.TLD with your own domain)

By adding the “&tf=1” variable to the URL the composer window will open “full screen”, without the folder list to the left and the search bar at the top.

There.. Now we have made Google Toolbar handle all aspects of our Google Apps account :)

Categories: Blog Tags: , , , ,