aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEkaterina Gerasimova <kittykat3756@gmail.com>2013-07-06 20:15:59 +0800
committerEkaterina Gerasimova <kittykat3756@gmail.com>2013-07-06 20:15:59 +0800
commit2272f08ccf04268e2d3ac1e03d4083a64c560756 (patch)
tree99826388738596959c5611fa2e1a4ec34bff0861
parent647195b9347b4087840d926180c7ee3e00019297 (diff)
downloadgsoc2013-epiphany-2272f08ccf04268e2d3ac1e03d4083a64c560756.tar.gz
gsoc2013-epiphany-2272f08ccf04268e2d3ac1e03d4083a64c560756.tar.zst
gsoc2013-epiphany-2272f08ccf04268e2d3ac1e03d4083a64c560756.zip
Reorder instructions in pref-css
The instructions only seem to work if followed in a specific order, where the CCS is created before being enabled.
-rw-r--r--help/C/pref-css.page9
1 files changed, 5 insertions, 4 deletions
diff --git a/help/C/pref-css.page b/help/C/pref-css.page
index e435a6bea..282a4234a 100644
--- a/help/C/pref-css.page
+++ b/help/C/pref-css.page
@@ -36,19 +36,20 @@
<guiseq><gui style="menu">Web</gui><gui style="menuitem">Preferences</gui><gui style="tab">Fonts &amp; Styles</gui></guiseq>.</p>
</item>
<item>
- <p>Tick the <gui>Use custom stylesheet</gui> checkbox, then press
- <gui style="button">Edit Stylesheet</gui>.</p>
+ <p>Press <gui style="button">Edit Stylesheet</gui>.</p>
</item>
<item>
<p>Your default text editor will open. Add you custom CSS and save
the file.</p>
</item>
+ <item>
+ <p>Tick the <gui>Use custom stylesheet</gui> checkbox.</p>
+ </item>
</steps>
<comment>
<cite date="2013-07-06">Kat</cite>
- <p>Maybe use a slightly more practical example. Custom CSS does not apear
- to be working in 3.8.2 for me right now, so I cannot test it.</p>
+ <p>Maybe use a slightly more practical example.</p>
</comment>
<p>An example of a custom CSS:</p>
2003-05-17 18:50:15 +0800 Make it utf-8 safe. Fixes bug 113114.' href='/~lantw44/cgit/cgit.cgi/gsoc2013-epiphany/commit/lib/ephy-string.c?id=452a329409d547296f6d79fa902ddba45a8286c8'>452a32940
6876ede98

452a32940





6876ede98
265c85e8a
c7fa7407b
6876ede98
c7fa7407b
452a32940

6876ede98


452a32940
6876ede98


452a32940
6876ede98

452a32940
265c85e8a
452a32940
265c85e8a
452a32940

6876ede98



6876ede98
265c85e8a
6876ede98
dff9e866b
6876ede98


c7fa7407b

6876ede98







c7fa7407b

6876ede98

6876ede98

c7fa7407b



6876ede98








6876ede98
c7fa7407b
6876ede98
c7fa7407b
6876ede98
c7fa7407b

6876ede98


c7fa7407b





6876ede98
c7fa7407b

6876ede98
c7fa7407b
6876ede98

bbda044fa
265c85e8a
c7fa7407b
bbda044fa
c7fa7407b

bbda044fa
265c85e8a
bbda044fa

265c85e8a
bbda044fa











265c85e8a
bbda044fa
265c85e8a
bbda044fa

