Abbreviations

5 views
Skip to first unread message

Neno Kalim

unread,
Feb 28, 2008, 6:18:13 AM2/28/08
to Glossword Users
Hi Dmitry!

I was trying to split the "abbreviation" field because I would like to
have three different colours for part of speech (1,3), "science" (2)
and others limits (5).

I succeeded to get the parts of the code to hack, but it seemed to me
that the modification did work as I wanted, so I restored all original
code (overwriting the modified files with the original ones). But the
problem (the input line for abbr is shown twice and the add/remove
button doesn't work) is still there.

It seems that the modification is stored somewhere in the database. I
say so because the form to add terms into the other glossaries work as
usual, only with the glossary I used to test the changes behaves as if
I didn't restore the original code!
Before restoring the original code I changed the parameters of the
test glossary deleting the new fields, so in dict_settings there isn't
any trace left.


Can you help me to understand where the information is stored?
Thanks a lot.

dmitry.s...@gmail.com

unread,
Feb 28, 2008, 10:39:57 AM2/28/08
to Glossword Users
I've made modification.
http://groups.google.com/group/glossword/files?hl=en
See mod_colorful_abbreviations.zip
:-)

Neno Kalim

unread,
Feb 28, 2008, 10:59:41 AM2/28/08
to Glossword Users
Thanks again!

I've the code and it should (I didn't make the replacement yet) work
fine for the current layout. What I was trying to do is to split the
defination according the different part of speech of the headword (A
s. B v., did you see my wishlist?).

How can I get rid of the traces left by my tries? When I try to add a
term to the test glossary the form still displays two inputs for the
abbreviation and it's not possible to remove one of them :(

Thanks.

On Feb 28, 4:39 pm, "dmitry.shilni...@gmail.com"
<dmitry.shilni...@gmail.com> wrote:
> I've made modification.http://groups.google.com/group/glossword/files?hl=en
> See mod_colorful_abbreviations.zip
> :-)

dmitry.s...@gmail.com

unread,
Feb 28, 2008, 11:14:57 AM2/28/08
to Glossword Users

> How can I get rid of the traces left by my tries? When I try to add a
> term to the test glossary the form still displays two inputs for the
> abbreviation and it's not possible to remove one of them :(
>

Add a term and uncheck "Save HTML-form settings".


Modification moved to
http://code.google.com/p/glossword/wiki/KB749120513eng

Neno Kalim

unread,
Feb 28, 2008, 1:14:07 PM2/28/08
to Glossword Users
> Add a term and uncheck "Save HTML-form settings".
>

It worked, but why?

As to the abbr colours I modified /lib/class.render.php

changing
var $tag_abbr = 'acronym'; // 'abbr' for XHTML 2.0

into
var $tag_abbr_1 = 'acronym-1'; // 'abbr' for XHTML 2.0
var $tag_abbr_2 = 'acronym-2'; // 'abbr' for XHTML 2.0
var $tag_abbr_3 = 'acronym-3'; // 'abbr' for XHTML 2.0
var $tag_abbr_5 = 'acronym-5'; // 'abbr' for XHTML 2.0

and

if (($tmp['str'] != '') || $tmp['attributes'][$chK] != '--')
{
$tagname = 'tag_'.$tag;
....

into
if (($tmp['str'] != '') || $tmp['attributes'][$chK] != '--')
{
$tagname = 'tag_'.$tag.'_'.$ar_abbr_groups[$tmp['attributes']
[$chK]];
....
}
Consequently

in /gw_temp/t/{theme name}/style.css

acronym-1,acronym-2,acronym-3,acronym-5 { font: italic 90% sans-
serif;}
acronym-1 { color: #e30700; }
acronym-2 { color: #9b67c7; }
acronym-3 { color: #5bbf3f; }
acronym-5 { color: #47a7a3; }

So I can change the colours of the short forms to.

Thanks.


dmitry.s...@gmail.com

unread,
Feb 28, 2008, 1:53:35 PM2/28/08
to Glossword Users
> var $tag_abbr_1 = 'acronym-1'; // 'abbr' for XHTML 2.0

"acronym" is HTML-tag. There are no tag "acronym-1". You are breaking
HTML by making this modification.

> It worked, but why?

Because when you are adding a lot of terms with several abbreviations,
translation etc, you have to configure the layout of HTML-form over
and over again from the beginning. This option saves a _lot_ of time.
If you don't need it, just do not check it.

Neno Kalim

unread,
Feb 28, 2008, 2:00:09 PM2/28/08
to Glossword Users
> > var $tag_abbr_1 = 'acronym-1'; // 'abbr' for XHTML 2.0
>
> "acronym" is HTML-tag. There are no tag "acronym-1". You are breaking
> HTML by making this modification.

OOOPS! :)
But it worked!

I'll follow another method (a class for acronym?).

> Because when you are adding a lot of terms with several abbreviations,
> translation etc, you have to configure the layout of HTML-form over
> and over again from the beginning. This option saves a _lot_ of time.
> If you don't need it, just do not check it.
:( I don't understand... I'll study that...

Thanks

Neno Kalim

unread,
Feb 28, 2008, 2:25:00 PM2/28/08
to Glossword Users
Well, I have undone my modifications.

The simplest way to change the colours of the short forms seems to be:

$tmp['ar_compiled'][$i] = ($tmp['str_title'] != '') ? '<'.$this->
$tagname.$tmp['str_title'].' class="'.$class_name.'" >' : '';

instead of

$tmp['ar_compiled'][$i] = ($tmp['str_title'] != '') ? '<'.$this->
$tagname.$tmp['str_title'].' >' : '';

But this way I have to use the same colours for both abbr. forms.


Neno Kalim

unread,
Feb 29, 2008, 3:48:15 AM2/29/08
to Glossword Users
A little better... I suppose:

in /lib/class.render.php

if (($tmp['str'] != '') || $tmp['attributes'][$chK] != '--')
{
$acr_class_name="";
$class_name = $tag.'-'.$ar_abbr_groups[$tmp['attributes'][$chK]];
$tagname = 'tag_'.$tag;
if ( $tag=="abbr" )
{
$acr_class_name=' class="acr'.'-'.$ar_abbr_groups[$tmp['attributes']
[$chK]].'"';
}
$tmp['ar_compiled'][$i] = ($tmp['str_title'] != '') ? '<'.$this->
$tagname.$tmp['str_title'].$acr_class_name.'>' : '';
$tmp['ar_compiled'][$i] .= $tmp['str_acronym'];
$tmp['ar_compiled'][$i] .= ($tmp['str_title'] != '') ? '</'.$this->
$tagname.'>' : '';
$tmp['ar_compiled'][$i] .= ($tmp['str'] != '') ? $postlang_name.
'<span class="'.$class_name.'">' . $tmp['str'] . '</span>' : '';
}

in /gw_temp/t/{theme name}/style.css

acr-1 { color: #e30700; }
acr-2 { color: #9b67c7; }
acr-3 { color: #5bbf3f; }
acr-5 { color: #47a7a3; }
Reply all
Reply to author
Forward
0 new messages