Questions tagged [opa]

Opa is an open source programming language for both backend and frontend web development. Opa therefore provides a unified syntax and semantics for writing all aspects of a web application: client-side, server-side and database queries. But it’s not only about expressiveness: Opa also features a unique type system that provides strong static typing from the client UI to the MongoDB queries.

Important links:

251 questions
2
votes
1 answer

tinymce editor using opa

import stdlib.core.web.resource Editor = {{ base_url = Resource.base_url?"" load = @client init()= ((%% editor.init %%)()) @client…
2
votes
1 answer

How to Fade content of a div?

I am new to OPA. I can replace the content of the div using DOM.transform but I want to fade that content before replacing with new one. How do I do it? Basically, how do I use Dom.Effect? A code snippet will help. Thanks
pkg74
  • 31
  • 2
2
votes
1 answer

How to use stdlib.upload without rendering the whole page in a hidden iframe?

Given the example chat room code in manual, I want to add a form for user to upload image using the Upload.html function in standard lib. Below is the upload form code I wrote wraps in a div tag. {Upload.html( {form_id = "upload"…
naush
  • 23
  • 3
2
votes
2 answers

how to call opa functions from external scripts or embeded content like flash plugins

as the title says, dos anyone know a way how to call functions I define in opa from external scripts or embeded content on the client side. In other words, the opposite direction of what is explained in the 8. Hello, reCaptcha (and the rest of the…
akuryou
  • 23
  • 3
2
votes
1 answer

Adding user defined types to an array

I have defined a type called node along with a list of nodes. type node = {name: string; description: string} nodes = [] : list(node) I have created a function called createNewNode() which creates a new node, assigns it to selectedNode, and adds it…
rancidfishbreath
  • 3,944
  • 2
  • 30
  • 44
2
votes
0 answers

Rego based OPA Policy for restricting Argo CD applications being created in default Argo CD project is not working with Gatekeeper

Rego based OPA Policy for restricting Argo CD applications being created in default Argo CD project is not working with Gatekeeper. I have tried multiple combinations of api versions and kinds in the constraint as well. Constraint template and…
Mukul Garg
  • 21
  • 3
2
votes
2 answers

Event handlers not working

So I have the following code that I am using to create a form that when you click into a field it makes sure the most current data from the database is in the field and then when you leave the form field it saves the text area back to the database.…
Chris
  • 35
  • 2
2
votes
1 answer

How to parse DOM in OPA?

I've just now started with OPA and I want to parse a DOM, but I can only get elements by the id, with Dom.get_value(#an_id) for example. What if I have a layout like the one in the chat example on the tutorials:
Zamith
  • 22,900
  • 2
  • 24
  • 16
2
votes
2 answers

Modifying a variable in enclosing scope

There is a common problem in languages that assume variable declarations are local. How do you get at variables in enclosing scopes. Is there a way in Opa? For example: start() = name = Random.string(5) set_name(new_name) = …
Ian
  • 3,619
  • 1
  • 21
  • 32
2
votes
2 answers

Xhtml.of_string_unsafe disable onclick

I have a problem, here is a short example : Xhtml.of_string_unsafe(Xhtml.to_string()) And when i click on the button, nothing happen... Is there a bug in opa ?
trecouvr
  • 743
  • 5
  • 7
2
votes
0 answers

OPA Middleware with Dapr not invoking

I am unable to get the OPA middleware to execute on a service to service invocation. I am using the simple OPA example online and cannot seem to get it to trigger when invoking it from another services using service invocation. It seems I can hit it…
ewassef
  • 286
  • 2
  • 13
2
votes
2 answers

Opa build failure under OS X Lion

I've been wanting to get my hands dirty with Opa, but had been really feeling the lack of a REPL, which is my weapon of choice in coming to terms with a new language. Lo and behold, the Opa Blog mentioned a tool called opatop which appeared to be…
dfreeman
  • 2,834
  • 2
  • 20
  • 24
2
votes
1 answer

Create ResourceQuota objects to be deployed for each Namspace in repository

Need to create new ResourceQuota object, one for each namespace. The default ResourceQuota should be 2 CPU and 10 GB per namespace. Any solutions for the above scenario. Example I tried: apiVersion: v1 kind: ResourceQuota metadata: name:…
Sayon
  • 85
  • 8
2
votes
1 answer

How to get SimpleTable components working?

I have upload a little sample of SimpleTable : https://gist.github.com/1080278 Now, it compile but when I launch the server, I get that : File "stdlib/core/rpc/core/oparpc.opa", line 360, characters 12-123, (360:12-360:123 | 10511-10622) @fail:…
Mattgu74
  • 224
  • 1
  • 6
2
votes
4 answers

Looping over db intmap(person)

example: type person = { name : string ; age : int } db /person : intmap(person) I know how to get a single person from the db, but how do I get them all? and print them in a html table? Thx.
shomodj
  • 23
  • 2