Skip to content

olueiro/fengari-phonegap-hello-world

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT #fengari on Freenode

fengari-phonegap-helloworld

Provides anything you need to run Lua (Fengari) in PhoneGap.

Download

Download zip and extract it into www folder in your PhoneGap project.

How to use

inline Lua code:

<body>
  <script type="text/lua">
    local js = require("js") --// require javascript main object
    local global = js.global --// global javascript object (global.document, global.window etc)

    local window = global.window

    window:alert("Hello World from Lua!") --// use semi-colon to call javascript methods

    -- add your code here...
  </script>
</body>

external Lua file:

<body>
  <script type="text/lua" src="path/to/your/file.lua"></script>
  
  <!-- Do not use `async` attribute for Lua files (WIP) -->
  
  <!-- Its recommended to use only local Lua files. However, for remote Lua files
       you must to include Access-Control-Allow-Origin header on requested resource.
  -->
  
</body>

Notes

This project adds a WeakMap polyfill provided by es6-map-shim.

There are any modifications over Fengari core.

License

MIT License

Copyright © 2017 Benoit Giannangeli

Copyright © 2017-2018 Daurnimator

Copyright © 2019 olueiro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Provides anything you need to run Lua (Fengari) in PhoneGap

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 45.5%
  • HTML 38.3%
  • Lua 16.2%