Bug 325457 - Add visual support for +a (admin) and +q (founder) modes on supported servers.

ChatZilla only.
r=silver
p=rdmsoft@bugs.rdmsoft.com (Robert Marshall)
This commit is contained in:
silver%warwickcompsoc.co.uk 2006-03-05 01:13:34 +00:00
Родитель 6324418b63
Коммит 9bd5398075
10 изменённых файлов: 72 добавлений и 16 удалений

Просмотреть файл

@ -80,6 +80,10 @@ chatzilla.jar:
skin/modern/chatzilla/images/face-wink.png (xul/skin/images/face-wink.png) skin/modern/chatzilla/images/face-wink.png (xul/skin/images/face-wink.png)
skin/modern/chatzilla/images/no-symbol.png (xul/skin/images/no-symbol.png) skin/modern/chatzilla/images/no-symbol.png (xul/skin/images/no-symbol.png)
skin/modern/chatzilla/images/no-graphic.png (xul/skin/images/no-graphic.png) skin/modern/chatzilla/images/no-graphic.png (xul/skin/images/no-graphic.png)
skin/modern/chatzilla/images/founder-symbol.png (xul/skin/images/founder-symbol.png)
skin/modern/chatzilla/images/founder-graphic.png (xul/skin/images/founder-graphic.png)
skin/modern/chatzilla/images/admin-symbol.png (xul/skin/images/admin-symbol.png)
skin/modern/chatzilla/images/admin-graphic.png (xul/skin/images/admin-graphic.png)
skin/modern/chatzilla/images/op-symbol.png (xul/skin/images/op-symbol.png) skin/modern/chatzilla/images/op-symbol.png (xul/skin/images/op-symbol.png)
skin/modern/chatzilla/images/op-graphic.png (xul/skin/images/op-graphic.png) skin/modern/chatzilla/images/op-graphic.png (xul/skin/images/op-graphic.png)
skin/modern/chatzilla/images/halfop-symbol.png (xul/skin/images/halfop-symbol.png) skin/modern/chatzilla/images/halfop-symbol.png (xul/skin/images/halfop-symbol.png)

Просмотреть файл

@ -3177,6 +3177,10 @@ function CIRCChanUser(parent, unicodeName, encodedName, modes)
} }
} }
} }
existingUser.isFounder = (arrayContains(existingUser.modes, "q")) ?
true : false;
existingUser.isAdmin = (arrayContains(existingUser.modes, "a")) ?
true : false;
existingUser.isOp = (arrayContains(existingUser.modes, "o")) ? existingUser.isOp = (arrayContains(existingUser.modes, "o")) ?
true : false; true : false;
existingUser.isHalfOp = (arrayContains(existingUser.modes, "h")) ? existingUser.isHalfOp = (arrayContains(existingUser.modes, "h")) ?
@ -3207,6 +3211,8 @@ function CIRCChanUser(parent, unicodeName, encodedName, modes)
this.modes = new Array(); this.modes = new Array();
if (typeof modes != "undefined") if (typeof modes != "undefined")
this.modes = modes; this.modes = modes;
this.isFounder = (arrayContains(this.modes, "q")) ? true : false;
this.isAdmin = (arrayContains(this.modes, "a")) ? true : false;
this.isOp = (arrayContains(this.modes, "o")) ? true : false; this.isOp = (arrayContains(this.modes, "o")) ? true : false;
this.isHalfOp = (arrayContains(this.modes, "h")) ? true : false; this.isHalfOp = (arrayContains(this.modes, "h")) ? true : false;
this.isVoice = (arrayContains(this.modes, "v")) ? true : false; this.isVoice = (arrayContains(this.modes, "v")) ? true : false;

Просмотреть файл

@ -81,6 +81,8 @@
<bindings> <bindings>
<binding subject="?member" predicate="http://home.netscape.com/NC-irc#sortname" object="?sortname"/> <binding subject="?member" predicate="http://home.netscape.com/NC-irc#sortname" object="?sortname"/>
<binding subject="?member" predicate="http://home.netscape.com/NC-irc#founder" object="?founder"/>
<binding subject="?member" predicate="http://home.netscape.com/NC-irc#admin" object="?admin"/>
<binding subject="?member" predicate="http://home.netscape.com/NC-irc#op" object="?op"/> <binding subject="?member" predicate="http://home.netscape.com/NC-irc#op" object="?op"/>
<binding subject="?member" predicate="http://home.netscape.com/NC-irc#halfop" object="?halfop"/> <binding subject="?member" predicate="http://home.netscape.com/NC-irc#halfop" object="?halfop"/>
<binding subject="?member" predicate="http://home.netscape.com/NC-irc#voice" object="?voice"/> <binding subject="?member" predicate="http://home.netscape.com/NC-irc#voice" object="?voice"/>
@ -92,9 +94,9 @@
<action> <action>
<treechildren> <treechildren>
<treeitem uri="?member" flex="1" <treeitem uri="?member" flex="1"
properties="op-?op halfop-?halfop voice-?voice away-?away"> properties="founder-?founder admin-?admin op-?op halfop-?halfop voice-?voice away-?away">
<treerow> <treerow>
<treecell properties="op-?op halfop-?halfop voice-?voice away-?away" <treecell properties="founder-?founder admin-?admin op-?op halfop-?halfop voice-?voice away-?away"
label="?nick" unicodeName="?unicodeName"/> label="?nick" unicodeName="?unicodeName"/>
</treerow> </treerow>
</treeitem> </treeitem>
@ -105,7 +107,7 @@
<treecols> <treecols>
<treecol id="usercol" hideheader="true" flex="1" <treecol id="usercol" hideheader="true" flex="1"
properties="op-?op halfop-?halfop voice-?voice away-?away"/> properties="founder-?founder admin-?admin op-?op halfop-?halfop voice-?voice away-?away"/>
</treecols> </treecols>
</tree> </tree>

