kwiksher / Bookshelf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bookshelf Sample

This Bookshelf folder is Project Root Folder of Kwik.

Work cicle if updates are available

  1. Update tmplt

    tmpl folder of Boo01, Book02, BookTOC is the git submoule of kwik4tmplt

    git submodule update --remote
    
  2. Publish Book01, Book02, BookTOC with Kwik

    use export images off. If you don't change layer images of psd files

  3. Update assets.zip files in BookServer

    Open compress_assets/main.lua with Solar2D

    run http-server

  4. Update src files of BookshelfEmbedded

    Open copy_projects/main.lua with Solar2D

    this will overwrite the lua files from BookTOC/build4, Book01/build4, Book02/build4

    Beaware the files in components/store folders are updated by this copy_projects. Previous local changes in that folder will be lost such as model.lua's debug flag

BookServer

BookServer folder contains the following folders

  • bookshelf

    this folder contains the assets of downloadable books. You run a local http-server

    or upload the files to your web server for BookShelfEmbedded project to fetch them.

  • compress_assets

    for downloadManger V2, the assets of downloadable books are zipped with this tool

    you need to edit the books table of main.lua for your projects

    local books = {
      {project = "Book01", serverFolder = "book01"},
      {project = "Book02", serverFolder = "book02"},
    }
    
    local onLineImages = {
        {project = "Book01", serverFolder = "book01", image = "build4/assets/images/p1/bg@4x.png"},
        {project = "Book02", serverFolder = "book02", image = "build4/assets/images/p1/bg@4x.png"},
    }
  • copy_books(obsolete)

    for downloadMnager V1 the assets of books are zipped with this tool

  • copy_pages

    for BookshelfPages project, the assets of pages are zipped with this tool.

BookShelfEmbedded

this is the main project of Bookshelf. This folder is a Solar2D project.

  • You find the copy_project tool to collect each Book project into App folder

    main.lua

    local model = {
        {project = "BookTOC", appFolder = "TOC", suffix="", downloadable=false},
        {project = "Book01", appFolder = "book01", suffix="", downloadable=true},
        {project = "Book02", appFolder = "book02", suffix="", downloadable=true},
    }

Book01, Book02 and BookTOC folders are sample books projects for BookshelfEmbedded


localhost

BookServer you need to run http-server as localhost:8080

for instance

Then you can run BookShelfEmbedded's main.lua. It loads the plugin. Then the plugin access App/Toc.

.
├── BookServer
│   ├── bookshelf
│   │   ├── book01
│   │   │   ├── assets.zip
│   │   │   └── bg.png
│   │   └── book02
│   │       ├── assets.zip
│   │       └── bg.png
├── BookShelfEmbedded
    ├── App
    │   ├── TOC
    │   ├── book01
    │   └── book02
    ├── build.settings
    ├── config.lua
    ├── extlib
    ├── lib
    ├── main.lua

TOC, book01, boo02 have to be made with Kwik.


external host

xcode simulator does not support localhost. You need https server.

If you add NSException to build.settings, http non SSL server is allowed.

https://docs.coronalabs.com/guide/hardware/appleATS/index.html#managing-app-transport-security-iosmacos

    NSAppTransportSecurity =
    {
        NSExceptionDomains =
        {
            ["kwiksher.com"] =
            {
                NSIncludesSubdomains = true,
                NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
            },
        },
    },

Other configuration for device build

  • config.lua needs google license key
  • build.settings needs the following permissions
  android  =
  {
  usesPermissions  =
   {
          "android.permission.WRITE_EXTERNAL_STORAGE",
           "com.android.vending.BILLING",
           "android.permission.INTERNET",
           "com.android.vending.CHECK_LICENSE"
    },
  },

Copyrights and Licenses

extlib folders contains the following libraries and they follow each license described in README.md in https://github.com/kwiksher/kwik4tmplt

  • DMC classes, by David McCuskey
  • gTween class, by Josh Tynjala (modified by Kwiksher)
  • bTween class, by Josh Tynjala (modified by Kwiksher)
  • syncSound class, by David Fox (modified by Kwiksher)
  • page_curl by Steven Johnson
  • Robotlegs by Jesse Warden
  • iap_badger by happymongoose
  • The State Machine Compiler from http://smc.sourceforge.net XS

About


Languages

Language:Lua 99.5%Language:Shell 0.4%Language:Batchfile 0.1%Language:VBScript 0.0%