mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Feature: AssetServer Runtime (#2335)
* Tidy up runtime JS * Initial implementation of runtime over http * Update runtime deps. Fix test task. * Support Clipboard. Message Processor refactor. * Add `Window.Screen()` Clipboard `GetText` -> `Text` * Support most dialogs Better JS->Go object mapping Implement Go->JS callback mechanism Rename `window.runtime` -> `window.wails` to better reflect the Go API * Support SaveFile dialog * Remove go.work * Tidy up * Event->CustomEvent to prevent potential clash with native JS Event object Support Eventing * Support application calls * Support logging * Support named windows Remove debug info * Update v3 changes
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package application
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func (m *MessageProcessor) processClipboardMethod(method string, rw http.ResponseWriter, _ *http.Request, _ *WebviewWindow, params QueryParams) {
|
||||
|
||||
switch method {
|
||||
case "SetText":
|
||||
title := params.String("text")
|
||||
if title == nil {
|
||||
m.Error("SetText: text is required")
|
||||
return
|
||||
}
|
||||
globalApplication.Clipboard().SetText(*title)
|
||||
m.ok(rw)
|
||||
case "Text":
|
||||
text := globalApplication.Clipboard().Text()
|
||||
m.text(rw, text)
|
||||
default:
|
||||
m.httpError(rw, "Unknown clipboard method: %s", method)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user