aboutsummaryrefslogtreecommitdiffstats
path: root/data/defscript
diff options
context:
space:
mode:
Diffstat (limited to 'data/defscript')
-rw-r--r--data/defscript/Makefile.am8
-rw-r--r--data/defscript/aliases.kvs737
-rw-r--r--data/defscript/default.kvs2241
-rw-r--r--data/defscript/events.kvs105
-rw-r--r--data/defscript/popups.kvs1383
-rw-r--r--data/defscript/toolbars.kvs43
6 files changed, 2280 insertions, 2237 deletions
diff --git a/data/defscript/Makefile.am b/data/defscript/Makefile.am
index e52ddf9f5..768c9b8fb 100644
--- a/data/defscript/Makefile.am
+++ b/data/defscript/Makefile.am
@@ -1,5 +1,11 @@
tmpdir = $(defscriptdir)
-tmp_DATA = default.kvs installer.kvs theme-install.kvs
+tmp_DATA = default.kvs \
+ aliases.kvs \
+ events.kvs \
+ popups.kvs \
+ toolbars.kvs \
+ installer.kvs \
+ theme-install.kvs
EXTRA_DIST = $(tmp_DATA)
diff --git a/data/defscript/aliases.kvs b/data/defscript/aliases.kvs
new file mode 100644
index 000000000..7f6d8510b
--- /dev/null
+++ b/data/defscript/aliases.kvs
@@ -0,0 +1,737 @@
+# Default aliases file
+
+#
+# TODO:
+# ignore, notify and unignore should go in the core
+#
+# If possible, get rid of $str.* from the default popups
+# avoiding to load the module at every channel popup open action...
+# (Find a core function that retrieves the number of nicknames passed ?)
+# Another solution would be to increase the str.module core lock-time ?
+#
+
+#
+# Backward compatibility stuff
+#
+alias(avatar)
+{
+ # avatar target file
+ if(!$0)
+ {
+ echo "Missing target, no action taken"
+ return
+ }
+ if($1)
+ {
+ avatar.set $1
+ }
+ avatar.notify $0
+}
+alias(clear)
+{
+ window.clearOutput
+}
+alias(connect)
+{
+ objects.connect $0 $1 $2 $3
+}
+alias(disconnect)
+{
+ objects.disconnect $0 $1 $2 $3
+}
+alias(killclass)
+{
+ objects.killclass $0
+}
+alias(clearobjects)
+{
+ objects.clear $0
+}
+alias(nickserv)
+{
+ # Silent
+ raw -q NickServ $0-
+}
+
+alias(chanserv)
+{
+ # Silent
+ raw -q ChanServ $0-
+}
+
+alias(memoserv)
+{
+ # Silent
+ raw -q MemoServ $0-
+}
+
+alias(ns)
+{
+ # Silent
+ raw -q nickserv $0-
+}
+
+
+alias(cs)
+{
+ # Silent
+ raw -q chanserv $0-
+}
+
+alias(ms)
+{
+ # Silent
+ raw -q memoserv $0-
+}
+
+alias(gnotice)
+{
+ # Global notice
+
+ #Check null notice
+ if(!$0){
+ echo $tr("Usage"): /gnotice [-waohvq] <$tr("message")>
+ echo $tr("-m: send a message instead of a notice")
+ echo $tr("-w: send notice to all channel owners")
+ echo $tr("-a: send notice to all channel admins")
+ echo $tr("-o: send notice to all channel ops")
+ echo $tr("-h: send notice to all channel halfops")
+ echo $tr("-v: send notice to all channel voices")
+ echo $tr("-q: quiet mode")
+ halt
+ }
+
+ # Detect message type
+ if($sw(m)) %cmd="msg"
+ else %cmd="notice"
+
+ # Check for quiet message
+ if($sw(q)) %cmd=$str.append(%cmd," -q")
+
+ # Check null switches
+ if((!$sw(w))&&(!$sw(a))&&(!$sw(o))&&(!$sw(h))&&(!$sw(v))){
+ eval %cmd $chan.name($active) $0-
+ halt
+ }
+
+ # Check switches passed
+ if($sw(w)) eval %cmd \~$chan.name($active) $0-
+ if($sw(a)) eval %cmd \!$chan.name($active) $0-
+ if($sw(o)) eval %cmd \@$chan.name($active) $0-
+ if($sw(h)) eval %cmd \%$chan.name($active) $0-
+ if($sw(v)) eval %cmd \+$chan.name($active) $0-
+}
+alias(wallop)
+{
+ if(!$0){
+ echo $tr("Usage"): /wallop <$tr("message")>
+ halt
+ }
+
+ # Due to server flood, timing may be very high
+ echo -w=$active $tr("Sending wallop to") $chan.name($active)
+ timer(wallop,5000,$chan.users(,,o),$0-){
+ if(%:localOps == ""){ %:localOps = $chan.users(,,o); %:curIndex = 0; }
+ if(%:curIndex == %:localOps[]#){ killtimer wallop; return; }
+
+ for(%i=0;%i<1;%i++){
+ if(%:localOps[%:curIndex] != $my.nick){
+ if(%:curIndex == %:localOps[]#){ killtimer wallop; return; }
+ msg -q %:localOps[%:curIndex] $1-
+ %:curIndex++
+ }
+ }
+ }
+}
+
+alias(kill){
+ raw -q kill $0 :$1-
+}
+
+alias(ms)
+{
+ # Silent
+ quote ms $0-
+}
+
+# j: This is a really common one
+
+alias(j)
+{
+ #first we do a test if a chan is given as parameter
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /j <chan>"
+ } else {
+ join $0-
+ }
+}
+
+# s: This too
+
+alias (s)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /s <server>"
+ } else {
+ server $0-
+ }
+}
+
+# q: Ok, I am lazy :P
+
+alias (q)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /q <nick>"
+ } else {
+ query $0-
+ }
+}
+
+# Mmmm, this could be improved...
+
+alias (lag)
+{
+ if(!$server)
+ {
+ echo "[LAG]: " $tr("You must be connected to a server")
+ halt
+ }
+ echo $tr("Lag is") $lag.lag() $tr("milliseconds")
+}
+
+# names: maybe this should be implemented on the core?
+
+alias(names)
+{
+ if(!$0)
+ {
+ if($window.type($active)!="channel")
+ {
+ echo $tr("Usage:") "/names <channel>"
+ } else {
+ raw names $active
+ }
+ } else {
+ raw names $0-
+ }
+}
+
+# kickban
+
+alias (kb)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /kb <nick_list> [" $tr("reason") "]"
+ halt;
+ }
+
+ if(!$channel)
+ {
+ echo "[KB]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ foreach(%nick,$str.split(",",$0))
+ {
+ if(%nick)
+ {
+ %mask = $mask(%nick,$option(uintDefaultBanType));
+
+ if(!%mask)%mask = %nick; # plain ban
+
+ %reason = $1-
+ #if(!%reason)%reason = "You're not welcome here!"
+
+ # This is tricky : we send everything
+ # as a single raw message just because
+ # we do not want delays between kick and ban
+ # if anti-server-flood is enabled
+
+ %raw = "kick $target %nick :%reason"
+
+ # kick %nick %reason
+
+ if($chan.isOp(%nick))%raw2 = "mode $target -o+b %nick %mask"
+ else %raw2 = "mode $target +b %mask"
+
+ raw -q %raw2$cr$lf%raw
+ }
+ }
+}
+
+# chanowner
+
+alias (chanowner)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /chanowner <nick_list>"
+ halt;
+ }
+ if(!$channel)
+ {
+ echo "[CHANOWNER]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ foreach(%nick,$str.split(",",$0))
+ {
+ if(%nick)
+ {
+ mode $chan.name() +q %nick
+ }
+ }
+}
+
+# chanadmin
+
+alias (chanadmin)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /chanadmin <nick_list>"
+ halt;
+ }
+ if(!$channel)
+ {
+ echo "[CHANADMIN]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ foreach(%nick,$str.split(",",$0))
+ {
+ if(%nick)
+ {
+ mode $chan.name() +a %nick
+ }
+ }
+}
+
+# dechanowner
+
+alias (dechanowner)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /dechanowner <nick_list>"
+ halt;
+ }
+ if(!$channel)
+ {
+ echo "[DECHANOWNER]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ foreach(%nick,$str.split(",",$0))
+ {
+ if(%nick)
+ {
+ mode $chan.name() -q %nick
+ }
+ }
+}
+
+# dechanadmin
+
+alias (dechanadmin)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /dechanadmin <nick_list>"
+ halt;
+ }
+ if(!$channel)
+ {
+ echo "[DECHANADMIN]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ foreach(%nick,$str.split(",",$0))
+ {
+ if(%nick)
+ {
+ mode $chan.name() -a %nick
+ }
+ }
+}
+
+# halfop
+
+alias (halfop)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /halfop <nick_list>"
+ halt;
+ }
+ if(!$channel)
+ {
+ echo "[HALFOP]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ foreach(%nick,$str.split(",",$0))
+ {
+ if(%nick)
+ {
+ mode $chan.name() +h %nick
+ }
+ }
+}
+
+# dehalfop
+
+alias (dehalfop)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /dehalfop <nick_list>"
+ halt;
+ }
+ if(!$channel)
+ {
+ echo "[DEHALFOP]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ foreach(%nick,$str.split(",",$0))
+ {
+ if(%nick)
+ {
+ mode $chan.name() -h %nick
+ }
+ }
+}
+
+# userop
+
+alias (userop)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /userop <nick_list>"
+ halt;
+ }
+ if(!$channel)
+ {
+ echo "[USEROP]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ foreach(%nick,$str.split(",",$0))
+ {
+ if(%nick)
+ {
+ mode $chan.name() +u %nick
+ }
+ }
+}
+
+# deuserop
+
+alias (deuserop)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /deuserop <nick_list>"
+ halt;
+ }
+ if(!$channel)
+ {
+ echo "[DEUSEROP]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ foreach(%nick,$str.split(",",$0))
+ {
+ if(%nick)
+ {
+ mode $chan.name() -u %nick
+ }
+ }
+}
+
+# ame and amsg
+
+alias(ame)
+{
+ foreach(%i,$window.list(channel))if(%i!="") me -r=%i $0-
+}
+
+alias(amsg)
+{
+ foreach(%i,$window.list(channel))msg $target(%i) $0-
+}
+
+alias(amsgall)
+{
+ foreach(%i,$window.list(channel),$window.list(query))msg $target(%i) $0-
+}
+
+
+alias(ameall)
+{
+ foreach(%i,$window.list(channel),$window.list(query)){
+ if(%i!="") me -r=%i $0-
+ }
+}
+
+alias(awayall)
+{
+ foreach(%w,$window.list(console,all))away -r=%w $0-;
+}
+
+# notify: this is a bit more complex
+# We want to add an user to the notify list with a single command
+# The notify lists are handled thru the registered users database
+
+alias(notify)
+{
+ # This one adds a registered users database entry
+ # For the specified nick and uses the specified mask
+ # If no mask is specified , a default one is constructed
+ # Then the "notify" property is set for the user
+
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /notify <nick> [mask]"
+ halt
+ }
+
+ # Get the mask
+
+ %mask = $1
+
+ # no mask specified ? build it
+
+ if(!%mask)%mask = $0!*@*
+
+ # Now add the user (but do not replace old entries)
+
+ reguser.add -f -q $0 %mask
+
+ # Merge the notify property part with the old one (if any)
+
+ %oldNicks = $reguser.property($0,notify)
+
+ # It would be a good idea to check if the nikckname is already in the %oldNicks list
+ # but this is left as exercise for the reader.
+
+ %oldNicks << $0
+
+ # And finally set the property (use -n so the notify lists will be restarted)
+
+ reguser.setproperty -n $0 notify $0
+
+ # done...the notify list should be restarted now
+}
+
+alias(ignore)
+{
+ # This one adds a registered users database entry
+ # For the specified nick and uses the specified mask
+ # If no mask is specified , a default one is constructed
+ # Then the "ignore" property is set for the user to 1
+
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /ignore [-r] <nick> [mask]"
+ halt
+ }
+
+ # Get the mask
+
+ %mask = $1
+
+ # no mask specified ? build it
+
+ if(!%mask)%mask = $0!*@*
+
+ # Now add the user (but do not replace old entries)
+
+ reguser.add -f -q $0 %mask
+
+ # And finally set the property (use -n so the notify lists will be restarted)
+ # Check if ignore or unignore the user
+
+ if(!$sw(r))
+ {
+ reguser.setIgnoreEnabled $0 true
+ reguser.setIgnoreFlags -p -c -t $0
+ } else reguser.setIgnoreEnabled $0 false
+}
+
+# Dcc...people commonly use "dcc send" instead of "dcc.send"
+
+alias(dcc)
+{
+ switch($0)
+ {
+ case(send):
+ {
+ dcc.send $1-
+ break
+ }
+ case(chat):
+ {
+ dcc.chat $1-
+ break
+ }
+ case(voice):
+ {
+ dcc.voice $1-
+ break
+ }
+ case(allow):
+ {
+ quote dccallow $1-
+ break
+ }
+ default:
+ {
+ echo "[DCC]: " $tr("Unsupported type: $0")
+ }
+ }
+}
+
+#
+# return a string with the name of the curerent usermode
+#
+alias(usermodename)
+{
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo " /usermodename <nick>"
+ halt;
+ }
+ if(!$channel)
+ {
+ echo "[USERMODENAME]: " $tr("This is not a channel window")
+ halt;
+ }
+
+ if($chan.isOwner($0,$channel)){
+ return $tr("Channel Owner")
+ } elseif($chan.isAdmin($0,$channel)){
+ return $tr("Channel Administrator")
+ } elseif($chan.isOp($0,$channel)){
+ return $tr("Channel Operator")
+ } elseif($chan.isHalfOp($0,$channel)){
+ return $tr("Half Operator")
+ } elseif($chan.isVoice($0,$channel)){
+ return $tr("Voice")
+ } elseif($chan.isUserOp($0,$channel)){
+ return $tr("User Operator")
+ } else {
+ return $tr("Normal User")
+ }
+}
+
+alias(dccallow)
+{
+ quote dccallow \+$0
+}
+
+#shortcut for commonly called algorithm
+alias(md5)
+{
+ return $str.digest($0-,md5)
+}
+
+alias(sha1)
+{
+ return $str.digest($0-,sha1)
+}
+
+# DNS : people like it
+
+alias(dns)
+{
+ if(!$context)
+ {
+ echo "[DNS]: " $tr("You must use DNS in an IRC context")
+ halt
+ }
+
+ if(!$server)
+ {
+ echo "[DNS]: " $tr("You must be connected to a server")
+ halt
+ }
+
+ if(!$0)
+ {
+ echo $tr("Usage:")
+ echo echo " /dns <nickname>"
+ halt
+ }
+
+ if($isWellKnown($0))host -a $hostname($0)
+ else {
+ awhois($0)
+ {
+ if(!$2)
+ {
+ echo "[DNS]: " $tr("No such user: $0")
+ } else {
+ host -a $2
+ }
+ }
+ }
+}
+
+alias(ss)
+{
+ # Silent
+ quote ss $0-
+}
+
+alias(seenserv)
+{
+ # Silent
+ msg -q SeenServ $0-
+}
+
+alias(hs)
+{
+ #Silent
+ quote hs $0-
+}
+
+alias(hop)
+{
+ // Retrieve channel
+ %chan=$0
+ if(!%chan) %chan=$chan.name($active)
+
+ // Retrieve channel key
+ %key=$chan.key($channel(%chan))
+
+ // Exit channel
+ if($window.type($channel(%chan))=="channel")
+ part --keep %chan $option(stringPartMessage)
+
+ // Rejoin channel
+ if(!%key) join %chan
+ else join %chan %key
+} \ No newline at end of file
diff --git a/data/defscript/default.kvs b/data/defscript/default.kvs
index 820d90988..fb270da6d 100644
--- a/data/defscript/default.kvs
+++ b/data/defscript/default.kvs
@@ -11,756 +11,11 @@
%mypath = "$file.extractpath($0)$file.ps"
-#
-# TODO:
-# ignore , notify and unignore should go in the core
-#
-# If possible , get rid of str.* from the default popups
-# avoiding to load the module at every channel popup open action...
-# (Find a core function that retrieves the number of nicknames passed ?)
-# Another solution would be to increase the str.module core lock-time ?
-#
-
-#
-# First of all we are going to add a couple of basic aliases
-#
-
-#
-# Backward compatibility stuff
-#
-alias(avatar)
-{
- # avatar target file
- if(!$0)
- {
- echo "Missing target, no action taken"
- return
- }
- if($1)
- {
- avatar.set $1
- }
- avatar.notify $0
-}
-alias(clear)
-{
- window.clearOutput
-}
-alias(connect)
-{
- objects.connect $0 $1 $2 $3
-}
-alias(disconnect)
-{
- objects.disconnect $0 $1 $2 $3
-}
-alias(killclass)
-{
- objects.killclass $0
-}
-alias(clearobjects)
-{
- objects.clear $0
-}
-alias(nickserv)
-{
- # Silent
- raw -q NickServ $0-
-}
-
-alias(chanserv)
-{
- # Silent
- raw -q ChanServ $0-
-}
-
-alias(memoserv)
-{
- # Silent
- raw -q MemoServ $0-
-}
-
-alias(ns)
-{
- # Silent
- raw -q nickserv $0-
-}
-
-
-alias(cs)
-{
- # Silent
- raw -q chanserv $0-
-}
-
-alias(ms)
-{
- # Silent
- raw -q memoserv $0-
-}
-
-alias(gnotice)
-{
- # Global notice
-
- #Check null notice
- if(!$0){
- echo $tr("Usage"): /gnotice [-waohvq] <$tr("message")>
- echo $tr("-m: send a message instead of a notice")
- echo $tr("-w: send notice to all channel owners")
- echo $tr("-a: send notice to all channel admins")
- echo $tr("-o: send notice to all channel ops")
- echo $tr("-h: send notice to all channel halfops")
- echo $tr("-v: send notice to all channel voices")
- echo $tr("-q: quiet mode")
- halt
- }
-
- # Detect message type
- if($sw(m)) %cmd="msg"
- else %cmd="notice"
-
- # Check for quiet message
- if($sw(q)) %cmd=$str.append(%cmd," -q")
-
- # Check null switches
- if((!$sw(w))&&(!$sw(a))&&(!$sw(o))&&(!$sw(h))&&(!$sw(v))){
- eval %cmd $chan.name($active) $0-
- halt
- }
-
- # Check switches passed
- if($sw(w)) eval %cmd \~$chan.name($active) $0-
- if($sw(a)) eval %cmd \!$chan.name($active) $0-
- if($sw(o)) eval %cmd \@$chan.name($active) $0-
- if($sw(h)) eval %cmd \%$chan.name($active) $0-
- if($sw(v)) eval %cmd \+$chan.name($active) $0-
-}
-alias(wallop)
-{
- if(!$0){
- echo $tr("Usage"): /wallop <$tr("message")>
- halt
- }
-
- # Due to server flood, timing may be very high
- echo -w=$active $tr("Sending wallop to") $chan.name($active)
- timer(wallop,5000,$chan.users(,,o),$0-){
- if(%:localOps == ""){ %:localOps = $chan.users(,,o); %:curIndex = 0; }
- if(%:curIndex == %:localOps[]#){ killtimer wallop; return; }
-
- for(%i=0;%i<1;%i++){
- if(%:localOps[%:curIndex] != $my.nick){
- if(%:curIndex == %:localOps[]#){ killtimer wallop; return; }
- msg -q %:localOps[%:curIndex] $1-
- %:curIndex++
- }
- }
- }
-}
-
-alias(kill){
- raw -q kill $0 :$1-
-}
-
-alias(ms)
-{
- # Silent
- quote ms $0-
-}
-
-# j: This is a really common one
-
-alias(j)
-{
- #first we do a test if a chan is given as parameter
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /j <chan>"
- } else {
- join $0-
- }
-}
-
-# s: This too
-
-alias (s)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /s <server>"
- } else {
- server $0-
- }
-}
-
-# q: Ok, I am lazy :P
-
-alias (q)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /q <nick>"
- } else {
- query $0-
- }
-}
-
-# Mmmm, this could be improved...
-
-alias (lag)
-{
- if(!$server)
- {
- echo "[LAG]: " $tr("You must be connected to a server")
- halt
- }
- echo $tr("Lag is") $lag.lag() $tr("milliseconds")
-}
-
-# names: maybe this should be implemented on the core?
-
-alias(names)
-{
- if(!$0)
- {
- if($window.type($active)!="channel")
- {
- echo $tr("Usage:") "/names <channel>"
- } else {
- raw names $active
- }
- } else {
- raw names $0-
- }
-}
-
-# kickban
-
-alias (kb)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /kb <nick_list> [" $tr("reason") "]"
- halt;
- }
-
- if(!$channel)
- {
- echo "[KB]: " $tr("This is not a channel window")
- halt;
- }
-
- foreach(%nick,$str.split(",",$0))
- {
- if(%nick)
- {
- %mask = $mask(%nick,$option(uintDefaultBanType));
-
- if(!%mask)%mask = %nick; # plain ban
-
- %reason = $1-
- #if(!%reason)%reason = "You're not welcome here!"
-
- # This is tricky : we send everything
- # as a single raw message just because
- # we do not want delays between kick and ban
- # if anti-server-flood is enabled
-
- %raw = "kick $target %nick :%reason"
-
- # kick %nick %reason
-
- if($chan.isOp(%nick))%raw2 = "mode $target -o+b %nick %mask"
- else %raw2 = "mode $target +b %mask"
-
- raw -q %raw2$cr$lf%raw
- }
- }
-}
-
-# chanowner
-
-alias (chanowner)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /chanowner <nick_list>"
- halt;
- }
- if(!$channel)
- {
- echo "[CHANOWNER]: " $tr("This is not a channel window")
- halt;
- }
-
- foreach(%nick,$str.split(",",$0))
- {
- if(%nick)
- {
- mode $chan.name() +q %nick
- }
- }
-}
-
-# chanadmin
-
-alias (chanadmin)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /chanadmin <nick_list>"
- halt;
- }
- if(!$channel)
- {
- echo "[CHANADMIN]: " $tr("This is not a channel window")
- halt;
- }
-
- foreach(%nick,$str.split(",",$0))
- {
- if(%nick)
- {
- mode $chan.name() +a %nick
- }
- }
-}
-
-# dechanowner
-
-alias (dechanowner)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /dechanowner <nick_list>"
- halt;
- }
- if(!$channel)
- {
- echo "[DECHANOWNER]: " $tr("This is not a channel window")
- halt;
- }
-
- foreach(%nick,$str.split(",",$0))
- {
- if(%nick)
- {
- mode $chan.name() -q %nick
- }
- }
-}
-
-# dechanadmin
-
-alias (dechanadmin)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /dechanadmin <nick_list>"
- halt;
- }
- if(!$channel)
- {
- echo "[DECHANADMIN]: " $tr("This is not a channel window")
- halt;
- }
-
- foreach(%nick,$str.split(",",$0))
- {
- if(%nick)
- {
- mode $chan.name() -a %nick
- }
- }
-}
-
-# halfop
-
-alias (halfop)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /halfop <nick_list>"
- halt;
- }
- if(!$channel)
- {
- echo "[HALFOP]: " $tr("This is not a channel window")
- halt;
- }
-
- foreach(%nick,$str.split(",",$0))
- {
- if(%nick)
- {
- mode $chan.name() +h %nick
- }
- }
-}
-
-# dehalfop
-
-alias (dehalfop)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /dehalfop <nick_list>"
- halt;
- }
- if(!$channel)
- {
- echo "[DEHALFOP]: " $tr("This is not a channel window")
- halt;
- }
-
- foreach(%nick,$str.split(",",$0))
- {
- if(%nick)
- {
- mode $chan.name() -h %nick
- }
- }
-}
-
-# userop
-
-alias (userop)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /userop <nick_list>"
- halt;
- }
- if(!$channel)
- {
- echo "[USEROP]: " $tr("This is not a channel window")
- halt;
- }
-
- foreach(%nick,$str.split(",",$0))
- {
- if(%nick)
- {
- mode $chan.name() +u %nick
- }
- }
-}
-
-# deuserop
-
-alias (deuserop)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /deuserop <nick_list>"
- halt;
- }
- if(!$channel)
- {
- echo "[DEUSEROP]: " $tr("This is not a channel window")
- halt;
- }
-
- foreach(%nick,$str.split(",",$0))
- {
- if(%nick)
- {
- mode $chan.name() -u %nick
- }
- }
-}
-
-# ame and amsg
-
-alias(ame)
-{
- foreach(%i,$window.list(channel))if(%i!="") me -r=%i $0-
-}
-
-alias(amsg)
-{
- foreach(%i,$window.list(channel))msg $target(%i) $0-
-}
-
-alias(amsgall)
-{
- foreach(%i,$window.list(channel),$window.list(query))msg $target(%i) $0-
-}
-
-
-alias(ameall)
-{
- foreach(%i,$window.list(channel),$window.list(query)){
- if(%i!="") me -r=%i $0-
- }
-}
-
-alias(awayall)
-{
- foreach(%w,$window.list(console,all))away -r=%w $0-;
-}
-
-# notify: this is a bit more complex
-# We want to add an user to the notify list with a single command
-# The notify lists are handled thru the registered users database
-
-alias(notify)
-{
- # This one adds a registered users database entry
- # For the specified nick and uses the specified mask
- # If no mask is specified , a default one is constructed
- # Then the "notify" property is set for the user
-
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /notify <nick> [mask]"
- halt
- }
-
- # Get the mask
-
- %mask = $1
-
- # no mask specified ? build it
-
- if(!%mask)%mask = $0!*@*
-
- # Now add the user (but do not replace old entries)
-
- reguser.add -f -q $0 %mask
-
- # Merge the notify property part with the old one (if any)
-
- %oldNicks = $reguser.property($0,notify)
-
- # It would be a good idea to check if the nikckname is already in the %oldNicks list
- # but this is left as exercise for the reader.
-
- %oldNicks << $0
-
- # And finally set the property (use -n so the notify lists will be restarted)
-
- reguser.setproperty -n $0 notify $0
-
- # done...the notify list should be restarted now
-}
-
-alias(ignore)
-{
- # This one adds a registered users database entry
- # For the specified nick and uses the specified mask
- # If no mask is specified , a default one is constructed
- # Then the "ignore" property is set for the user to 1
-
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /ignore [-r] <nick> [mask]"
- halt
- }
-
- # Get the mask
-
- %mask = $1
-
- # no mask specified ? build it
-
- if(!%mask)%mask = $0!*@*
-
- # Now add the user (but do not replace old entries)
-
- reguser.add -f -q $0 %mask
-
- # And finally set the property (use -n so the notify lists will be restarted)
- # Check if ignore or unignore the user
-
- if(!$sw(r))
- {
- reguser.setIgnoreEnabled $0 true
- reguser.setIgnoreFlags -p -c -t $0
- } else reguser.setIgnoreEnabled $0 false
-}
-
-# Dcc...people commonly use "dcc send" instead of "dcc.send"
-
-alias(dcc)
-{
- switch($0)
- {
- case(send):
- {
- dcc.send $1-
- break
- }
- case(chat):
- {
- dcc.chat $1-
- break
- }
- case(voice):
- {
- dcc.voice $1-
- break
- }
- case(allow):
- {
- quote dccallow $1-
- break
- }
- default:
- {
- echo "[DCC]: " $tr("Unsupported type: $0")
- }
- }
-}
-
-alias(dccallow)
-{
- quote dccallow \+$0
-}
-
-#shortcut for commonly called algorithm
-alias(md5)
-{
- return $str.digest($0-,md5)
-}
-
-alias(sha1)
-{
- return $str.digest($0-,sha1)
-}
-
-# DNS : people like it
-
-alias(dns)
-{
- if(!$context)
- {
- echo "[DNS]: " $tr("You must use DNS in an IRC context")
- halt
- }
-
- if(!$server)
- {
- echo "[DNS]: " $tr("You must be connected to a server")
- halt
- }
-
- if(!$0)
- {
- echo $tr("Usage:")
- echo echo " /dns <nickname>"
- halt
- }
-
- if($isWellKnown($0))host -a $hostname($0)
- else {
- awhois($0)
- {
- if(!$2)
- {
- echo "[DNS]: " $tr("No such user: $0")
- } else {
- host -a $2
- }
- }
- }
-}
-
-alias(ss)
-{
- # Silent
- quote ss $0-
-}
-
-alias(seenserv)
-{
- # Silent
- msg -q SeenServ $0-
-}
-
-alias(hs)
-{
- #Silent
- quote hs $0-
-}
-
-alias(hop)
-{
- // Retrieve channel
- %chan=$0
- if(!%chan) %chan=$chan.name($active)
-
- // Retrieve channel key
- %key=$chan.key($channel(%chan))
-
- // Exit channel
- if($window.type($channel(%chan))=="channel")
- part --keep %chan $option(stringPartMessage)
-
- // Rejoin channel
- if(!%key) join %chan
- else join %chan %key
-}
-
-# The toolbars that previously were in the core :)
-
-toolbar.create irccontext $tr("IRC Context") $icon("irc4")
-# toolbar.additem irccontext kvirc.irccontextdisplay - info dublicated with te status line
-toolbar.additem irccontext kvirc.connect
-toolbar.additem irccontext kvirc.servermenu
-toolbar.additem irccontext kvirc.newirccontext
-toolbar.additem irccontext kvirc.separator
-toolbar.additem irccontext kvirc.nicknamemenu
-toolbar.additem irccontext kvirc.irctools
-toolbar.additem irccontext kvirc.ircactions
-toolbar.additem irccontext kvirc.usermodemenu
-toolbar.show irccontext
-
-toolbar.create options $tr("Options") $icon("options")
-toolbar.additem irccontext kvirc.serveroptions
-toolbar.additem options kvirc.identityoptions
-toolbar.additem options kvirc.generaloptions
-toolbar.additem options kvirc.themeoptions
-toolbar.show options
-
-toolbar.create help $tr("Help") 49
-toolbar.additem help kvirc.helpindex
-if($lang(short)==ru)
- toolbar.additem help kvirc.kvircruhomepage
-else
- toolbar.additem help kvirc.kvirchomepage
-toolbar.show help
-
-toolbar.create scripting $tr("Scripting") $icon("binarytext")
-toolbar.additem scripting kvirc.actioneditor
-toolbar.additem scripting kvirc.aliaseditor
-toolbar.additem scripting kvirc.eventeditor
-toolbar.additem scripting kvirc.popupeditor
-toolbar.additem scripting kvirc.raweditor
-toolbar.additem scripting kvirc.codetester
-toolbar.additem scripting kvirc.separator
-toolbar.additem scripting kvirc.executekvs
-
-toolbar.create winops $tr("Window operations") $icon("cascadewindows")
-toolbar.additem winops kvirc.cascadewindows
-toolbar.additem winops kvirc.tilewindows
-toolbar.additem winops kvirc.minimizeallwindows
-
+# Fetch default scripts data
+include "aliases.kvs" %mypath
+include "events.kvs" %mypath
+include "popups.kvs" %mypath
+include "toolbars.kvs" %mypath
#
# Set the default spam words...(for the anti-spam) detector
@@ -773,1492 +28,6 @@ toolbar.additem winops kvirc.minimizeallwindows
option stringlistSpamWords "http:","#","www.","auto","query","ftp:","sex","free","msg","chat","dynamirc","script"
-#
-# Here comes a nice part...
-# The popups. KVIrc has a lot of events that merely ask for a popup to be shown :)
-#
-defpopup(highlight)
-{
- prologue
- {
- if($0!=""){
- %:regName = $reguser.match($mask($0))
- %:beingHl = $reguser.property(%:regName,highlight)
- %:beingHlTmp = $tmphighlight.ishighlighted($0)
- }
- }
-
- item($tr("Stop Highlighting (Local)")) (%:beingHlTmp && !%:beingHl)
- {
- tmphighlight.remove $0
- }
-
- item($tr("Start Highlighting (Local)")) (!%:beingHlTmp && !%:beingHl)
- {
- tmphighlight.add $0
- }
-
- popup($tr("Always Highlight")) (!%:beingHl && !%:regName)
- {
- item($tr("Highlight as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "")
- {
- reguser.add $0 $mask($0,11); reguser.setproperty $0 highlight 1;
- }
-
- item($tr("Highlight as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "")
- {
- reguser.add $0 $mask($0,12); reguser.setproperty $0 highlight 1;
- }
-
- item($tr("Highlight as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "")
- {
- reguser.add $0 $mask($0,13); reguser.setproperty $0 highlight 1;
- }
-
- item($tr("Highlight as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "")
- {
- reguser.add $0 $mask($0,3); reguser.setproperty $0 highlight 1;
- }
-
- item($tr("Highlight as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "")
- {
- reguser.add $0 $mask($0,4); reguser.setproperty $0 highlight 1;
- }
-
- item($tr("Highlight as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "")
- {
- reguser.add $0 $mask($0,5); reguser.setproperty $0 highlight 1;
- }
- }
-
- item($tr("Always Highlight")) (!%:beingHl && %:regName)
- {
- reguser.setproperty $0 highlight 1
- }
-
- item($tr("Stop Highlighting")) (%:beingHl)
- {
- reguser.setproperty $0 highlight 0
- }
-}
-
-
-defpopup(ignore)
-{
- prologue
- {
- %:inIgnoreList = 0
- %:regName = $reguser.match($mask($0))
- %:ignLabelText = "<p><b>$0</b> "
- if(%:regName)
- {
- %:inIgnoreList = $reguser.isIgnoreEnabled(%:regName);
- if(%:inIgnoreList) {
- %:ignLabelText << $tr("is being ignored")
- } else {
- %:ignLabelText << $tr("is not being ignored")
- }
- %:ignLabelText << "</p>"
- } else {
- %:ignLabelText << $tr("is not being ignored")"</p>"
- }
- }
-
- label(%:ignLabelText)
-
- item($tr("Enable Ignore"),168) (!%:inIgnoreList && %:regName)
- {
- reguser.setIgnoreEnabled %:regName 1
- }
-
- popup($tr("Ignore as..."),44) (!%:inIgnoreList)
- {
- item($tr("Ignore as") $0 "("$mask($0,0)")") ("$reguser.exactMatch($mask($0,0))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,0);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,1)")") ("$reguser.exactMatch($mask($0,1))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,1);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,2)")") ("$reguser.exactMatch($mask($0,2))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,2);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,3);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,4);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,5);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,6)")") ("$reguser.exactMatch($mask($0,6))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,6);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,7)")") ("$reguser.exactMatch($mask($0,7))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,7);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,8)")") ("$reguser.exactMatch($mask($0,8))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,8);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,9)")") ("$reguser.exactMatch($mask($0,9))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,9);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,10)")") ("$reguser.exactMatch($mask($0,10))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,10);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,11);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,12);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,13);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,14)")") ("$reguser.exactMatch($mask($0,14))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,14);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,15)")") ("$reguser.exactMatch($mask($0,15))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,15);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,16)")") ("$reguser.exactMatch($mask($0,16))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,16);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,17)")") ("$reguser.exactMatch($mask($0,17))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,17);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,18)")") ("$reguser.exactMatch($mask($0,17))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,18);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,19)")") ("$reguser.exactMatch($mask($0,19))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,19);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,20)")") ("$reguser.exactMatch($mask($0,20))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,20);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,21)")") ("$reguser.exactMatch($mask($0,21))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,21);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,22)")") ("$reguser.exactMatch($mask($0,22))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,22);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,23)")") ("$reguser.exactMatch($mask($0,23))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,23);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,24)")") ("$reguser.exactMatch($mask($0,24))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,24);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,25)")") ("$reguser.exactMatch($mask($0,25))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,25);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
-
- item($tr("Ignore as") $0 "("$mask($0,26)")") ("$reguser.exactMatch($mask($0,26))" == "")
- {
- if(!%:regName) reguser.add $0 $mask($0,26);
- reguser.setIgnoreEnabled $0 1;
- reguser.setIgnoreFlags -p -c -n -t -i -d $0;
- }
- }
-
- item($tr("Unignore"),217) (%:inIgnoreList)
- {
- reguser.setIgnoreEnabled %:regName 0
- }
-}
-
-
-defpopup(registration)
-{
- prologue
- {
-
- # This is really smart...we are loading
- # the reguser module only if this popup is being requested (the user effectively
- # puts the mouse on the "Registration" item and the sub-popup is being shown)
- %:regName = $reguser.match($mask($0))
- %:labelText = "<p><b>$0</b>";
- if(%:regName)
- {
- %:labelText << $tr("is registered as") ": <b>"%:regName"</b>"
- # We want to display masks here!!!
- %:inNotifyList = $reguser.property(%:regName,notify);
- if(%:inNotifyList)%:labelText << "<br><b>$0</b>" $tr("is in the notify list")
- %:curAvatar = $avatar.name($0);
- %:defAvatar = $reguser.property(%:regName,avatar);
- if(%:defAvatar)%:labelText << "<br><b>$0</b>" $tr("has a default avatar")
- %:labelText << "</p>"
- } else {
- %:labelText << $tr("is not registered")"</p>"
- }
- }
-
- label(%:labelText)
-
- item($tr("Register")"...") (!%:regName)
- {
- reguser.wizard $mask($0)
- }
-
- popup($tr("Quick Registration")) (!%:regName)
- {
- item($tr("Register as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "")
- {
- reguser.add $0 $mask($0,11)
- }
-
- item($tr("Register as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "")
- {
- reguser.add $0 $mask($0,12)
- }
-
- item($tr("Register as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "")
- {
- reguser.add $0 $mask($0,13)
- }
-
- item($tr("Register as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "")
- {
- reguser.add $0 $mask($0,3)
- }
-
- item($tr("Register as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "")
- {
- reguser.add $0 $mask($0,4)
- }
-
- item($tr("Register as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "")
- {
- reguser.add $0 $mask($0,5)
- }
- }
-
- item($tr("Edit Registration")"...",113) (%:regName)
- {
- reguser.edit "%:regName"
- }
-
- item($tr("Unregister") %:regName) (%:regName)
- {
- reguser.remove "%:regName"
- }
-
- separator
-
- item($tr("Add to Notify")) (%:regName && !%:inNotifyList)
- {
- reguser.setproperty -n "%:regName" notify $0
- }
-
- item($tr("Remove from Notify")) (%:regName && %:inNotifyList)
- {
- reguser.setproperty -n "%:regName" notify
- }
-
- popup($tr("Avatar")) (%:regName)
- {
- item($tr("Choose")"...") (%:regName)
- {
- dialog.image(f,$tr("Choose Avatar Image File"),"","",$0,"%:regName")
- {
- if($0)
- {
- reguser.setproperty -a $2 avatar $0;
- }
- }
- }
-
- item($tr("Set as Default")) (%:curAvatar && ("%:curAvatar" != "%:defAvatar"))
- {
- reguser.setproperty "%:regName" avatar %:curAvatar
- }
-
- item($tr("Clear Default")) (%:defAvatar)
- {
- reguser.setproperty %:regName avatar
- # Force the avatar to update
- # if("%:curAvatar" == "")who $0
- }
- }
-}
-
-defpopup("urlpopup")
-{
- item($tr("Copy To Clipboard"),259)
- {
- str.toClipboard $0
- }
-}
-
-event(OnURLLinkPopupRequest,URL popup)
-{
- popup urlpopup $0
-}
-
-#
-# return a string with the name of the curerent usermode
-#
-alias(usermodename)
-{
- if(!$0)
- {
- echo $tr("Usage:")
- echo " /usermodename <nick>"
- halt;
- }
- if(!$channel)
- {
- echo "[USERMODENAME]: " $tr("This is not a channel window")
- halt;
- }
-
- if($chan.isOwner($0,$channel)){
- return $tr("Channel Owner")
- }else if($chan.isAdmin($0,$channel)){
- return $tr("Channel Administrator")
- }else if($chan.isOp($0,$channel)){
- return $tr("Channel Operator")
- }else if($chan.isHalfOp($0,$channel)){
- return $tr("Half Operator")
- }else if($chan.isVoice($0,$channel)){
- return $tr("Voice")
- }else if($chan.isUserOp($0,$channel)){
- return $tr("User Operator")
- }else{
- return $tr("Normal User")
- }
-}
-
-
-#
-# First of all we fiddle with the channel popup
-#
-
-# This code adds a channel popup that accepts
-# a comma separated list of nicknames as parameter (to the /popup command)
-
-defpopup(channel)
-{
- prologue
- {
- # we use the extended scope variables: they are visible in the entire defpopup scope
- # %:visible is the string that we will "show to the user" in the popup widget
- # for multiple users the string might become long so we are going to change it in "multiple users"
- %:visible = $0
- # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list
- # of multiple nicknames rather than a single nick
- %:multiple = 0
- # finally , set these variables
- %:itemBanName = $tr("Ban")
- if($str.findfirst(%:visible,",") != -1)
- {
- # found a comma in the $0 parameter...we have multiple nicknames
- %:visible = "("$tr("Multiple Users")")"
- %:multiple = 1
- %:itemBanMask = "*!user@*.host.tld"
- %:itemBanNick = "nick"
- } else {
- %:itemBanMask = $mask(%:visible,$option(uintDefaultBanType))
- if("%:itemBanMask" == "*!*@*")%:itemBanName = $tr("&Ban")
- %:itemBanNick = %:visible
- }
- # speed it up
-
- %:isMeHalfOp = $chan.isMeHalfOp()
- %:isMeOp = $chan.isMeOp()
- %:isMeOwner = $chan.isMeOwner()
- %:isMeAdmin = $chan.isMeAdmin()
- %:bCanKB = 0;
-
- if(%:isMeHalfOp)
- {
- foreach(%nick,$str.split(",",$0))
- {
- if($chan.usermodelevel(%nick) <= $chan.usermodelevel($me))
- {
- %:bCanKB = 1;
- break;
- }
- }
- }
- }
-
- item("/WHOIS" %:visible "("$tr("idle time")")",75,whois_item)
- {
- foreach(%i,$str.split(",",$0))
- whois %i %i
- }
-
- separator
-
- popup($tr("&Information"),49,"information_popup")
- {
- item("/WHOIS" %:visible,75,"whois_item")
- {
- whois $0
- }
-
- item(/WHOWAS %:visible,92)
- {
- whowas $0
- }
-
- item(/WHO %:visible,75)
- {
- who $0
- }
-
- separator
-
- item($tr("DNS for") %:visible,75)
- {
- foreach(%i,$str.split(",",$0))dns %i
- }
-
- item($tr("Mask for") %:visible,75) (!%:multiple)
- {
- echo $mask($0,11)
- }
- }
-
- popup($tr("&Control"),9,"control_popup") (%:isMeHalfOp)
- {
- label($usermodename($me()))
-
- item($tr("O&wner") %:visible,260) (%:isMeOwner)
- {
- chanowner $0
- }
-
- item($tr("&Deowner") %:visible,261) (%:isMeOwner)
- {
- dechanowner $0
- }
-
- item($tr("&Administrator") %:visible,242) (%:isMeAdmin)
- {
- chanadmin $0
- }
-
- item($tr("&Deadministrator") %:visible,243) (%:isMeAdmin)
- {
- dechanadmin $0
- }
-
- item($tr("&Op") %:visible,34) (%:isMeOp)
- {
- op $0
- }
-
- item($tr("&Deop") %:visible,62) (%:isMeOp)
- {
- deop $0
- }
-
- item($tr("&Halfop") %:visible,174) (%:isMeOp)
- {
- halfop $0
- }
-
- item($tr("&Dehalfop") %:visible,175) (%:isMeOp)
- {
- dehalfop $0
- }
-
- item($tr("&Voice") %:visible,35) (%:isMeHalfOp)
- {
- voice $0
- }
-
- item($tr("D&evoice") %:visible,63) (%:isMeHalfOp)
- {
- devoice $0
- }
-
- separator
-
- item($tr("&Kick") %:visible,110) (%:bCanKB)
- {
- foreach(%i,$str.split(",",$0))kick %i
- }
-
- item($tr("K&ick") %:visible $tr("With..."),110) (%:bCanKB)
- {
- dialog.textinput -d="$me" -i=110 ($tr("Kick Reason"),$tr("Enter a kick reason"),$tr("&Kick"),$tr("Cancel"),,$0)
- {
- if($0 == 0)
- {
- foreach(%i,$str.split(",",$2))kick %i $1
- }
- }
- }
-
- item($tr("&Ban") %:visible "("%:itemBanMask")",67) (("%:itemBanMask" != "*!*@*") && %:bCanKB)
- {
- ban $mask($0,$option(uintDefaultBanType))
- }
-
- item(%:itemBanName %:visible "("%:itemBanNick!*@*")",67) (%:bCanKB)
- {
- ban $0
- }
-
- item($tr("Kick/Ban") %:visible,110) (%:bCanKB)
- {
- kb $0
- }
-
- item($tr("Kick/Ban") %:visible $tr("With..."),110) (%:bCanKB)
- {
- dialog.textinput -d="$me" -i=110 ($tr("Kick/Ban Reason"),$tr("Enter a kick/ban reason"),$tr("&Kick/Ban"),$tr("Cancel"),,$0)
- {
- if($0 == 0)
- {
- kb $2 $1
- }
- }
- }
- separator
-
- item($tr("Configure ban mask..."),20)
- {
- options.edit KviChannelAdvancedOptionsWidget
- }
- }
-
- separator
-
- item($tr("&Query") %:visible,47)
- {
- query $0
- }
-
- separator
-
- extpopup(C&TCP,ctcp,51)
-
- extpopup(&DCC,dcc,77) (!%:multiple)
-
- separator
-
- extpopup($tr("&Registration"),registration,111) (!%:multiple)
-
- extpopup($tr("&Highlight"),highlight,181) (!%:multiple)
-
- extpopup($tr("Ig&nore"),ignore,203) (!%:multiple)
-
- item($tr("Notify Avatar"),57)
- {
- avatar.notify $0
- }
-}
-
-# now trigger the popup in the proper event handler
-event (OnChannelNickPopupRequest,default){ if($0 != "")popup channel $0; }
-
-# lets set also the default (double click) action
-event(OnChannelNickDefaultActionRequest,default){ if(!$isEmpty($0))query $0; }
-
-
-# Popup to show on right-clicking channel links
-#
-defpopup(channelpopup)
-{
- item($tr("&Join") $0,145)
- {
- hop $0
- }
-
- item($tr("&Part") $0,40)
- {
- if($channel($0)) part $0 $option(stringPartMessage);
- }
-
- separator
-
- item(/NAMES $0,75)
- {
- names $0;
- }
-
- item(/WHO $0,75)
- {
- who $0;
- }
- separator
-
- item($tr("Copy Channel Address"),259)
- {
- str.toClipboard $chan.getUrl($0)
- }
-
-}
-
-event (OnChannelLinkPopupRequest,default){ if($0 != "")popup channelpopup $0; }
-
-#
-# Lets work more on the channel: the main chanell popup
-# (right click on a channel text view)
-# We implement only a simple one: a nicer popup is left
-# as exercise for the reader.
-#
-
-event(OnChannelNickLinkClick,default)
-{
- if($0 != "")window.insertInInputText $window $0$option(stringNickCompletionPostfix)
-}
-
-defpopup(channels)
-{
- item(#KVirc,46)
- {
- j #KVirc
- }
-
- item(#MDE,46)
- {
- j #MDE
- }
-
- item(#kde,46)
- {
- j #kde
- }
-}
-
-defpopup(channeltextview)
-{
- extpopup($tr("Channels"),channels,46)
-
- item($tr("&Join Channels..."),46) ($server)
- {
- if($option(boolShowChannelsJoinDialogAsToplevel))channelsjoin.open -t;else channelsjoin.open
- }
-
- separator
-
- item($tr("&Hop") $0,145)
- {
- hop $0
- }
-
- item($tr("&Part") $0,40)
- {
- if($channel($0)) part $0 $option(stringPartMessage);
- }
-
- separator
-
- extpopup(C&TCP,ctcp,51)
-
- separator
-
- item(/NAMES $0,75)
- {
- names $0;
- }
-
- item(/WHO $0,75)
- {
- who $0;
- }
-
- item($tr("Notify Avatar"),57)
- {
- avatar.notify $0
- }
-
- separator
-
- item($tr("Copy Channel URL to Clipboard"),259)
- {
- str.toClipboard $chan.getUrl
- }
-
- item($tr("Clear Buffer"),121)
- {
- clear;
- }
-
-}
-
-
-# trigger it on the proper event handler
-event (OnChannelPopupRequest,default){ popup channeltextview $target; }
-
-defpopup(consoletextview)
-{
- label($tr("You're not connected to a server")) (!$server)
-
- extpopup($tr("Channels"),channels,46)
-
- separator
-
- item($tr("&Join Channels..."),46) ($server)
- {
- if($option(boolShowChannelsJoinDialogAsToplevel))channelsjoin.open -t;else channelsjoin.open
- }
-
- popup($tr("&Information"),13) ($server)
- {
- item(/MOTD,30)
- {
- motd
- }
-
- item(/INFO,29)
- {
- info
- }
-
- item(/LUSERS,57)
- {
- lusers
- }
-
- popup(/STATS,22)
- {
- item(d "(Debug/DNS?)")
- {
- stats d
- }
-
- item($tr("l (Connections)"))
- {
- stats l
- }
-
- item($tr("m (Command Usage)"))
- {
- stats m
- }
-
- item($tr("o (Operators)"))
- {
- stats o
- }
-
- item($tr("t (Connection stats ?)"),23)
- {
- stats t
- }
-
- item($tr("u (Uptime)"),93)
- {
- stats u
- }
-
- item($tr("y (y-Lines)"))
- {
- stats y
- }
-
- item($tr("z (Debug Stats?)"),11)
- {
- stats z
- }
- }
-
- item(/TIME,93)
- {
- time
- }
-
- item(/ADMIN,29)
- {
- admin
- }
-
- item(/VERSION,16)
- {
- version
- }
-
- item(/HELP,49)
- {
- raw help
- }
- }
-
- separator
-
- item($tr("Clear Buffer"),121)
- {
- clear;
- }
-}
-event(OnConsolePopupRequest,default){ popup consoletextview; }
-
-# This is a common popup , accepts a list of nicknames as parameter
-defpopup(ctcp)
-{
- item(PING,36)
- {
- ctcp $0 PING
- }
-
- item(FINGER,53)
- {
- ctcp $0 FINGER
- }
-
- item(VERSION,16)
- {
- ctcp $0 VERSION
- }
-
- item(USERINFO,57)
- {
- ctcp $0 USERINFO
- }
-
- item(CLIENTINFO,52)
- {
- ctcp $0 CLIENTINFO
- }
-
- item(SOURCE,14)
- {
- ctcp $0 SOURCE
- }
-
- item(TIME,93)
- {
- ctcp $0 TIME
- }
-
- item(PAGE...,223)
- {
- #dialog.textinput -d="Wakeup!" ($tr("CTCP Page to") $0,$tr("Enter the message text"),$tr("Ok"),$tr("Cancel"))
- dialog.textinput(CTCP Page $0,Enter the message text,&Page,Cancel,"",$0)
- {
- if($0 == 0)ctcp $2 PAGE $1
- }
- }
-
- item(AVATAR,57)
- {
- ctcp $0 AVATAR
- }
-}
-
-defpopup(dcc)
-{
- prologue
- {
-
- if($features("SSL"))%:bHaveSSL=1
- else %:bHaveSSL=0
- }
-
- item($tr("Chat with") $0,78)
- {
- dcc.chat $0
- }
-
- item($tr("Reverse Chat with") $0,78)
- {
- dcc.chat -z $0
- }
-
- item($tr("Secure Chat with") $0,78) (%:bHaveSSL)
- {
- dcc.chat -s $0
- }
-
- separator
-
- item($tr("Send to") $0,79)
- {
- dcc.send $0
- }
-
- item($tr("Secure send to") $0,79)
- {
- dcc.send -s $0
- }
-
- item($tr("Reverse Send to") $0,79)
- {
- dcc.rsend -z $0
- }
-
- item($tr("Secure Reverse Send to") $0,79)
- {
- dcc.rsend -z -s $0
- }
-
- separator
-
- item($tr("TDCC Send to") $0,77)
- {
- dcc.send -t $0
- }
-
- item($tr("TDCC Reverse Send to") $0,77)
- {
- dcc.rsend -t $0
- }
-
- separator
-
- popup($tr("Voice Chat"),166)
- {
- item($tr("Default")": ADPCM 8 KHz (32 kbps)")
- {
- dcc.voice $0
- }
-
- separator
-
- item("ADPCM 11.025 KHz (44.1 kbps)")
- {
- dcc.voice -h=11025 $0
- }
-
- item("ADPCM 16 KHz (64 kbps)")
- {
- dcc.voice -h=16000 $0
- }
-
- item("ADPCM 22.05 KHz (88.2 kbps)")
- {
- dcc.voice -h=22050 $0
- }
-
- item("GSM 8 KHz (13.2 kbps)")
- {
- dcc.voice -g=gsm $0
- }
-
- item("GSM 11.025 KHz (18.1 kbps)")
- {
- dcc.voice -g=gsm -h=11025 $0
- }
-
- item("GSM 16 KHz (26.4 kbps)")
- {
- dcc.voice -g=gsm -h=16000 $0
- }
-
- item("GSM 22.05 KHz (36.2 kbps)")
- {
- dcc.voice -g=gsm -h=22050 $0
- }
-
- item("GSM 44.1 KHz (72.4 kbps)")
- {
- dcc.voice -g=gsm -h=44100 $0
- }
-
- item("NULL 8 KHz (128 kbps)")
- {
- dcc.voice -g=null $0
- }
-
- item("NULL 11.025 KHz (176.4 kbps)")
- {
- dcc.voice -g=null -h=11025 $0
- }
- }
-}
-
-defpopup(dccchat)
-{
- prologue
- {
-
- # we use the extended scope variables: they are visible in the entire defpopup scope
- # %:visible is the string that we will "show to the user" in the popup widget
- # for multiple users the string might become long so we are going to change it in "multiple users"
- %:visible = $0
- # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list
- # of multiple nicknames rather than a single nick
- %:multiple = 0
- # finally , set these variables
- if($str.findfirst(%:visible,",") != -1)
- {
- # found a comma in the $0 parameter...we have multiple nicknames
- %:visible = "("$tr("Multiple Users")")"
- %:multiple = 1
- }
- }
-
- separator
-
- extpopup(C&TCP,ctcp,51)
-
- extpopup(&DCC,dcc,77)
-
- separator
-
- item($tr("Notify Avatar"),57)
- {
- avatar.notify $0
- }
-
- separator
-
- item($tr("Clear Buffer"),121)
- {
- clear
- }
-}
-
-
-event (OnDccChatPopupRequest,default){ popup dccchat $0; }
-
-#
-# Some minimal work on the query
-# A text view popup (right click on a query view)
-#
-
-defpopup(querytextview)
-{
- prologue
- {
-
- # we use the extended scope variables: they are visible in the entire defpopup scope
- # %:visible is the string that we will "show to the user" in the popup widget
- # for multiple users the string might become long so we are going to change it in "multiple users"
- %:visible = $0
- # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list
- # of multiple nicknames rather than a single nick
- %:multiple = 0
- # finally , set these variables
- if($str.findfirst(%:visible,",") != -1)
- {
- # found a comma in the $0 parameter...we have multiple nicknames
- %:visible = "("$tr("Multiple Users")")"
- %:multiple = 1
- }
- }
-
- item(/WHOIS $0 "("$tr("idle time")")",75) (!%:multiple)
- {
- whois $0 $0
- }
-
- separator
-
- popup($tr("&Information"),49)
- {
- item(/WHOIS $0,75)
- {
- whois $0
- }
-
- item(/WHOWAS $0,92)
- {
- whowas $0
- }
-
- item(/WHO $0,75)
- {
- who $0
- }
-
- separator
-
- item($tr("DNS for") $0,75)
- {
- foreach(%i,$str.split(",",$0))dns %i
- }
-
- item($tr("Mask for") $0,75) (!%:multiple)
- {
- echo $mask($0,11)
- }
- }
-
- separator
-
- extpopup(C&TCP,ctcp,51)
-
- extpopup(&DCC,dcc,77)
-
- separator
-
- extpopup($tr("&Ignore"),ignore,203) (!%:multiple)
-
- extpopup($tr("&Registration"),registration,111) (!%:multiple)
-
- item($tr("Notify Avatar"),57)
- {
- avatar.notify $0
- }
-
- separator
-
- item($tr("Clear Buffer"),121)
- {
- clear
- }
-}
-
-
-event (OnQueryPopupRequest,default){ if($target)popup querytextview $target; }
-event (OnQueryNickPopupRequest,default){ if($0 != "")popup querytextview $0; }
-event (OnQueryFileDropped,default){ if($0 != "")dcc.send $target $0; }
-event (OnNickLinkDefaultActionRequest,default){ if($0 != "")whois $0; }
-event (OnNickLinkPopupRequest,default) { if($0 != "")popup defaulttextview $0; }
-event (OnNotifyListDefaultActionRequest,default){ if($0 != ""){ query $0; whois $0 $0; } }
-event (OnNotifyListPopupRequest,default){ if($0 != "")popup defaulttextview $0; };
-
-
-############################################################################################################
-#
-# Logging popup for the windows
-#
-############################################################################################################
-defpopup(logging)
-{
- prologue
- {
-
- # If this window is being logged actually , $log.file will be non empty
- # and pointing to the log file actually open.
- %:logfile = $str.replace($log.file,,$file.localdir)
- }
-
- label($tr("Logging to"):<br><b>%:logfile</b>) ("%:logfile" != "")
-
- item($tr("Flush Log File"),19) (%:logfile)
- {
- log.flush
- }
-
- separator
-
- item($tr("Stop Logging"),58) (%:logfile)
- {
- log.stop
- }
-
- label($tr("Not Logging")) (!%:logfile)
-
- item($tr("Log To Default File"),119) (!%:logfile)
- {
- log.start
- }
-
- item($tr("Log To Default File") "("$tr("Include Existing Buffer")")",119) (!%:logfile)
- {
- log.start -p
- }
-
- item($tr("Log To..."),119) (!%:logfile)
- {
- dialog.file(save,$tr("Choose Log Filename"))
- {
- if($0)log.start $0
- }
- }
-
- item($tr("Log To...") "("$tr("Include Existing Buffer"),119) (!%:logfile)
- {
- dialog.file(save,$tr("Choose Log Filename"))
- {
- if($0)log.start -p $0
- }
- }
-}
-
-
-event(OnChannelWindowCreated,default)
-{
- button(w,Logging,119,Logging){ popup -p=$0,$1 logging; }
-}
-
-event(OnQueryWindowCreated,default)
-{
- button(w,Logging,119,Logging){ popup -p=$0,$1 logging; }
-}
-
-
-# DEFAULT TOOLBAR
-
-defpopup(defaulttextview)
-{
- prologue
- {
-
- # we use the extended scope variables: they are visible in the entire defpopup scope
- # %:visible is the string that we will "show to the user" in the popup widget
- # for multiple users the string might become long so we are going to change it in "multiple users"
- %:visible = $0
- # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list
- # of multiple nicknames rather than a single nick
- %:multiple = 0
- # finally , set these variables
- if($str.findfirst(%:visible,",") != -1)
- {
- # found a comma in the $0 parameter...we have multiple nicknames
- %:visible = "("$tr("Multiple Users")")"
- %:multiple = 1
- }
- }
-
- item(/WHOIS $0 "("$tr("idle time")")",75) (!%:multiple)
- {
- whois $0 $0
- }
-
- separator
-
- popup($tr("&Information"),49)
- {
- item(/WHOIS $0,75)
- {
- whois $0
- }
-
- item(/WHOWAS $0,92)
- {
- whowas $0
- }
-
- item(/WHO $0,75)
- {
- who $0
- }
-
- separator
-
- item(DNS $0,75)
- {
- foreach(%i,$str.split(",",$0))dns %i
- }
- }
-
- separator
-
- item($tr("&Query") %:visible,47)
- {
- query $0
- }
-
- separator
-
- extpopup(C&TCP,ctcp,51)
-
- extpopup(&DCC,dcc,77)
-
- separator
-
- extpopup($tr("&Registration"),registration,111) (!%:multiple)
-
- extpopup($tr("&Highlight"),highlight,181) (!%:multiple)
-
- extpopup($tr("Ig&nore"),ignore,203) (!%:multiple)
-
- item($tr("Notify avatar"),57)
- {
- avatar.notify $0
- }
-
- separator
-
- item($tr("Clear Buffer"),121)
- {
- clear
- }
-}
-
-file.addimagepath %mypath/pics/
-
-#
-# FIXME: Add uninstall part:
-# file.delimagepath
-#
-
-
-#
-# A default popup for the middle click in a text view
-# This should manage logging , buffer saving and other
-# stuff common to ALL windows
-#
-
-defpopup(windowpopup)
-{
- extpopup(Logging,logging,119)
-
-# popup(Buffer)
-# {
-# item("Save to file...")window.savebuffer
-# item("Clear")window.clear
-# item("Find...")window.findtext
-# }
-# popup(View)
-# {
-# item("Show images")($window.images == 0)window.images 1
-# item("Enable timestamps")($window.timestamp == 0)window.timestamp 1
-# item("Disable timestamps")($window.timestam == 1)window.timestamp 0
-# item("Set font...")$window.setfont
-# item("Set background...")$window.setbackground
-# }
-# popup(Mdi)
-# {
-# item("Minimize")window.minimize
-# item("Maximize")window.maximize
-# }
-}
-
-event (OnWindowPopupRequest,default){ popup windowpopup; }
-
-
-# Host link popup
-
-defpopup(hostpopup)
-{
- item(Look Up $0,13)
- {
- host -a $0
- }
-
- separator
-
- item(Open ftp://$0/,145) ("$system.ostype" == "unix")
- {
- openurl ftp://$0/
- }
-
- item(Telnet to $0,25)
- {
- if("$system.ostype" == "unix")run xterm -e telnet $0
- else run telnet $0
- }
-
- separator
-
- item(Traceroute $0,42)
- {
- if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Traceroute to $0...\" && traceroute $0 && cat"
- else run tracert $0
- }
-
- item(Traceroute6 $0,42)
- {
- if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Traceroute (inet6) to $0...\" && traceroute6 $0 && cat"
- else run tracert6 $0
- }
-
- item(Ping $0,147)
- {
- if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Ping $0...\" && ping $0 && cat"
- else run ping $0
- }
-
- item(Ping6 $0,147)
- {
- if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Ping (inet6) $0...\" && ping6 $0 && cat"
- else run ping6 $0
- }
-}
-event (OnHostLinkPopupRequest,default){ popup hostpopup $0; }
-
options.save
echo $tr("The default script has been successfully installed.")
diff --git a/data/defscript/events.kvs b/data/defscript/events.kvs
new file mode 100644
index 000000000..575cfc393
--- /dev/null
+++ b/data/defscript/events.kvs
@@ -0,0 +1,105 @@
+# Default events file
+
+event(OnDccChatPopupRequest,default)
+{
+ popup dccchat $0;
+}
+
+event(OnChannelPopupRequest,default)
+{
+ popup channeltextview $target;
+}
+
+event(OnConsolePopupRequest,default)
+{
+ popup consoletextview;
+}
+
+event(OnChannelLinkPopupRequest,default)
+{
+ if($0 != "") popup channelpopup $0;
+}
+
+event(OnQueryPopupRequest,default)
+{
+ if($target) popup querytextview $target;
+}
+
+event(OnQueryNickPopupRequest,default)
+{
+ if($0 != "") popup querytextview $0;
+}
+
+event(OnQueryFileDropped,default)
+{
+ if($0 != "") dcc.send $target $0;
+}
+
+event(OnNickLinkDefaultActionRequest,default)
+{
+ if($0 != "") whois $0;
+}
+
+event(OnNickLinkPopupRequest,default)
+{
+ if($0 != "") popup defaulttextview $0;
+}
+
+event(OnNotifyListDefaultActionRequest,default)
+{
+ if($0 != "")
+ {
+ query $0; whois $0 $0;
+ }
+}
+
+event(OnNotifyListPopupRequest,default)
+{
+ if($0 != "") popup defaulttextview $0;
+};
+
+event(OnWindowPopupRequest,default)
+{
+ popup windowpopup;
+}
+
+event(OnChannelWindowCreated,default)
+{
+ button(w,Logging,119,Logging)
+ {
+ popup -p=$0,$1 logging;
+ }
+}
+
+event(OnQueryWindowCreated,default)
+{
+ button(w,Logging,119,Logging)
+ {
+ popup -p=$0,$1 logging;
+ }
+}
+
+event(OnChannelNickLinkClick,default)
+{
+ if($0 != "") window.insertInInputText $window $0$option(stringNickCompletionPostfix);
+}
+
+event(OnChannelNickPopupRequest,default)
+{
+ if($0 != "") popup channel $0;
+}
+
+event(OnChannelNickDefaultActionRequest,default)
+{
+ if(!$isEmpty($0)) query $0;
+}
+
+event(OnURLLinkPopupRequest,URL popup)
+{
+ popup urlpopup $0
+}
+
+event(OnHostLinkPopupRequest,default)
+{
+ popup hostpopup $0;
+}
diff --git a/data/defscript/popups.kvs b/data/defscript/popups.kvs
new file mode 100644
index 000000000..0c5d3067c
--- /dev/null
+++ b/data/defscript/popups.kvs
@@ -0,0 +1,1383 @@
+# Default popups file
+
+#
+# Here comes a nice part...
+# The popups. KVIrc has a lot of events that merely ask for a popup to be shown :)
+#
+defpopup(highlight)
+{
+ prologue
+ {
+ if($0!=""){
+ %:regName = $reguser.match($mask($0))
+ %:beingHl = $reguser.property(%:regName,highlight)
+ %:beingHlTmp = $tmphighlight.ishighlighted($0)
+ }
+ }
+
+ item($tr("Stop Highlighting (Local)")) (%:beingHlTmp && !%:beingHl)
+ {
+ tmphighlight.remove $0
+ }
+
+ item($tr("Start Highlighting (Local)")) (!%:beingHlTmp && !%:beingHl)
+ {
+ tmphighlight.add $0
+ }
+
+ popup($tr("Always Highlight")) (!%:beingHl && !%:regName)
+ {
+ item($tr("Highlight as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "")
+ {
+ reguser.add $0 $mask($0,11); reguser.setproperty $0 highlight 1;
+ }
+
+ item($tr("Highlight as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "")
+ {
+ reguser.add $0 $mask($0,12); reguser.setproperty $0 highlight 1;
+ }
+
+ item($tr("Highlight as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "")
+ {
+ reguser.add $0 $mask($0,13); reguser.setproperty $0 highlight 1;
+ }
+
+ item($tr("Highlight as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "")
+ {
+ reguser.add $0 $mask($0,3); reguser.setproperty $0 highlight 1;
+ }
+
+ item($tr("Highlight as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "")
+ {
+ reguser.add $0 $mask($0,4); reguser.setproperty $0 highlight 1;
+ }
+
+ item($tr("Highlight as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "")
+ {
+ reguser.add $0 $mask($0,5); reguser.setproperty $0 highlight 1;
+ }
+ }
+
+ item($tr("Always Highlight")) (!%:beingHl && %:regName)
+ {
+ reguser.setproperty $0 highlight 1
+ }
+
+ item($tr("Stop Highlighting")) (%:beingHl)
+ {
+ reguser.setproperty $0 highlight 0
+ }
+}
+
+defpopup(ignore)
+{
+ prologue
+ {
+ %:inIgnoreList = 0
+ %:regName = $reguser.match($mask($0))
+ %:ignLabelText = "<p><b>$0</b> "
+ if(%:regName)
+ {
+ %:inIgnoreList = $reguser.isIgnoreEnabled(%:regName);
+ if(%:inIgnoreList) {
+ %:ignLabelText << $tr("is being ignored")
+ } else {
+ %:ignLabelText << $tr("is not being ignored")
+ }
+ %:ignLabelText << "</p>"
+ } else {
+ %:ignLabelText << $tr("is not being ignored")"</p>"
+ }
+ }
+
+ label(%:ignLabelText)
+
+ item($tr("Enable Ignore"),168) (!%:inIgnoreList && %:regName)
+ {
+ reguser.setIgnoreEnabled %:regName 1
+ }
+
+ popup($tr("Ignore as..."),44) (!%:inIgnoreList)
+ {
+ item($tr("Ignore as") $0 "("$mask($0,0)")") ("$reguser.exactMatch($mask($0,0))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,0);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,1)")") ("$reguser.exactMatch($mask($0,1))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,1);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,2)")") ("$reguser.exactMatch($mask($0,2))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,2);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,3);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,4);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,5);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,6)")") ("$reguser.exactMatch($mask($0,6))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,6);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,7)")") ("$reguser.exactMatch($mask($0,7))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,7);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,8)")") ("$reguser.exactMatch($mask($0,8))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,8);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,9)")") ("$reguser.exactMatch($mask($0,9))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,9);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,10)")") ("$reguser.exactMatch($mask($0,10))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,10);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,11);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,12);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,13);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,14)")") ("$reguser.exactMatch($mask($0,14))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,14);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,15)")") ("$reguser.exactMatch($mask($0,15))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,15);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,16)")") ("$reguser.exactMatch($mask($0,16))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,16);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,17)")") ("$reguser.exactMatch($mask($0,17))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,17);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,18)")") ("$reguser.exactMatch($mask($0,17))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,18);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,19)")") ("$reguser.exactMatch($mask($0,19))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,19);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,20)")") ("$reguser.exactMatch($mask($0,20))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,20);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,21)")") ("$reguser.exactMatch($mask($0,21))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,21);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,22)")") ("$reguser.exactMatch($mask($0,22))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,22);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,23)")") ("$reguser.exactMatch($mask($0,23))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,23);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,24)")") ("$reguser.exactMatch($mask($0,24))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,24);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,25)")") ("$reguser.exactMatch($mask($0,25))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,25);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+
+ item($tr("Ignore as") $0 "("$mask($0,26)")") ("$reguser.exactMatch($mask($0,26))" == "")
+ {
+ if(!%:regName) reguser.add $0 $mask($0,26);
+ reguser.setIgnoreEnabled $0 1;
+ reguser.setIgnoreFlags -p -c -n -t -i -d $0;
+ }
+ }
+
+ item($tr("Unignore"),217) (%:inIgnoreList)
+ {
+ reguser.setIgnoreEnabled %:regName 0
+ }
+}
+
+defpopup(registration)
+{
+ prologue
+ {
+
+ # This is really smart...we are loading
+ # the reguser module only if this popup is being requested (the user effectively
+ # puts the mouse on the "Registration" item and the sub-popup is being shown)
+ %:regName = $reguser.match($mask($0))
+ %:labelText = "<p><b>$0</b>";
+ if(%:regName)
+ {
+ %:labelText << $tr("is registered as") ": <b>"%:regName"</b>"
+ # We want to display masks here!!!
+ %:inNotifyList = $reguser.property(%:regName,notify);
+ if(%:inNotifyList)%:labelText << "<br><b>$0</b>" $tr("is in the notify list")
+ %:curAvatar = $avatar.name($0);
+ %:defAvatar = $reguser.property(%:regName,avatar);
+ if(%:defAvatar)%:labelText << "<br><b>$0</b>" $tr("has a default avatar")
+ %:labelText << "</p>"
+ } else {
+ %:labelText << $tr("is not registered")"</p>"
+ }
+ }
+
+ label(%:labelText)
+
+ item($tr("Register")"...") (!%:regName)
+ {
+ reguser.wizard $mask($0)
+ }
+
+ popup($tr("Quick Registration")) (!%:regName)
+ {
+ item($tr("Register as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "")
+ {
+ reguser.add $0 $mask($0,11)
+ }
+
+ item($tr("Register as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "")
+ {
+ reguser.add $0 $mask($0,12)
+ }
+
+ item($tr("Register as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "")
+ {
+ reguser.add $0 $mask($0,13)
+ }
+
+ item($tr("Register as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "")
+ {
+ reguser.add $0 $mask($0,3)
+ }
+
+ item($tr("Register as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "")
+ {
+ reguser.add $0 $mask($0,4)
+ }
+
+ item($tr("Register as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "")
+ {
+ reguser.add $0 $mask($0,5)
+ }
+ }
+
+ item($tr("Edit Registration")"...",113) (%:regName)
+ {
+ reguser.edit "%:regName"
+ }
+
+ item($tr("Unregister") %:regName) (%:regName)
+ {
+ reguser.remove "%:regName"
+ }
+
+ separator
+
+ item($tr("Add to Notify")) (%:regName && !%:inNotifyList)
+ {
+ reguser.setproperty -n "%:regName" notify $0
+ }
+
+ item($tr("Remove from Notify")) (%:regName && %:inNotifyList)
+ {
+ reguser.setproperty -n "%:regName" notify
+ }
+
+ popup($tr("Avatar")) (%:regName)
+ {
+ item($tr("Choose")"...") (%:regName)
+ {
+ dialog.image(f,$tr("Choose Avatar Image File"),"","",$0,"%:regName")
+ {
+ if($0)
+ {
+ reguser.setproperty -a $2 avatar $0;
+ }
+ }
+ }
+
+ item($tr("Set as Default")) (%:curAvatar && ("%:curAvatar" != "%:defAvatar"))
+ {
+ reguser.setproperty "%:regName" avatar %:curAvatar
+ }
+
+ item($tr("Clear Default")) (%:defAvatar)
+ {
+ reguser.setproperty %:regName avatar
+ # Force the avatar to update
+ # if("%:curAvatar" == "")who $0
+ }
+ }
+}
+
+defpopup("urlpopup")
+{
+ item($tr("Copy To Clipboard"),259)
+ {
+ str.toClipboard $0
+ }
+}
+
+# This code adds a channel popup that accepts
+# a comma separated list of nicknames as parameter (to the /popup command)
+
+defpopup(channel)
+{
+ prologue
+ {
+ # we use the extended scope variables: they are visible in the entire defpopup scope
+ # %:visible is the string that we will "show to the user" in the popup widget
+ # for multiple users the string might become long so we are going to change it in "multiple users"
+ %:visible = $0
+ # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list
+ # of multiple nicknames rather than a single nick
+ %:multiple = 0
+ # finally , set these variables
+ %:itemBanName = $tr("Ban")
+ if($str.findfirst(%:visible,",") != -1)
+ {
+ # found a comma in the $0 parameter...we have multiple nicknames
+ %:visible = "("$tr("Multiple Users")")"
+ %:multiple = 1
+ %:itemBanMask = "*!user@*.host.tld"
+ %:itemBanNick = "nick"
+ } else {
+ %:itemBanMask = $mask(%:visible,$option(uintDefaultBanType))
+ if("%:itemBanMask" == "*!*@*")%:itemBanName = $tr("&Ban")
+ %:itemBanNick = %:visible
+ }
+ # speed it up
+
+ %:isMeHalfOp = $chan.isMeHalfOp()
+ %:isMeOp = $chan.isMeOp()
+ %:isMeOwner = $chan.isMeOwner()
+ %:isMeAdmin = $chan.isMeAdmin()
+ %:bCanKB = 0;
+
+ if(%:isMeHalfOp)
+ {
+ foreach(%nick,$str.split(",",$0))
+ {
+ if($chan.usermodelevel(%nick) <= $chan.usermodelevel($me))
+ {
+ %:bCanKB = 1;
+ break;
+ }
+ }
+ }
+ }
+
+ item("/WHOIS" %:visible "("$tr("idle time")")",75,whois_item)
+ {
+ foreach(%i,$str.split(",",$0))
+ whois %i %i
+ }
+
+ separator
+
+ popup($tr("&Information"),49,"information_popup")
+ {
+ item("/WHOIS" %:visible,75,"whois_item")
+ {
+ whois $0
+ }
+
+ item(/WHOWAS %:visible,92)
+ {
+ whowas $0
+ }
+
+ item(/WHO %:visible,75)
+ {
+ who $0
+ }
+
+ separator
+
+ item($tr("DNS for") %:visible,75)
+ {
+ foreach(%i,$str.split(",",$0))dns %i
+ }
+
+ item($tr("Mask for") %:visible,75) (!%:multiple)
+ {
+ echo $mask($0,11)
+ }
+ }
+
+ popup($tr("&Control"),9,"control_popup") (%:isMeHalfOp)
+ {
+ label($usermodename($me()))
+
+ item($tr("O&wner") %:visible,260) (%:isMeOwner)
+ {
+ chanowner $0
+ }
+
+ item($tr("&Deowner") %:visible,261) (%:isMeOwner)
+ {
+ dechanowner $0
+ }
+
+ item($tr("&Administrator") %:visible,242) (%:isMeAdmin)
+ {
+ chanadmin $0
+ }
+
+ item($tr("&Deadministrator") %:visible,243) (%:isMeAdmin)
+ {
+ dechanadmin $0
+ }
+
+ item($tr("&Op") %:visible,34) (%:isMeOp)
+ {
+ op $0
+ }
+
+ item($tr("&Deop") %:visible,62) (%:isMeOp)
+ {
+ deop $0
+ }
+
+ item($tr("&Halfop") %:visible,174) (%:isMeOp)
+ {
+ halfop $0
+ }
+
+ item($tr("&Dehalfop") %:visible,175) (%:isMeOp)
+ {
+ dehalfop $0
+ }
+
+ item($tr("&Voice") %:visible,35) (%:isMeHalfOp)
+ {
+ voice $0
+ }
+
+ item($tr("D&evoice") %:visible,63) (%:isMeHalfOp)
+ {
+ devoice $0
+ }
+
+ separator
+
+ item($tr("&Kick") %:visible,110) (%:bCanKB)
+ {
+ foreach(%i,$str.split(",",$0))kick %i
+ }
+
+ item($tr("K&ick") %:visible $tr("With..."),110) (%:bCanKB)
+ {
+ dialog.textinput -d="$me" -i=110 ($tr("Kick Reason"),$tr("Enter a kick reason"),$tr("&Kick"),$tr("Cancel"),,$0)
+ {
+ if($0 == 0)
+ {
+ foreach(%i,$str.split(",",$2))kick %i $1
+ }
+ }
+ }
+
+ item($tr("&Ban") %:visible "("%:itemBanMask")",67) (("%:itemBanMask" != "*!*@*") && %:bCanKB)
+ {
+ ban $mask($0,$option(uintDefaultBanType))
+ }
+
+ item(%:itemBanName %:visible "("%:itemBanNick!*@*")",67) (%:bCanKB)
+ {
+ ban $0
+ }
+
+ item($tr("Kick/Ban") %:visible,110) (%:bCanKB)
+ {
+ kb $0
+ }
+
+ item($tr("Kick/Ban") %:visible $tr("With..."),110) (%:bCanKB)
+ {
+ dialog.textinput -d="$me" -i=110 ($tr("Kick/Ban Reason"),$tr("Enter a kick/ban reason"),$tr("&Kick/Ban"),$tr("Cancel"),,$0)
+ {
+ if($0 == 0)
+ {
+ kb $2 $1
+ }
+ }
+ }
+ separator
+
+ item($tr("Configure ban mask..."),20)
+ {
+ options.edit KviChannelAdvancedOptionsWidget
+ }
+ }
+
+ separator
+
+ item($tr("&Query") %:visible,47)
+ {
+ query $0
+ }
+
+ separator
+
+ extpopup(C&TCP,ctcp,51)
+
+ extpopup(&DCC,dcc,77) (!%:multiple)
+
+ separator
+
+ extpopup($tr("&Registration"),registration,111) (!%:multiple)
+
+ extpopup($tr("&Highlight"),highlight,181) (!%:multiple)
+
+ extpopup($tr("Ig&nore"),ignore,203) (!%:multiple)
+
+ item($tr("Notify Avatar"),57)
+ {
+ avatar.notify $0
+ }
+}
+
+# Popup to show on right-clicking channel links
+#
+defpopup(channelpopup)
+{
+ item($tr("&Join") $0,145)
+ {
+ hop $0
+ }
+
+ item($tr("&Part") $0,40)
+ {
+ if($channel($0)) part $0 $option(stringPartMessage);
+ }
+
+ separator
+
+ item(/NAMES $0,75)
+ {
+ names $0;
+ }
+
+ item(/WHO $0,75)
+ {
+ who $0;
+ }
+ separator
+
+ item($tr("Copy Channel Address"),259)
+ {
+ str.toClipboard $chan.getUrl($0)
+ }
+
+}
+
+defpopup(channels)
+{
+ item(#KVirc,46)
+ {
+ j #KVirc
+ }
+
+ item(#MDE,46)
+ {
+ j #MDE
+ }
+
+ item(#kde,46)
+ {
+ j #kde
+ }
+}
+
+defpopup(channeltextview)
+{
+ extpopup($tr("Channels"),channels,46)
+
+ item($tr("&Join Channels..."),46) ($server)
+ {
+ if($option(boolShowChannelsJoinDialogAsToplevel))channelsjoin.open -t;else channelsjoin.open
+ }
+
+ separator
+
+ item($tr("&Hop") $0,145)
+ {
+ hop $0
+ }
+
+ item($tr("&Part") $0,40)
+ {
+ if($channel($0)) part $0 $option(stringPartMessage);
+ }
+
+ separator
+
+ extpopup(C&TCP,ctcp,51)
+
+ separator
+
+ item(/NAMES $0,75)
+ {
+ names $0;
+ }
+
+ item(/WHO $0,75)
+ {
+ who $0;
+ }
+
+ item($tr("Notify Avatar"),57)
+ {
+ avatar.notify $0
+ }
+
+ separator
+
+ item($tr("Copy Channel URL to Clipboard"),259)
+ {
+ str.toClipboard $chan.getUrl
+ }
+
+ item($tr("Clear Buffer"),121)
+ {
+ clear;
+ }
+
+}
+
+defpopup(consoletextview)
+{
+ label($tr("You're not connected to a server")) (!$server)
+
+ extpopup($tr("Channels"),channels,46)
+
+ separator
+
+ item($tr("&Join Channels..."),46) ($server)
+ {
+ if($option(boolShowChannelsJoinDialogAsToplevel))channelsjoin.open -t;else channelsjoin.open
+ }
+
+ popup($tr("&Information"),13) ($server)
+ {
+ item(/MOTD,30)
+ {
+ motd
+ }
+
+ item(/INFO,29)
+ {
+ info
+ }
+
+ item(/LUSERS,57)
+ {
+ lusers
+ }
+
+ popup(/STATS,22)
+ {
+ item(d "(Debug/DNS?)")
+ {
+ stats d
+ }
+
+ item($tr("l (Connections)"))
+ {
+ stats l
+ }
+
+ item($tr("m (Command Usage)"))
+ {
+ stats m
+ }
+
+ item($tr("o (Operators)"))
+ {
+ stats o
+ }
+
+ item($tr("t (Connection stats ?)"),23)
+ {
+ stats t
+ }
+
+ item($tr("u (Uptime)"),93)
+ {
+ stats u
+ }
+
+ item($tr("y (y-Lines)"))
+ {
+ stats y
+ }
+
+ item($tr("z (Debug Stats?)"),11)
+ {
+ stats z
+ }
+ }
+
+ item(/TIME,93)
+ {
+ time
+ }
+
+ item(/ADMIN,29)
+ {
+ admin
+ }
+
+ item(/VERSION,16)
+ {
+ version
+ }
+
+ item(/HELP,49)
+ {
+ raw help
+ }
+ }
+
+ separator
+
+ item($tr("Clear Buffer"),121)
+ {
+ clear;
+ }
+}
+
+# This is a common popup , accepts a list of nicknames as parameter
+defpopup(ctcp)
+{
+ item(PING,36)
+ {
+ ctcp $0 PING
+ }
+
+ item(FINGER,53)
+ {
+ ctcp $0 FINGER
+ }
+
+ item(VERSION,16)
+ {
+ ctcp $0 VERSION
+ }
+
+ item(USERINFO,57)
+ {
+ ctcp $0 USERINFO
+ }
+
+ item(CLIENTINFO,52)
+ {
+ ctcp $0 CLIENTINFO
+ }
+
+ item(SOURCE,14)
+ {
+ ctcp $0 SOURCE
+ }
+
+ item(TIME,93)
+ {
+ ctcp $0 TIME
+ }
+
+ item(PAGE...,223)
+ {
+ #dialog.textinput -d="Wakeup!" ($tr("CTCP Page to") $0,$tr("Enter the message text"),$tr("Ok"),$tr("Cancel"))
+ dialog.textinput(CTCP Page $0,Enter the message text,&Page,Cancel,"",$0)
+ {
+ if($0 == 0)ctcp $2 PAGE $1
+ }
+ }
+
+ item(AVATAR,57)
+ {
+ ctcp $0 AVATAR
+ }
+}
+
+defpopup(dcc)
+{
+ prologue
+ {
+
+ if($features("SSL"))%:bHaveSSL=1
+ else %:bHaveSSL=0
+ }
+
+ item($tr("Chat with") $0,78)
+ {
+ dcc.chat $0
+ }
+
+ item($tr("Reverse Chat with") $0,78)
+ {
+ dcc.chat -z $0
+ }
+
+ item($tr("Secure Chat with") $0,78) (%:bHaveSSL)
+ {
+ dcc.chat -s $0
+ }
+
+ separator
+
+ item($tr("Send to") $0,79)
+ {
+ dcc.send $0
+ }
+
+ item($tr("Secure send to") $0,79)
+ {
+ dcc.send -s $0
+ }
+
+ item($tr("Reverse Send to") $0,79)
+ {
+ dcc.rsend -z $0
+ }
+
+ item($tr("Secure Reverse Send to") $0,79)
+ {
+ dcc.rsend -z -s $0
+ }
+
+ separator
+
+ item($tr("TDCC Send to") $0,77)
+ {
+ dcc.send -t $0
+ }
+
+ item($tr("TDCC Reverse Send to") $0,77)
+ {
+ dcc.rsend -t $0
+ }
+
+ separator
+
+ popup($tr("Voice Chat"),166)
+ {
+ item($tr("Default")": ADPCM 8 KHz (32 kbps)")
+ {
+ dcc.voice $0
+ }
+
+ separator
+
+ item("ADPCM 11.025 KHz (44.1 kbps)")
+ {
+ dcc.voice -h=11025 $0
+ }
+
+ item("ADPCM 16 KHz (64 kbps)")
+ {
+ dcc.voice -h=16000 $0
+ }
+
+ item("ADPCM 22.05 KHz (88.2 kbps)")
+ {
+ dcc.voice -h=22050 $0
+ }
+
+ item("GSM 8 KHz (13.2 kbps)")
+ {
+ dcc.voice -g=gsm $0
+ }
+
+ item("GSM 11.025 KHz (18.1 kbps)")
+ {
+ dcc.voice -g=gsm -h=11025 $0
+ }
+
+ item("GSM 16 KHz (26.4 kbps)")
+ {
+ dcc.voice -g=gsm -h=16000 $0
+ }
+
+ item("GSM 22.05 KHz (36.2 kbps)")
+ {
+ dcc.voice -g=gsm -h=22050 $0
+ }
+
+ item("GSM 44.1 KHz (72.4 kbps)")
+ {
+ dcc.voice -g=gsm -h=44100 $0
+ }
+
+ item("NULL 8 KHz (128 kbps)")
+ {
+ dcc.voice -g=null $0
+ }
+
+ item("NULL 11.025 KHz (176.4 kbps)")
+ {
+ dcc.voice -g=null -h=11025 $0
+ }
+ }
+}
+
+defpopup(dccchat)
+{
+ prologue
+ {
+
+ # we use the extended scope variables: they are visible in the entire defpopup scope
+ # %:visible is the string that we will "show to the user" in the popup widget
+ # for multiple users the string might become long so we are going to change it in "multiple users"
+ %:visible = $0
+ # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list
+ # of multiple nicknames rather than a single nick
+ %:multiple = 0
+ # finally , set these variables
+ if($str.findfirst(%:visible,",") != -1)
+ {
+ # found a comma in the $0 parameter...we have multiple nicknames
+ %:visible = "("$tr("Multiple Users")")"
+ %:multiple = 1
+ }
+ }
+
+ separator
+
+ extpopup(C&TCP,ctcp,51)
+
+ extpopup(&DCC,dcc,77)
+
+ separator
+
+ item($tr("Notify Avatar"),57)
+ {
+ avatar.notify $0
+ }
+
+ separator
+
+ item($tr("Clear Buffer"),121)
+ {
+ clear
+ }
+}
+
+#
+# Some minimal work on the query
+# A text view popup (right click on a query view)
+#
+
+defpopup(querytextview)
+{
+ prologue
+ {
+
+ # we use the extended scope variables: they are visible in the entire defpopup scope
+ # %:visible is the string that we will "show to the user" in the popup widget
+ # for multiple users the string might become long so we are going to change it in "multiple users"
+ %:visible = $0
+ # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list
+ # of multiple nicknames rather than a single nick
+ %:multiple = 0
+ # finally , set these variables
+ if($str.findfirst(%:visible,",") != -1)
+ {
+ # found a comma in the $0 parameter...we have multiple nicknames
+ %:visible = "("$tr("Multiple Users")")"
+ %:multiple = 1
+ }
+ }
+
+ item(/WHOIS $0 "("$tr("idle time")")",75) (!%:multiple)
+ {
+ whois $0 $0
+ }
+
+ separator
+
+ popup($tr("&Information"),49)
+ {
+ item(/WHOIS $0,75)
+ {
+ whois $0
+ }
+
+ item(/WHOWAS $0,92)
+ {
+ whowas $0
+ }
+
+ item(/WHO $0,75)
+ {
+ who $0
+ }
+
+ separator
+
+ item($tr("DNS for") $0,75)
+ {
+ foreach(%i,$str.split(",",$0))dns %i
+ }
+
+ item($tr("Mask for") $0,75) (!%:multiple)
+ {
+ echo $mask($0,11)
+ }
+ }
+
+ separator
+
+ extpopup(C&TCP,ctcp,51)
+
+ extpopup(&DCC,dcc,77)
+
+ separator
+
+ extpopup($tr("&Ignore"),ignore,203) (!%:multiple)
+
+ extpopup($tr("&Registration"),registration,111) (!%:multiple)
+
+ item($tr("Notify Avatar"),57)
+ {
+ avatar.notify $0
+ }
+
+ separator
+
+ item($tr("Clear Buffer"),121)
+ {
+ clear
+ }
+}
+
+
+#
+# Logging popup for the windows
+#
+defpopup(logging)
+{
+ prologue
+ {
+
+ # If this window is being logged actually , $log.file will be non empty
+ # and pointing to the log file actually open.
+ %:logfile = $str.replace($log.file,,$file.localdir)
+ }
+
+ label($tr("Logging to"):<br><b>%:logfile</b>) ("%:logfile" != "")
+
+ item($tr("Flush Log File"),19) (%:logfile)
+ {
+ log.flush
+ }
+
+ separator
+
+ item($tr("Stop Logging"),58) (%:logfile)
+ {
+ log.stop
+ }
+
+ label($tr("Not Logging")) (!%:logfile)
+
+ item($tr("Log To Default File"),119) (!%:logfile)
+ {
+ log.start
+ }
+
+ item($tr("Log To Default File") "("$tr("Include Existing Buffer")")",119) (!%:logfile)
+ {
+ log.start -p
+ }
+
+ item($tr("Log To..."),119) (!%:logfile)
+ {
+ dialog.file(save,$tr("Choose Log Filename"))
+ {
+ if($0)log.start $0
+ }
+ }
+
+ item($tr("Log To...") "("$tr("Include Existing Buffer"),119) (!%:logfile)
+ {
+ dialog.file(save,$tr("Choose Log Filename"))
+ {
+ if($0)log.start -p $0
+ }
+ }
+}
+
+defpopup(defaulttextview)
+{
+ prologue
+ {
+
+ # we use the extended scope variables: they are visible in the entire defpopup scope
+ # %:visible is the string that we will "show to the user" in the popup widget
+ # for multiple users the string might become long so we are going to change it in "multiple users"
+ %:visible = $0
+ # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list
+ # of multiple nicknames rather than a single nick
+ %:multiple = 0
+ # finally , set these variables
+ if($str.findfirst(%:visible,",") != -1)
+ {
+ # found a comma in the $0 parameter...we have multiple nicknames
+ %:visible = "("$tr("Multiple Users")")"
+ %:multiple = 1
+ }
+ }
+
+ item(/WHOIS $0 "("$tr("idle time")")",75) (!%:multiple)
+ {
+ whois $0 $0
+ }
+
+ separator
+
+ popup($tr("&Information"),49)
+ {
+ item(/WHOIS $0,75)
+ {
+ whois $0
+ }
+
+ item(/WHOWAS $0,92)
+ {
+ whowas $0
+ }
+
+ item(/WHO $0,75)
+ {
+ who $0
+ }
+
+ separator
+
+ item(DNS $0,75)
+ {
+ foreach(%i,$str.split(",",$0))dns %i
+ }
+ }
+
+ separator
+
+ item($tr("&Query") %:visible,47)
+ {
+ query $0
+ }
+
+ separator
+
+ extpopup(C&TCP,ctcp,51)
+
+ extpopup(&DCC,dcc,77)
+
+ separator
+
+ extpopup($tr("&Registration"),registration,111) (!%:multiple)
+
+ extpopup($tr("&Highlight"),highlight,181) (!%:multiple)
+
+ extpopup($tr("Ig&nore"),ignore,203) (!%:multiple)
+
+ item($tr("Notify avatar"),57)
+ {
+ avatar.notify $0
+ }
+
+ separator
+
+ item($tr("Clear Buffer"),121)
+ {
+ clear
+ }
+}
+
+file.addimagepath %mypath/pics/
+
+#
+# FIXME: Add uninstall part:
+# file.delimagepath
+#
+
+
+#
+# A default popup for the middle click in a text view
+# This should manage logging , buffer saving and other
+# stuff common to ALL windows
+#
+
+defpopup(windowpopup)
+{
+ extpopup(Logging,logging,119)
+
+# popup(Buffer)
+# {
+# item("Save to file...")window.savebuffer
+# item("Clear")window.clear
+# item("Find...")window.findtext
+# }
+# popup(View)
+# {
+# item("Show images")($window.images == 0)window.images 1
+# item("Enable timestamps")($window.timestamp == 0)window.timestamp 1
+# item("Disable timestamps")($window.timestam == 1)window.timestamp 0
+# item("Set font...")$window.setfont
+# item("Set background...")$window.setbackground
+# }
+# popup(Mdi)
+# {
+# item("Minimize")window.minimize
+# item("Maximize")window.maximize
+# }
+}
+
+# Host link popup
+
+defpopup(hostpopup)
+{
+ item(Look Up $0,13)
+ {
+ host -a $0
+ }
+
+ separator
+
+ item(Open ftp://$0/,145) ("$system.ostype" == "unix")
+ {
+ openurl ftp://$0/
+ }
+
+ item(Telnet to $0,25)
+ {
+ if("$system.ostype" == "unix")run xterm -e telnet $0
+ else run telnet $0
+ }
+
+ separator
+
+ item(Traceroute $0,42)
+ {
+ if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Traceroute to $0...\" && traceroute $0 && cat"
+ else run tracert $0
+ }
+
+ item(Traceroute6 $0,42)
+ {
+ if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Traceroute (inet6) to $0...\" && traceroute6 $0 && cat"
+ else run tracert6 $0
+ }
+
+ item(Ping $0,147)
+ {
+ if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Ping $0...\" && ping $0 && cat"
+ else run ping $0
+ }
+
+ item(Ping6 $0,147)
+ {
+ if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Ping (inet6) $0...\" && ping6 $0 && cat"
+ else run ping6 $0
+ }
+} \ No newline at end of file
diff --git a/data/defscript/toolbars.kvs b/data/defscript/toolbars.kvs
new file mode 100644
index 000000000..84e7b93a1
--- /dev/null
+++ b/data/defscript/toolbars.kvs
@@ -0,0 +1,43 @@
+# Default toolbars file
+
+toolbar.create irccontext $tr("IRC Context") $icon("irc4")
+# toolbar.additem irccontext kvirc.irccontextdisplay - info dublicated with te status line
+toolbar.additem irccontext kvirc.connect
+toolbar.additem irccontext kvirc.servermenu
+toolbar.additem irccontext kvirc.newirccontext
+toolbar.additem irccontext kvirc.separator
+toolbar.additem irccontext kvirc.nicknamemenu
+toolbar.additem irccontext kvirc.irctools
+toolbar.additem irccontext kvirc.ircactions
+toolbar.additem irccontext kvirc.usermodemenu
+toolbar.show irccontext
+
+toolbar.create options $tr("Options") $icon("options")
+toolbar.additem irccontext kvirc.serveroptions
+toolbar.additem options kvirc.identityoptions
+toolbar.additem options kvirc.generaloptions
+toolbar.additem options kvirc.themeoptions
+toolbar.show options
+
+toolbar.create help $tr("Help") 49
+toolbar.additem help kvirc.helpindex
+if($lang(short)==ru)
+ toolbar.additem help kvirc.kvircruhomepage
+else
+ toolbar.additem help kvirc.kvirchomepage
+toolbar.show help
+
+toolbar.create scripting $tr("Scripting") $icon("binarytext")
+toolbar.additem scripting kvirc.actioneditor
+toolbar.additem scripting kvirc.aliaseditor
+toolbar.additem scripting kvirc.eventeditor
+toolbar.additem scripting kvirc.popupeditor
+toolbar.additem scripting kvirc.raweditor
+toolbar.additem scripting kvirc.codetester
+toolbar.additem scripting kvirc.separator
+toolbar.additem scripting kvirc.executekvs
+
+toolbar.create winops $tr("Window operations") $icon("cascadewindows")
+toolbar.additem winops kvirc.cascadewindows
+toolbar.additem winops kvirc.tilewindows
+toolbar.additem winops kvirc.minimizeallwindows \ No newline at end of file