|
|
|
@ -546,6 +546,9 @@ namespace NLGUI
|
|
|
|
|
download.data = new CCurlWWWData(curl, download.url);
|
|
|
|
|
download.fp = fp;
|
|
|
|
|
|
|
|
|
|
// initial connection timeout, curl default is 300sec
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, download.ConnectionTimeout);
|
|
|
|
|
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true);
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_URL, download.url.c_str());
|
|
|
|
|
|
|
|
|
@ -2519,9 +2522,10 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
bool CGroupHTML::isBrowsing()
|
|
|
|
|
{
|
|
|
|
|
// do not show spinning cursor for image downloads (!Curls.empty())
|
|
|
|
|
return _BrowseNextTime || _PostNextTime || _RenderNextTime ||
|
|
|
|
|
_Browsing || _WaitingForStylesheet ||
|
|
|
|
|
_CurlWWW || !Curls.empty();
|
|
|
|
|
_CurlWWW;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
@ -5564,12 +5568,15 @@ namespace NLGUI
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CGroupHTML::htmlIMG(const CHtmlElement &elm)
|
|
|
|
|
{
|
|
|
|
|
// Get the string name
|
|
|
|
|
if (elm.hasNonEmptyAttribute("src"))
|
|
|
|
|
std::string src = trim(elm.getAttribute("src"));
|
|
|
|
|
if (src.empty())
|
|
|
|
|
{
|
|
|
|
|
// no 'src' attribute, or empty
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float tmpf;
|
|
|
|
|
std::string id = elm.getAttribute("id");
|
|
|
|
|
std::string src = elm.getAttribute("src");
|
|
|
|
|
|
|
|
|
|
if (elm.hasNonEmptyAttribute("width"))
|
|
|
|
|
getPercentage(_Style.Current.Width, tmpf, elm.getAttribute("width").c_str());
|
|
|
|
@ -5624,7 +5631,6 @@ namespace NLGUI
|
|
|
|
|
addImage(id, elm.getAttribute("src"), reloadImg, _Style.Current);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CGroupHTML::htmlINPUT(const CHtmlElement &elm)
|
|
|
|
@ -5644,9 +5650,14 @@ namespace NLGUI
|
|
|
|
|
// Widget minimal width
|
|
|
|
|
string minWidth = elm.getAttribute("z_input_width");
|
|
|
|
|
|
|
|
|
|
// Get the type
|
|
|
|
|
if (elm.hasNonEmptyAttribute("type"))
|
|
|
|
|
// <input type="...">
|
|
|
|
|
std::string type = trim(elm.getAttribute("type"));
|
|
|
|
|
if (type.empty())
|
|
|
|
|
{
|
|
|
|
|
// no 'type' attribute, or empty
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Global color flag
|
|
|
|
|
if (elm.hasAttribute("global_color"))
|
|
|
|
|
_Style.Current.GlobalColor = true;
|
|
|
|
@ -5658,7 +5669,6 @@ namespace NLGUI
|
|
|
|
|
if (!strtooltip.empty())
|
|
|
|
|
tooltip = strtooltip.c_str();
|
|
|
|
|
|
|
|
|
|
string type = toLower(elm.getAttribute("type"));
|
|
|
|
|
if (type == "image")
|
|
|
|
|
{
|
|
|
|
|
// The submit button
|
|
|
|
@ -5860,7 +5870,6 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CGroupHTML::htmlLI(const CHtmlElement &elm)
|
|
|
|
@ -5933,8 +5942,11 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
std::string httpEquiv = elm.getAttribute("http-equiv");
|
|
|
|
|
std::string httpContent = elm.getAttribute("content");
|
|
|
|
|
if (!httpEquiv.empty() && !httpContent.empty())
|
|
|
|
|
if (httpEquiv.empty() || httpContent.empty())
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// only first http-equiv="refresh" should be handled
|
|
|
|
|
if (_RefreshUrl.empty() && httpEquiv == "refresh")
|
|
|
|
|
{
|
|
|
|
@ -5959,7 +5971,6 @@ namespace NLGUI
|
|
|
|
|
_NextRefreshTime += timeSec;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CGroupHTML::htmlOBJECT(const CHtmlElement &elm)
|
|
|
|
@ -6323,8 +6334,18 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CGroupTable *table = getTable();
|
|
|
|
|
if (table)
|
|
|
|
|
if (!table)
|
|
|
|
|
{
|
|
|
|
|
// <td> appears to be outside <table>
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_Cells.empty())
|
|
|
|
|
{
|
|
|
|
|
// <table> not started
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_Style.hasStyle("padding"))
|
|
|
|
|
{
|
|
|
|
|
uint32 a;
|
|
|
|
@ -6333,8 +6354,6 @@ namespace NLGUI
|
|
|
|
|
table->CellPadding = a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_Cells.empty())
|
|
|
|
|
{
|
|
|
|
|
_Cells.back() = new CGroupCell(CViewBase::TCtorParam());
|
|
|
|
|
|
|
|
|
|
if (_Style.checkStyle("background-repeat", "1") || _Style.checkStyle("background-repeat", "repeat"))
|
|
|
|
@ -6401,8 +6420,6 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
renderPseudoElement(":before", elm);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CGroupHTML::htmlTDend(const CHtmlElement &elm)
|
|
|
|
|
{
|
|
|
|
@ -6416,11 +6433,9 @@ namespace NLGUI
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CGroupHTML::htmlTEXTAREA(const CHtmlElement &elm)
|
|
|
|
|
{
|
|
|
|
|
_PRE.push_back(true);
|
|
|
|
|
if (_Forms.empty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// Got one form ?
|
|
|
|
|
if (!(_Forms.empty()))
|
|
|
|
|
{
|
|
|
|
|
// read general property
|
|
|
|
|
string templateName;
|
|
|
|
|
|
|
|
|
@ -6445,14 +6460,11 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
_TextAreaTemplate = !templateName.empty() ? templateName : DefaultFormTextAreaGroup;
|
|
|
|
|
_TextArea = true;
|
|
|
|
|
}
|
|
|
|
|
_PRE.push_back(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CGroupHTML::htmlTEXTAREAend(const CHtmlElement &elm)
|
|
|
|
|
{
|
|
|
|
|
_TextArea = false;
|
|
|
|
|
popIfNotEmpty (_PRE);
|
|
|
|
|
|
|
|
|
|
if (_Forms.empty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
@ -6465,6 +6477,9 @@ namespace NLGUI
|
|
|
|
|
entry.TextArea = textArea;
|
|
|
|
|
_Forms.back().Entries.push_back (entry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_TextArea = false;
|
|
|
|
|
popIfNotEmpty (_PRE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|