~ubuntu-branches/ubuntu/intrepid/xulrunner-1.9/intrepid

« back to all changes in this revision

Viewing changes to mozilla/extensions/irc/xul/content/commands.js

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack, Fabien Tassin, Alexander Sack
  • Date: 2008-07-18 17:36:30 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080718173630-13ky1jpruf7z22l2
Tags: 1.9.0.1+build1+nobinonly-0ubuntu1
* LP: #247494 - new upstream stability/security release (v1.9.0.1 build1)
  - see USN-626-1

[ Fabien Tassin <fta@sofaraway.org>]
* Add a build-system for xulrunner application inside the SDK.
  mozilla-devscripts is able to make use of this
  - add debian/create-build-system.sh
  - update debian/rules
* Rename the ld.so.conf.d file to xulrunner-1.9.conf as it seems
  extension matters
  - update debian/rules
  - update debian/xulrunner-1.9.postinst
* Get DEB_MOZ_VERSION and DEB_MOZ_VERSION from changelog and make more use
  of variables to make the merge with the 1.9.1 branch easier
  - update debian/rules
  - update debian/xulrunner-1.9.postinst
  - update debian/xulrunner-1.9.postrm
* Make EM_TRANSLATION_VERSION follow upstream version now that strings are
  hard frozen and bump EM_TRANSLATION_MAX_VERSION to 1.9.0.*
  - update debian/rules

[ Alexander Sack <asac@ubuntu.com> ]
* borrow lockPref patch from debian xulrunner (Debbugs: #469020)
  - add debian/patches/bzXXX_deb469020_lockPref_everywhere.patch
  - update debian/patches/series
* Debian compatibility patch that is supposed to make xulrunner also
  consider /usr/lib/mozilla/plugins/ in sid as of xulrunner 1.9~rc2-4
  - add debian/patches/bzXXX_sysplugin_support.patch
  - update debian/patches/series
* prepatch fix for bmo: #120380 - 'needsterminal flag in mailcap
  must be respected'
  - add debian/patches/bz120380_att326044.patch
  - update debian/patches/series
* add xre part missed by debian for sysplugin support
  - add debian/patches/bzXXX_sysplugin_support_xre_part.patch
  - update debian/patches/series
* drop patches applied upstream
  - delete debian/patches/bz428848_att319775_fix_venkman_chrome_access.patch
  - update debian/patches/series
* housekeeping for debian/patches directory; remove obsolete patches from
  debian/patches/ and drop commented patches from series
  - delete debian/patches/bz384304_fix_recursive_symlinks.patch
  - delete debian/patches/bzr423334_att310581_leak_initparser.patch
  - debian/patches/drop_bz418016.patch
  - update debian/patches/series
* (disabled in intrepid) fix "jemalloc not enabled in --with-xul-sdk= builds": we
  fix this by building libjemalloc as a static lib and linking xulrunner-bin and
  xulrunner-stub against it.
  - add debian/patches/jemalloc_in_xul.patch
  - add debian/patches/jemalloc_static.patch
  - update debian/patches/series
  - update debian/rules
  - update debian/xulrunner-1.9.postinst
* link nss/nspr include directories to xulrunner-1.9 sdk in order to
  allow upstream extensions to be built against ubuntu xulrunner.
  - add debian/xulrunner-1.9-dev.links
* add empty xulrunner-dev package to ease sync/merge tasks for ubuntu
  by providing the package name used by debian.
  - update debian/control
* fix makefile style variable eval in xulrunner-1.9 prerm script and use
  proper sh'ish style
  - update debian/xulrunner-1.9.prerm
* add code/debug-support to disable -Bsymbolic-functions linkage - but keep
  it commented by default
  - update debian/rules
* hold back upgrade until firefox 3.0.1 is available; for that, we add a
  Breaks: firefox-3.0 (<< 3.0.1) to xulrunner-1.9 binary package 
  - update debian/control
* fix LP: #247132 - The Prism Refractor Extension (v0.2) causes file
  downloads to kill firefox 3; we fix this by introducing a NULL check
  in our bz368428 "XUL FastLoad cache corruption" patch
  - update debian/patches/bz368428_attachment_308130.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
         ["invite",            cmdInvite,           CMD_NEED_SRV | CMD_CONSOLE],
129
129
         ["join",              cmdJoin,             CMD_NEED_SRV | CMD_CONSOLE],
130
130
         ["join-charset",      cmdJoin,             CMD_NEED_SRV | CMD_CONSOLE],
 
131
         ["jump-to-anchor",    cmdJumpToAnchor,                   CMD_NEED_NET],
131
132
         ["kick",              cmdKick,            CMD_NEED_CHAN | CMD_CONSOLE],
132
133
         ["kick-ban",          cmdKick,            CMD_NEED_CHAN | CMD_CONSOLE],
133
134
         ["knock",             cmdKnock,            CMD_NEED_SRV | CMD_CONSOLE],
474
475
 
475
476
        //display (getMsg(MSG_FMT_USAGE, [e.command.name, e.command.usage]),
476
477
        //         MT_USAGE);
 
478
        return null;
477
479
    };
