Subversion Repositories Kolibri OS

Rev

Rev 4677 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4677 Rev 4686
Line 21... Line 21...
21
	void Hover();
21
	void Hover();
22
	void AddLink();
22
	void AddLink();
23
	void AddText();
23
	void AddText();
24
	dword GetURL();
24
	dword GetURL();
25
	void Clear();
25
	void Clear();
-
 
26
	void GetAbsoluteURL();
26
};
27
};
Line 27... Line 28...
27
 
28
 
28
void LinksArray::AddLink(dword new_link, int link_x, link_y)
29
void LinksArray::AddLink(dword new_link, int link_x, link_y)
29
{
30
{
Line 61... Line 62...
61
	count = 0;
62
	count = 0;
62
	active = -1;
63
	active = -1;
63
	CursorPointer.Restore();
64
	CursorPointer.Restore();
64
}
65
}
Line 65... Line 66...
65
 
66
 
66
char temp[4096];
67
char temp[sizeof(URL)];
Line 67... Line 68...
67
PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, #temp, 0};
68
PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, #temp, 0};
68
 
69
 
69
void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col)
70
void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col)
Line 95... Line 96...
95
		DrawBar(progress_bar.left+progress_bar.width+10, progress_bar.top+2, Form.cwidth-progress_bar.left-progress_bar.width-10, 9, col_bg);
96
		DrawBar(progress_bar.left+progress_bar.width+10, progress_bar.top+2, Form.cwidth-progress_bar.left-progress_bar.width-10, 9, col_bg);
96
		active = -1;
97
		active = -1;
97
	}
98
	}
98
}
99
}
Line -... Line 100...
-
 
100
 
-
 
101
char *ABSOLUTE_LINKS[]={ "http:", "mailto:", "ftp:", "/sys/", 
-
 
102
"/kolibrios/", "/rd/", "/bd", "/hd", "/cd", "/tmp", "/usbhd", "WebView:", 0};
-
 
103
void LinksArray::GetAbsoluteURL(dword in_URL){
-
 
104
	int i, len;
-
 
105
	dword orig_URL = in_URL;
-
 
106
	char newurl[sizeof(URL)];
-
 
107
	
-
 
108
	for (i=0; ABSOLUTE_LINKS[i]; i++)
-
 
109
	{
-
 
110
		len=strlen(ABSOLUTE_LINKS[i]);
-
 
111
		if (!strcmpn(in_URL, ABSOLUTE_LINKS[i], len)) return;
-
 
112
	}
-
 
113
	IF (!strcmpn(in_URL,"./", 2)) in_URL+=2;
-
 
114
	strcpy(#newurl, BrowserHistory.CurrentUrl());
-
 
115
 
-
 
116
	if (ESBYTE[in_URL] == '/')
-
 
117
	{
-
 
118
		i = strchr(#newurl+8, '/');
-
 
119
		if (i>0) newurl[i+7]=0;
-
 
120
		in_URL+=1;
-
 
121
	}
-
 
122
		
-
 
123
	_CUT_ST_LEVEL_MARK:
-
 
124
		
-
 
125
	if (newurl[strrchr(#newurl, '/')-2]<>'/')
-
 
126
	{
-
 
127
		newurl[strrchr(#newurl, '/')] = 0x00;
-
 
128
	}
-
 
129
	
-
 
130
	IF (!strncmp(in_URL,"../",3))
-
 
131
	{
-
 
132
		in_URL+=3;
-
 
133
		newurl[strrchr(#newurl, '/')-1] = 0x00;
-
 
134
		goto _CUT_ST_LEVEL_MARK;
-
 
135
	}
-
 
136
	
-
 
137
	if (newurl[strlen(#newurl)-1]<>'/') strcat(#newurl, "/"); 
-
 
138
	
-
 
139
	strcat(#newurl, in_URL);
-
 
140
	strcpy(orig_URL, #newurl);
-
 
141
}
-
 
142
 
Line 99... Line 143...
99
 
143