JavaScript error: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self' http: https: data: blob: 'unsafe-inline'". (https://git.lalonde.me/assets/js/index.js?v=1.18.3 @ 19:71758). Open browser console to see more details.

26 lines
441 B

package definitions
import (
"fmt"
"sync"
)
var lock sync.RWMutex
var definitions = make(map[string]fmt.Stringer)
// Get returns the XML description of a UI definition and whether it was found
func Get(uiName string) (fmt.Stringer, bool) {
lock.RLock()
defer lock.RUnlock()
def, ok := definitions[uiName]
return def, ok
}
func add(uiName string, def fmt.Stringer) {
lock.Lock()
defer lock.Unlock()
definitions[uiName] = def
}