da6333c06





































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193















                                                                              

        
   
 
                    
                   

      

                        
                  
                   
                   
                 
 

                               

                                                                           





                                                                     
   
      
                                                        
 
                      

                            


                              
                                                


                                                                          
                                                                  

                           
                                                                                           
 
                                                               
 

                                                               



                       
        
                                                        
 
                      


                                                    

                                              







                                                                     

                                                                            

                             

                                                                



                                                    








                                     
      
                                    
 
                
 

                           


                            





                                       
                 

                    
 
                      

 
                                      
      
                                                    
 

                         
                                 
 

                                                      
 











                                                  
 
                  
 

                      





































                                                                                                                             
/*
 *  Copyright (C) 2002 Marco Pesenti Gritti
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *  $Id$
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "ephy-string.h"

#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <glib.h>

#define ELLIPSIS "\xe2\x80\xa6"

/**
 * ephy_string_shorten: returns a newly allocated shortened version of str.
 * The input must be valid utf-8.
 * @str: the string to shorten
 * @target_length: the length of the shortened string (in characters)
 *
 * FIXME: this function is a big mess. While it is utf-8 safe now,
 * it can still split a sequence of combining characters
 */
char *
ephy_string_shorten (const char *str, int target_length)
{
    char *new_str;
    glong actual_length;
    gulong bytes;

    if (!str) return NULL;

    actual_length = g_utf8_strlen (str, -1);

    /* if the string is already short enough, or if it's too short for
     * us to shorten it, return a new copy */
    if (actual_length <= target_length) return g_strdup (str);

    /* create string */
    bytes = GPOINTER_TO_UINT (g_utf8_offset_to_pointer (str, target_length - 1) - str);

    new_str = g_new0 (gchar, bytes + strlen(ELLIPSIS) + 1);

    strncpy (new_str, str, bytes);
    strncpy (new_str + bytes, ELLIPSIS, strlen (ELLIPSIS));

    return new_str;
}

gboolean
ephy_string_to_int (const char *string, gulong *integer)
{
    gulong result;
    char *parse_end;

    /* Check for the case of an empty string. */
    if (string == NULL || *string == '\0')
    {
        return FALSE;
    }

    /* Call the standard library routine to do the conversion. */
    errno = 0;
    result = strtol (string, &parse_end, 0);

    /* Check that the result is in range. */
    if ((result == G_MINLONG || result == G_MAXLONG) && errno == ERANGE)
    {
        return FALSE;
    }

    /* Check that all the trailing characters are spaces. */
    while (*parse_end != '\0')
    {
        if (!g_ascii_isspace (*parse_end++))
        {
            return FALSE;
        }
    }

    /* Return the result. */
    *integer = result;
    return TRUE;
}

char *
ephy_string_blank_chr (char *source)
{
    char *p;

        if (source == NULL)
    {
        return NULL;
    }

    p = source;
    while (*p != '\0')
    {
        if ((guchar) *p < 0x20)
        {
            *p = ' ';
        }
        p++;
    }

        return source;
}

/* copied from egg-toolbar-editor.c */
char *
ephy_string_elide_underscores (const char *original)
{
    char *q, *result;
    const char *p;
    gboolean last_underscore;

    q = result = g_malloc (strlen (original) + 1);
    last_underscore = FALSE;

    for (p = original; *p; p++)
    {
        if (!last_underscore && *p == '_')
        {
            last_underscore = TRUE;
        }
        else
        {
            last_underscore = FALSE;
            *q++ = *p;
        }
    }

    *q = '\0';

    return result;
}

char *
ephy_string_double_underscores (const char *string)
{
    int underscores;
    const char *p;
    char *q;
    char *escaped;

    if (string == NULL)
    {
        return NULL;
    }

    underscores = 0;
    for (p = string; *p != '\0'; p++)
    {
        underscores += (*p == '_');
    }
        
    if (underscores == 0)
    {
        return g_strdup (string);
    }

    escaped = g_new (char, strlen (string) + underscores + 1);
    for (p = string, q = escaped; *p != '\0'; p++, q++)
    {
        /* Add an extra underscore. */
        if (*p == '_') {
            *q++ = '_';
        }
        *q = *p;
    }
    *q = '\0';
                                                                                                                             
    return escaped;
}