Просмотреть файл

@ -75,6 +75,8 @@ function RDFHelper()
this.resChannel = this.svc.GetResource (RES_PFX + "channel"); this.resChannel = this.svc.GetResource (RES_PFX + "channel");
this.resChanUser = this.svc.GetResource (RES_PFX + "chanuser"); this.resChanUser = this.svc.GetResource (RES_PFX + "chanuser");
this.resSortName = this.svc.GetResource (RES_PFX + "sortname"); this.resSortName = this.svc.GetResource (RES_PFX + "sortname");
this.resFounder = this.svc.GetResource (RES_PFX + "founder");
this.resAdmin = this.svc.GetResource (RES_PFX + "admin");
this.resOp = this.svc.GetResource (RES_PFX + "op"); this.resOp = this.svc.GetResource (RES_PFX + "op");
this.resHalfOp = this.svc.GetResource (RES_PFX + "halfop"); this.resHalfOp = this.svc.GetResource (RES_PFX + "halfop");
this.resVoice = this.svc.GetResource (RES_PFX + "voice"); this.resVoice = this.svc.GetResource (RES_PFX + "voice");
@ -89,6 +91,8 @@ function RDFHelper()
this.litFalse = this.svc.GetLiteral ("false"); this.litFalse = this.svc.GetLiteral ("false");
this.litUnk = this.svc.GetLiteral (""); this.litUnk = this.svc.GetLiteral ("");
this.ds.Assert (this.resNullUser, this.resFounder, this.litFalse, true);
this.ds.Assert (this.resNullUser, this.resAdmin, this.litFalse, true);
this.ds.Assert (this.resNullUser, this.resOp, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resOp, this.litFalse, true);
this.ds.Assert (this.resNullUser, this.resHalfOp, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resHalfOp, this.litFalse, true);
this.ds.Assert (this.resNullUser, this.resVoice, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resVoice, this.litFalse, true);

Просмотреть файл

