#include <Home.h>
|
| Home (const WEnvironment &env, Wt::Dbo::SqlConnectionPool &blogDb, const std::string &title, const std::string &resourceBundle, const std::string &cssPath) |
|
virtual | ~Home () |
|
void | googleAnalyticsLogger () |
|
Definition at line 67 of file Home.h.
◆ Home()
Home::Home |
( |
const WEnvironment & |
env, |
|
|
Wt::Dbo::SqlConnectionPool & |
blogDb, |
|
|
const std::string & |
title, |
|
|
const std::string & |
resourceBundle, |
|
|
const std::string & |
cssPath |
|
) |
| |
Definition at line 38 of file Home.C.
48 messageResourceBundle().use(appRoot() + resourceBundle,
false);
50 useStyleSheet(cssPath +
"/wt.css");
51 useStyleSheet(cssPath +
"/wt_ie.css",
"lt IE 7",
"all");
52 useStyleSheet(
"css/home.css");
53 useStyleSheet(
"css/sourceview.css");
54 useStyleSheet(
"css/chatwidget.css");
55 useStyleSheet(
"css/chatwidget_ie6.css",
"lt IE 7",
"all");
Wt::Dbo::SqlConnectionPool & blogDb_
◆ ~Home()
◆ addLanguage()
void Home::addLanguage |
( |
const Lang & |
l | ) |
|
|
inlineprotected |
Definition at line 86 of file Home.h.
std::vector< Lang > languages
◆ blog()
Definition at line 258 of file Home.C.
261 std::string langPath = l.
path_;
262 BlogView *
blog =
new BlogView(langPath +
"blog/",
264 blog->setObjectName(
"blog");
266 if (!
blog->user().empty())
void chatSetUser(const WString &name)
◆ chatSetUser()
void Home::chatSetUser |
( |
const WString & |
name | ) |
|
|
private |
Definition at line 274 of file Home.C.
276 WApplication::instance()->doJavaScript
277 (
"if (window.chat && window.chat.emit) {"
279 "" "window.chat.emit(window.chat, 'login', "
280 "" "" + userName.jsStringLiteral() +
"); "
282 "" "window.chatUser=" + userName.jsStringLiteral() +
";"
285 """window.chatUser=" + userName.jsStringLiteral() +
";");
◆ community()
WWidget * Home::community |
( |
| ) |
|
|
private |
Definition at line 320 of file Home.C.
322 return new WText(
tr(
"home.community"));
WString tr(const char *key)
◆ createHome()
void Home::createHome |
( |
| ) |
|
|
private |
Definition at line 113 of file Home.C.
115 WTemplate *result =
new WTemplate(
tr(
"template"), root());
118 WContainerWidget *languagesDiv =
new WContainerWidget();
119 languagesDiv->setId(
"top_languages");
121 for (
unsigned i = 0; i <
languages.size(); ++i) {
123 new WText(
"- ", languagesDiv);
127 new WAnchor(WLink(WLink::InternalPath, l.
path_),
131 WStackedWidget *contents =
new WStackedWidget();
132 WAnimation fade(WAnimation::Fade, WAnimation::Linear, 250);
133 contents->setTransitionAnimation(fade);
134 contents->setId(
"main_page");
136 mainMenu_ =
new WMenu(contents, Vertical);
149 WMenuItem::PreLoading);
153 WMenuItem::PreLoading)->setPathComponent(
"examples/");
157 WMenuItem::PreLoading);
164 WMenuItem::PreLoading);
175 result->bindWidget(
"languages", languagesDiv);
177 result->bindWidget(
"contents", contents);
DeferredWidget< Function > * deferCreate(Function f)
WWidget * otherLanguage()
virtual WWidget * examples()=0
void googleAnalyticsLogger()
WWidget * documentation()
WWidget * wrapView(WWidget *(Home::*createFunction)())
WContainerWidget * sideBarContent_
std::string longDescription_
◆ createQuoteForm()
virtual WWidget* Home::createQuoteForm |
( |
| ) |
|
|
protectedpure virtual |
◆ documentation()
WWidget * Home::documentation |
( |
| ) |
|
|
private |
Definition at line 298 of file Home.C.
300 WText *result =
new WText(
tr(
"home.documentation"));
301 result->setInternalPathEncoding(
true);
◆ download()
WWidget * Home::download |
( |
| ) |
|
|
private |
Definition at line 398 of file Home.C.
400 WContainerWidget *result =
new WContainerWidget();
401 result->addWidget(
new WText(
tr(
"home.download")));
403 result->addWidget(
new WText(
tr(
"home.download.license")));
405 #ifdef WT_EMWEB_BUILD
409 result->addWidget(
new WText(
tr(
"home.download.packages")));
415 result->addWidget(
new WText(
tr(
"home.download.other")));
void readReleases(WTable *releaseTable)
◆ examples()
virtual WWidget* Home::examples |
( |
| ) |
|
|
protectedpure virtual |
◆ features()
WWidget * Home::features |
( |
| ) |
|
|
private |
Definition at line 293 of file Home.C.
295 return new WText(
tr(
"home.features"));
◆ filePrefix()
virtual std::string Home::filePrefix |
( |
| ) |
const |
|
protectedpure virtual |
◆ googleAnalyticsLogger()
void Home::googleAnalyticsLogger |
( |
| ) |
|
Definition at line 426 of file Home.C.
428 doJavaScript(
"if (window.ga) ga('send','pageview',"
429 + WWebWidget::jsStringLiteral(environment().deploymentPath()
430 + internalPath()) +
");");
◆ href()
std::string Home::href |
( |
const std::string & |
url, |
|
|
const std::string & |
description |
|
) |
| |
|
protected |
Definition at line 315 of file Home.C.
317 return "<a href=\"" + url +
"\" target=\"_blank\">" + description +
"</a>";
◆ init()
Definition at line 62 of file Home.C.
void logInternalPath(const std::string &path)
void setLanguageFromPath()
◆ introduction()
WWidget * Home::introduction |
( |
| ) |
|
|
private |
Definition at line 253 of file Home.C.
255 return new WText(
tr(
"home.intro"));
◆ linkSourceBrowser()
WWidget * Home::linkSourceBrowser |
( |
const std::string & |
examplePath | ) |
|
|
protected |
Definition at line 200 of file Home.C.
208 WText *a =
new WText(
tr(
"source-browser-link").arg(path));
209 a->setInternalPathEncoding(
true);
static const std::string SRC_INTERNAL_PATH
◆ logInternalPath()
void Home::logInternalPath |
( |
const std::string & |
path | ) |
|
|
private |
Definition at line 242 of file Home.C.
248 if (path.size() >= 4 && path.substr(0, 4) ==
"/src") {
◆ otherLanguage()
WWidget * Home::otherLanguage |
( |
| ) |
|
|
private |
Definition at line 305 of file Home.C.
307 return new WText(
tr(
"home.other-language"));
◆ quoteForm()
WWidget* Home::quoteForm |
( |
| ) |
|
|
private |
◆ readNews()
void Home::readNews |
( |
WTable * |
newsTable, |
|
|
const std::string & |
newsfile |
|
) |
| |
|
private |
◆ readReleases()
void Home::readReleases |
( |
WTable * |
releaseTable | ) |
|
|
protected |
Definition at line 325 of file Home.C.
327 std::ifstream f((
filePrefix() +
"releases.txt").c_str());
329 releaseTable->clear();
331 releaseTable->elementAt(0, 0)
332 ->addWidget(
new WText(
tr(
"home.download.version")));
333 releaseTable->elementAt(0, 1)
334 ->addWidget(
new WText(
tr(
"home.download.date")));
335 releaseTable->elementAt(0, 2)
336 ->addWidget(
new WText(
tr(
"home.download.description")));
338 releaseTable->elementAt(0, 0)->resize(WLength(15, WLength::FontEx),
340 releaseTable->elementAt(0, 1)->resize(WLength(15, WLength::FontEx),
350 typedef boost::tokenizer<boost::escaped_list_separator<char> >
352 CsvTokenizer tok(line);
354 CsvTokenizer::iterator i=tok.begin();
356 std::string fileName = *i;
357 std::string description = *(++i);
358 releaseTable->elementAt(row, 1)->addWidget(
new WText(*(++i)));
359 releaseTable->elementAt(row, 2)->addWidget(
new WText(*(++i)));
362 std::string url =
"http://prdownloads.sourceforge.net/witty/"
363 + fileName +
"?download";
367 releaseTable->elementAt(row, 0)->addWidget
368 (
new WText(
href(url, description)));
std::string href(const std::string &url, const std::string &description)
virtual std::string filePrefix() const =0
◆ setLanguage()
void Home::setLanguage |
( |
int |
language | ) |
|
|
private |
Definition at line 181 of file Home.C.
188 std::string langPath = l.
path_;
189 mainMenu_->setInternalBasePath(langPath);
191 BlogView *
blog =
dynamic_cast<BlogView *
>(findWidget(
"blog"));
193 blog->setInternalBasePath(langPath +
"blog/");
WTabWidget * examplesMenu_
◆ setLanguageFromPath()
void Home::setLanguageFromPath |
( |
| ) |
|
|
private |
Definition at line 213 of file Home.C.
215 std::string langPath = internalPathNextPart(
"/");
217 if (langPath.empty())
220 langPath =
'/' + langPath +
'/';
224 for (
unsigned i = 0; i <
languages.size(); ++i) {
void setLanguage(int language)
◆ setup()
Definition at line 73 of file Home.C.
83 std::string base = internalPathNextPart(
"/");
93 WVBoxLayout *layout =
new WVBoxLayout();
94 layout->setContentsMargins(0, 0, 0, 0);
96 root()->setLayout(layout);
virtual WWidget * sourceViewer(const std::string &deployPath)=0
◆ sourceViewer()
virtual WWidget* Home::sourceViewer |
( |
const std::string & |
deployPath | ) |
|
|
protectedpure virtual |
◆ status()
WWidget * Home::status |
( |
| ) |
|
|
private |
Definition at line 288 of file Home.C.
290 return new WText(
tr(
"home.status"));
◆ tr()
WString Home::tr |
( |
const char * |
key | ) |
|
|
protected |
Definition at line 421 of file Home.C.
423 return WString::tr(key);
◆ updateTitle()
void Home::updateTitle |
( |
| ) |
|
|
private |
Definition at line 235 of file Home.C.
238 setTitle(
tr(
"wt") +
" - " +
mainMenu_->currentItem()->text());
◆ wrapView()
WWidget * Home::wrapView |
( |
WWidget *(Home::*)() |
createFunction | ) |
|
|
private |
Definition at line 310 of file Home.C.
312 return makeStaticModel(boost::bind(
createWidget,
this));
WApplication * createWidget(const WEnvironment &env, SimpleChatServer &server)
◆ blogDb_
Wt::Dbo::SqlConnectionPool& Home::blogDb_ |
|
private |
◆ contents_
WStackedWidget* Home::contents_ |
|
private |
◆ examplesMenu_
WTabWidget* Home::examplesMenu_ |
|
protected |
◆ homePage_
◆ language_
◆ languages
std::vector<Lang> Home::languages |
|
private |
◆ mainMenu_
◆ releases_
◆ sideBarContent_
WContainerWidget* Home::sideBarContent_ |
|
private |
◆ sourceViewer_
WWidget* Home::sourceViewer_ |
|
private |
The documentation for this class was generated from the following files:
- /tmp/package-src/examples/wt-homepage/Home.h
- /tmp/package-src/examples/wt-homepage/Home.C