diff --git a/.project b/.project deleted file mode 100644 index 82e70dc..0000000 --- a/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - Gowut-release - - - - - - - - diff --git a/README.md b/README.md index 245f468..8cbce4f 100644 --- a/README.md +++ b/README.md @@ -11,37 +11,35 @@ For News, documentation and examples please visit the **Gowut Home Page** here: ## Quick install ## -To quickly install (or update to) the **latest** version, type: (you need mercurial client installed for it to work) +To quickly install (or update to) the **latest** version, type: ``` -go get -u code.google.com/p/gowut/gwu +go get -u github.com/icza/gowut/gwu ``` -Check out the [Downloads](http://code.google.com/p/gowut/downloads/list) page for other downloads and older releases. - ## Quick test ## To quickly test it and see it in action, run the following example applications (assuming you're in the root of your GOPATH): **1. Showcase of Features.** This one auto-opens itself in your default browser. ``` -go run src/code.google.com/p/gowut/examples/showcase.go +go run src/github.com/icza/gowut/examples/showcase/showcase.go ``` **2. A single window example.** This one auto-opens itself in your default browser. ``` -go run src/code.google.com/p/gowut/examples/simple_demo.go +go run src/github.com/icza/gowut/examples/simple/simple_demo.go ``` **3. Login window example with session management.** ``` -go run src/code.google.com/p/gowut/examples/login_demo.go +go run src/github.com/icza/gowut/examples/login/login_demo.go ``` Open the page http://localhost:3434/guitest/ in your browser to see it. ## Godoc of Gowut ## You can read the godoc of Gowut online here: -http://godoc.org/code.google.com/p/gowut/gwu +http://godoc.org/github.com/icza/gowut/gwu ## +1 Gowut! ## diff --git a/examples/login_demo.go b/examples/login/login_demo.go similarity index 98% rename from examples/login_demo.go rename to examples/login/login_demo.go index efe6957..98e8660 100644 --- a/examples/login_demo.go +++ b/examples/login/login_demo.go @@ -18,7 +18,7 @@ package main import ( - "code.google.com/p/gowut/gwu" + "github.com/icza/gowut/gwu" "fmt" "log" "math/rand" @@ -322,8 +322,8 @@ func (h SessHandler) Removed(s gwu.Session) { func main() { // Create GUI server - server := gwu.NewServer("guitest", "") - //server := gwu.NewServerTLS("guitest", "", "test_tls/cert.pem", "test_tls/key.pem") + //server := gwu.NewServer("guitest", "") + server := gwu.NewServerTLS("guitest", "", "test_tls/cert.pem", "test_tls/key.pem") server.SetText("Test GUI Application") server.AddSessCreatorName("login", "Login Window") diff --git a/examples/showcase.go b/examples/showcase/showcase.go similarity index 98% rename from examples/showcase.go rename to examples/showcase/showcase.go index 426b88e..a51b1e9 100644 --- a/examples/showcase.go +++ b/examples/showcase/showcase.go @@ -18,7 +18,7 @@ package main import ( - "code.google.com/p/gowut/gwu" + "github.com/icza/gowut/gwu" "fmt" "os" "strconv" @@ -493,7 +493,7 @@ func buildButtonDemo(event gwu.Event) gwu.Comp { func buildHtmlDemo(event gwu.Event) gwu.Comp { p := gwu.NewPanel() - html := "Hi! I'm inserted as HTML. Click on me!" + html := `Hi! I'm inserted as HTML. Click on me!` p.Add(gwu.NewLabel("The following HTML code is inserted after the text box as an Html component:")) ta := gwu.NewTextBox(html) @@ -558,7 +558,7 @@ func buildLinkDemo(event gwu.Event) gwu.Comp { p.SetCellPadding(3) p.Add(gwu.NewLink("Visit Gowut Home page", "https://sites.google.com/site/gowebuitoolkit/")) - p.Add(gwu.NewLink("Visit Gowut Project page", "http://code.google.com/p/gowut/")) + p.Add(gwu.NewLink("Visit Gowut Project page", "https://github.com/icza/gowut")) row := gwu.NewHorizontalPanel() row.SetCellPadding(3) @@ -799,7 +799,7 @@ func buildShowcaseWin(sess gwu.Session) { footer.Style().SetFullWidth().SetBorderTop2(2, gwu.BRD_STYLE_SOLID, "#777777") footer.Add(hiddenPan) footer.AddHConsumer() - l = gwu.NewLabel("Copyright © 2013 András Belicza. All rights reserved.") + l = gwu.NewLabel("Copyright © 2013-2015 András Belicza. All rights reserved.") l.Style().SetFontStyle(gwu.FONT_STYLE_ITALIC).SetFontSize("95%") footer.Add(l) footer.AddHSpace(10) diff --git a/examples/simple_demo.go b/examples/simple/simple_demo.go similarity index 99% rename from examples/simple_demo.go rename to examples/simple/simple_demo.go index ca8d6dd..8b738ff 100644 --- a/examples/simple_demo.go +++ b/examples/simple/simple_demo.go @@ -18,7 +18,7 @@ package main import ( - "code.google.com/p/gowut/gwu" + "github.com/icza/gowut/gwu" "strconv" ) diff --git a/gwu/button.go b/gwu/button.go index 19ad4e1..8c3fdda 100644 --- a/gwu/button.go +++ b/gwu/button.go @@ -53,8 +53,8 @@ func newButtonImpl(valueProviderJs []byte, text string) buttonImpl { } var ( - _STR_BUTTON_OP = []byte("" + _STR_BUTTON_OP = []byte(`" ) func (c *buttonImpl) Render(w writer) { diff --git a/gwu/comp.go b/gwu/comp.go index 75a133b..f711502 100644 --- a/gwu/comp.go +++ b/gwu/comp.go @@ -269,8 +269,8 @@ func (c *compImpl) AddSyncOnETypes(etypes ...EventType) { } var ( - _STR_SE_PREFIX = []byte("=\"se(event,") // "=\"se(event," - _STR_SE_SUFFIX = []byte(")\"") // ")\"" + _STR_SE_PREFIX = []byte(`="se(event,`) // `="se(event,` + _STR_SE_SUFFIX = []byte(`)"`) // `)"` ) // rendrenderEventHandlers renders the event handlers as attributes. @@ -281,8 +281,8 @@ func (c *compImpl) renderEHandlers(w writer) { continue } - // To render : " =\"se(event,etype,compId,value)\"" - // Example (checkbox onclick): " onclick=\"se(event,0,4327,this.checked)\"" + // To render : ` ="se(event,etype,compId,value)"` + // Example (checkbox onclick): ` onclick="se(event,0,4327,this.checked)"` w.Write(_STR_SPACE) w.Write(etypeAttr) w.Write(_STR_SE_PREFIX) diff --git a/gwu/comp_addons.go b/gwu/comp_addons.go index 01c90f1..a415b5a 100644 --- a/gwu/comp_addons.go +++ b/gwu/comp_addons.go @@ -83,7 +83,7 @@ func (c *hasEnabledImpl) SetEnabled(enabled bool) { c.enabled = enabled } -var _STR_DISABLED = []byte(" disabled=\"disabled\"") // " disabled=\"disabled\"" +var _STR_DISABLED = []byte(` disabled="disabled"`) // ` disabled="disabled"` // renderEnabled renders the enabled attribute. func (c *hasEnabledImpl) renderEnabled(w writer) { @@ -394,7 +394,7 @@ func (c *tableViewImpl) SetCellPadding(padding int) { c.SetIAttr("cellpadding", padding) } -var _STR_ST_VALIGN = []byte(" style=\"vertical-align:") // " style=\"vertical-align:" +var _STR_ST_VALIGN = []byte(` style="vertical-align:`) // ` style="vertical-align:` // renderTr renders an HTML TR tag with horizontal and vertical // alignment info included. diff --git a/gwu/doc.go b/gwu/doc.go index e54551a..22b737d 100644 --- a/gwu/doc.go +++ b/gwu/doc.go @@ -68,7 +68,7 @@ to see the changes. To quickly test it and see it in action, run the "Showcase of Features" application by typing: (assuming you're in the root of your GOPATH) - go run src/code.google.com/p/gowut/examples/showcase.go + go run src/github.com/icza/gowut/examples/showcase/showcase.go Features of Gowut @@ -243,7 +243,7 @@ structure) will be seen without page reload. All written in Go. Source of this application is available here: -http://code.google.com/p/gowut/source/browse/examples/simple_demo.go +https://github.com/icza/gowut/blob/master/examples/simple/simple_demo.go type MyButtonHandler struct { counter int @@ -383,7 +383,7 @@ Author email: gmail.com, user name: iczaaa Home page: https://sites.google.com/site/gowebuitoolkit/ -Source code: http://code.google.com/p/gowut/ +Source code: https://github.com/icza/gowut Discussion forum: https://groups.google.com/d/forum/gowebuitoolkit @@ -395,7 +395,7 @@ package gwu // Gowut version information. const ( - GOWUT_VERSION = "0.8.0" // Gowut version (major.minor.maintenance) - GOWUT_RELEASE_DATE = "2013-02-19 CET" // Gowut release date + GOWUT_VERSION = "0.9.0" // Gowut version (major.minor.maintenance) + GOWUT_RELEASE_DATE = "2015-07-08 CET" // Gowut release date GOWUT_REL_DATE_LAYOUT = "2006-01-02 MST" // Gowut release date layout (for time.Parse()) ) diff --git a/gwu/event.go b/gwu/event.go index 2023cf9..06944b0 100644 --- a/gwu/event.go +++ b/gwu/event.go @@ -182,7 +182,7 @@ const ( ) // Empty event handler which does nothing. -const EMPTY_EHANDLER emptyEventHandler = emptyEventHandler(0) +const EMPTY_EHANDLER emptyEventHandler = 0 // EventHandler interface defines a handler capable of handling events. type EventHandler interface { diff --git a/gwu/expander.go b/gwu/expander.go index 325dc98..8c0c5af 100644 --- a/gwu/expander.go +++ b/gwu/expander.go @@ -158,7 +158,7 @@ func (c *expanderImpl) SetHeader(header Comp) { } func (c *expanderImpl) Content() Comp { - return c.header + return c.content } func (c *expanderImpl) SetContent(content Comp) { diff --git a/gwu/image.go b/gwu/image.go index 97ed2ec..b6d0da8 100644 --- a/gwu/image.go +++ b/gwu/image.go @@ -47,9 +47,9 @@ func NewImage(text, url string) Image { } var ( - _STR_IMG_OP = []byte("") // "\">" + _STR_IMG_OP = []byte("`) // `">` ) func (c *imageImpl) Render(w writer) { diff --git a/gwu/listbox.go b/gwu/listbox.go index 27182ea..ab5c224 100644 --- a/gwu/listbox.go +++ b/gwu/listbox.go @@ -195,12 +195,12 @@ func (c *listBoxImpl) preprocessEvent(event Event, r *http.Request) { } var ( - _STR_SELECT_OP = []byte("") // "") // "" - _STR_SELECT_CL = []byte("") // "" + _STR_SELECT_OP = []byte("`) // `") // "" + _STR_SELECT_CL = []byte("") // "" ) func (c *listBoxImpl) Render(w writer) { diff --git a/gwu/server.go b/gwu/server.go index abcfa98..4992767 100644 --- a/gwu/server.go +++ b/gwu/server.go @@ -545,7 +545,7 @@ func (s *serverImpl) serveHTTP(w http.ResponseWriter, r *http.Request) { // Invalid window name, render an error message with a link to the window list w.Header().Set("Content-Type", "text/html; charset=utf-8") w.WriteHeader(http.StatusNotFound) - NewWriter(w).Writess("Window for name '", winName, "' not found. See the Window list.") + NewWriter(w).Writess("Window for name '", winName, `' not found. See the Window list.`) return } @@ -586,7 +586,7 @@ func (s *serverImpl) renderWinList(sess Session, wr http.ResponseWriter, r *http w := NewWriter(wr) - w.Writes("") + w.Writes(`<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>`) w.Writees(s.text) w.Writess(" - Window list

") w.Writees(s.text) @@ -602,7 +602,7 @@ func (s *serverImpl) renderWinList(sess Session, wr http.ResponseWriter, r *http if len(s.sessCreatorNames) > 0 { w.Writes("Session creators:
    ") // TODO needs a better name for name, text := range s.sessCreatorNames { - w.Writess("
  • ", text, "") + w.Writess(`
  • `, text, "") } w.Writes("
") } @@ -616,7 +616,7 @@ func (s *serverImpl) renderWinList(sess Session, wr http.ResponseWriter, r *http } w.Writes("") } diff --git a/gwu/state_buttons.go b/gwu/state_buttons.go index 8d5893e..c007b5d 100644 --- a/gwu/state_buttons.go +++ b/gwu/state_buttons.go @@ -290,12 +290,12 @@ func (c *stateButtonImpl) preprocessEvent(event Event, r *http.Request) { } var ( - _STR_INPUT = []byte("