478
480
 
479
481
    function callHooks (command, isBefore)
675
677
        return aliasLine;
676
678
    };
677
679
 
 
680
    function callBeforeHooks()
 
681
    {
 
682
        if ("beforeHooks" in client.commandManager)
 
683
            callHooks(client.commandManager, true);
 
684
        if ("beforeHooks" in e.command)
 
685
            callHooks(e.command, true);
 
686
    };
 
687
 
 
688
    function callAfterHooks()
 
689
    {
 
690
        if ("afterHooks" in e.command)
 
691
            callHooks(e.command, false);
 
692
        if ("afterHooks" in client.commandManager)
 
693
            callHooks(client.commandManager, false);
 
694
    };
 
695
 
678
696
    var h, i;
679
697
 
680
698
    if (typeof e.command.func == "function")
681
699
    {
682
700
        /* dispatch a real function */
683
701
 
684
 
        client.commandManager.parseArguments (e);
685
 
 
 
702
        client.commandManager.parseArguments(e);
686
703
        if ("parseError" in e)
687
 
        {
688
 
            displayUsageError(e, e.parseError);
689
 
        }
690
 
        else
691
 
        {
692
 
            if ("beforeHooks" in client.commandManager)
693
 
                callHooks(client.commandManager, true);
694
 
            if ("beforeHooks" in e.command)
695
 
                callHooks(e.command, true);
 
704
            return displayUsageError(e, e.parseError);
696
705
 
697
 
            if ("dbgDispatch" in client && client.dbgDispatch)
 
706
        if (("dbgDispatch" in client) && client.dbgDispatch)
 
707
        {
 
708
            var str = "";
 
709
            for (i = 0; i < e.command.argNames.length; ++i)
698
710
            {
699
 
                var str = "";
700
 
                for (i = 0; i < e.command.argNames.length; ++i)
701
 
                {
702
 
                    var name = e.command.argNames[i];
703
 
                    if (name in e)
704
 
                        str += " " + name + ": " + e[name];
705
 
                    else if (name != ":")
706
 
                        str += " ?" + name;
707
 
                }
708
 
                dd (">>> " + e.command.name + str + " <<<");
709
 
                e.returnValue = e.command.func(e);
710
 
                /* set client.lastEvent *after* dispatching, so the dispatched
711
 
                 * function actually get's a chance to see the last event. */
 
711
                var name = e.command.argNames[i];
 
712
                if (name in e)
 
713
                    str += " " + name + ": " + e[name];
 
714
                else if (name != ":")
 
715
                    str += " ?" + name;
 
716
            }
 
717
            dd(">>> " + e.command.name + str + " <<<");
 
718
        }
 
719
 
 
720
        callBeforeHooks();
 
721
        try
 
722
        {
 
723
            e.returnValue = e.command.func(e);
 
724
        }
 
725
        finally
 
726
        {
 
727
            callAfterHooks();
 
728
            /* set client.lastEvent *after* dispatching, so the dispatched
 
729
             * function actually get's a chance to see the last event. */
 
730
            if (("dbgDispatch" in client) && client.dbgDispatch)
712
731
                client.lastEvent = e;
713
 
            }
714
 
            else
715
 
            {
716
 
                e.returnValue = e.command.func(e);
717
 
            }
718
 
 
719
732
        }
720
733
    }