@ -2493,7 +2493,11 @@ function updateTitle (obj)
if (o.parent.me.canonicalName in client.currentObject.users) if (o.parent.me.canonicalName in client.currentObject.users)
{ {
var cuser = client.currentObject.users[o.parent.me.canonicalName]; var cuser = client.currentObject.users[o.parent.me.canonicalName];
if (cuser.isOp) if (cuser.isFounder)
nick = "~" + nick;
else if (cuser.isAdmin)
nick = "&" + nick;
else if (cuser.isOp)
nick = "@" + nick; nick = "@" + nick;
else if (cuser.isHalfOp) else if (cuser.isHalfOp)
nick = "%" + nick; nick = "%" + nick;
@ -4641,6 +4645,8 @@ function usr_graphres()
rdf.Assert (this.rdfRes, rdf.resUser, rdf.litUnk); rdf.Assert (this.rdfRes, rdf.resUser, rdf.litUnk);
rdf.Assert (this.rdfRes, rdf.resHost, rdf.litUnk); rdf.Assert (this.rdfRes, rdf.resHost, rdf.litUnk);
rdf.Assert (this.rdfRes, rdf.resSortName, rdf.litUnk); rdf.Assert (this.rdfRes, rdf.resSortName, rdf.litUnk);
rdf.Assert (this.rdfRes, rdf.resFounder, rdf.litUnk);
rdf.Assert (this.rdfRes, rdf.resAdmin, rdf.litUnk);
rdf.Assert (this.rdfRes, rdf.resOp, rdf.litUnk); rdf.Assert (this.rdfRes, rdf.resOp, rdf.litUnk);
rdf.Assert (this.rdfRes, rdf.resHalfOp, rdf.litUnk); rdf.Assert (this.rdfRes, rdf.resHalfOp, rdf.litUnk);
rdf.Assert (this.rdfRes, rdf.resVoice, rdf.litUnk); rdf.Assert (this.rdfRes, rdf.resVoice, rdf.litUnk);
@ -4681,7 +4687,7 @@ function usr_updres()
// Check for the highest mode the user has. // Check for the highest mode the user has.
const userModes = this.parent.parent.userModes; const userModes = this.parent.parent.userModes;
var modeLevel = 0; var modeLevel = 0;
var mode = ""; var mode;
for (var i = 0; i < this.modes.length; i++) for (var i = 0; i < this.modes.length; i++)
{ {
for (var j = 0; j < userModes.length; j++) for (var j = 0; j < userModes.length; j++)
@ -4691,7 +4697,7 @@ function usr_updres()
if (userModes.length - j > modeLevel) if (userModes.length - j > modeLevel)
{ {
modeLevel = userModes.length - j; modeLevel = userModes.length - j;
mode = userModes[j].symbol; mode = userModes[j];
} }
break; break;
} }
@ -4701,17 +4707,17 @@ function usr_updres()
// Counts numerically down from 9. // Counts numerically down from 9.
var sortname = (9 - modeLevel) + "-" + this.unicodeName; var sortname = (9 - modeLevel) + "-" + this.unicodeName;
// We want to show mode symbols, but only those we don't 'style'. // We want to show mode symbols, but only for modes we don't 'style'.
if (mode && !mode.match(/^[@%+]$/)) var displayname = this.unicodeName;
{ if (mode && !mode.mode.match(/^[qaohv]$/))
rdf.Change(this.rdfRes, rdf.resNick, displayname = mode.symbol + " " + displayname;
rdf.GetLiteral(mode + " " + this.unicodeName));
} rdf.Change(this.rdfRes, rdf.resNick, rdf.GetLiteral(displayname));
else
{
rdf.Change (this.rdfRes, rdf.resNick, rdf.GetLiteral(this.unicodeName));
}
rdf.Change(this.rdfRes, rdf.resSortName, rdf.GetLiteral(sortname)); rdf.Change(this.rdfRes, rdf.resSortName, rdf.GetLiteral(sortname));
rdf.Change(this.rdfRes, rdf.resFounder,
this.isFounder ? rdf.litTrue : rdf.litFalse);
rdf.Change(this.rdfRes, rdf.resAdmin,
this.isAdmin ? rdf.litTrue : rdf.litFalse);
rdf.Change(this.rdfRes, rdf.resOp, rdf.Change(this.rdfRes, rdf.resOp,
this.isOp ? rdf.litTrue : rdf.litFalse); this.isOp ? rdf.litTrue : rdf.litFalse);
rdf.Change(this.rdfRes, rdf.resHalfOp, rdf.Change(this.rdfRes, rdf.resHalfOp,

Просмотреть файл

@ -201,6 +201,40 @@ treechildren::-moz-tree-image(op-true) {
list-style-image: url(chrome://chatzilla/skin/images/op-graphic.png); list-style-image: url(chrome://chatzilla/skin/images/op-graphic.png);
} }
/* admin */
treechildren:-moz-tree-image(admin-true) {
list-style-image: url(chrome://chatzilla/skin/images/admin-symbol.png);
}
treechildren::-moz-tree-image(admin-true) {
list-style-image: url(chrome://chatzilla/skin/images/admin-symbol.png);
}
#user-list[mode="graphic"] treechildren:-moz-tree-image(admin-true) {
list-style-image: url(chrome://chatzilla/skin/images/admin-graphic.png);
}
#user-list[mode="graphic"] treechildren::-moz-tree-image(admin-true) {
list-style-image: url(chrome://chatzilla/skin/images/admin-graphic.png);
}
/* founder */
treechildren:-moz-tree-image(founder-true) {
list-style-image: url(chrome://chatzilla/skin/images/founder-symbol.png);
}
treechildren::-moz-tree-image(founder-true) {
list-style-image: url(chrome://chatzilla/skin/images/founder-symbol.png);
}
#user-list[mode="graphic"] treechildren:-moz-tree-image(founder-true) {
list-style-image: url(chrome://chatzilla/skin/images/founder-graphic.png);
}
#user-list[mode="graphic"] treechildren::-moz-tree-image(founder-true) {
list-style-image: url(chrome://chatzilla/skin/images/founder-graphic.png);
}
/* away */ /* away */
treechildren:-moz-tree-cell-text(away-true) { treechildren:-moz-tree-cell-text(away-true) {
color: GrayText; color: GrayText;

Двоичные данные
extensions/irc/xul/skin/images/admin-graphic.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 237 B

Двоичные данные
extensions/irc/xul/skin/images/admin-symbol.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 244 B

Двоичные данные
extensions/irc/xul/skin/images/founder-graphic.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 239 B

Двоичные данные
extensions/irc/xul/skin/images/founder-symbol.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 172 B