721
734
    else if (typeof e.command.func == "string")
722
735
    {
723
736
        /* dispatch an alias (semicolon delimited list of subcommands) */
724
 
        if ("beforeHooks" in client.commandManager)
725
 
            callHooks(client.commandManager, true);
726
 
        if ("beforeHooks" in e.command)
727
 
            callHooks(e.command, true);
728
737
 
729
738
        var commandList;
730
739
        //Don't make use of e.inputData if we have multiple commands in 1 alias
752
761
            }
753
762
        }
754
763
 
755
 
        for (i = 0; i < commandList.length; ++i)
756
 
        {
757
 
            var newEvent = Clone(e);
758
 
            delete newEvent.command;
759
 
            commandList[i] = stringTrim(commandList[i]);
760
 
            dispatch(commandList[i], newEvent, flags);
 
764
        callBeforeHooks();
 
765
        try
 
766
        {
 
767
            for (i = 0; i < commandList.length; ++i)
 
768
            {
 
769
                var newEvent = Clone(e);
 
770
                delete newEvent.command;
 
771
                commandList[i] = stringTrim(commandList[i]);
 
772
                dispatch(commandList[i], newEvent, flags);
 
773
            }
 
774
        }
 
775
        finally
 
776
        {
 
777
            callAfterHooks();
761
778
        }
762
779
    }
763
780
    else
764
781
    {
765
 
        display (getMsg(MSG_ERR_NOTIMPLEMENTED, e.command.name),
766
 
                 MT_ERROR);
 
782
        display(getMsg(MSG_ERR_NOTIMPLEMENTED, e.command.name), MT_ERROR);
767
783
        return null;
768
784
    }
769
785
 
770
 
    if ("afterHooks" in e.command)
771
 
        callHooks(e.command, false);
772
 
    if ("afterHooks" in client.commandManager)
773
 
        callHooks(client.commandManager, false);
774
 
 
775
786
    return ("returnValue" in e) ? e.returnValue : null;
776
787
}
777
788
 
3889
3900
    setCurrentObject(e.view);
3890
3901
}
3891
3902
 
 
3903
function cmdJumpToAnchor(e)
 
3904
{
 
3905
    if (e.hasOwnProperty("channelName"))
 
3906
    {
 
3907
        e.channel = new CIRCChannel(e.server, e.channelName);
 
3908
    }
 
3909
    else if (!e.channel)
 
3910
    {
 
3911
        display(getMsg(MSG_ERR_REQUIRED_PARAM, "channel-name"), MT_ERROR);
 
3912
        return;
 
3913
    }
 
3914
    if (!e.channel.frame)
 
3915
    {
 
3916
        display(getMsg(MSG_JUMPTO_ERR_NOCHAN, e.channel.unicodeName), MT_ERROR);
 
3917
        return;
 
3918
    }
 
3919
 
 
3920
    var document = getContentDocument(e.channel.frame);
 
3921
    var row = document.getElementById(e.anchor);
 
3922
 
 
3923
    if (!row)
 
3924
    {
 
3925
        display(getMsg(MSG_JUMPTO_ERR_NOANCHOR), MT_ERROR);
 
3926
        return;
 
3927
    }
 
3928
 
 
3929
    dispatch("set-current-view", {view: e.channel});
 
3930
    e.channel.scrollToElement(row, "center");
 
3931
}
 
3932
 
3892
3933
function cmdIgnore(e)
3893
3934
{
3894
3935
    if (("mask" in e) && e.mask)