Giter VIP home page Giter VIP logo

trimethyl's Introduction

Archived - This repo has been archived and is not being maintained.

image

Trimethyl is a framework we built for our purposes. We built it on top of Appcelerator Titanium.

Most of these modules are proxies for Titanium API, and some of these add missing features or expose useful functions for cross platform development.

Check the API Documentation to see all modules and all methods you can use. If you like Dash Kapeli, download the Dash Kapeli Docset.

For a more descriptive usage, with examples and common use cases, check the wiki.

NPM version NPM downloads

Installation via NPM

NPM

Trimethyl comes with its own package manager for the internal libraries, because we don't want that the final user installs all libraries, but only the one which he uses. For this reason, you have to install it as a global helpers and install all libraries via CLI.

[sudo] npm install -g trimethyl

Installation of libraries

Now you have the CLI command trimethyl. To install your libraries, cd to your Alloy project, and just type:

trimethyl install

If is the first installation, the command will prompt to add the libraries you want to use.

Otherwise, it will perform a re-installation of all libraries configured in the trimethyl.json file.

You can pass these parameters to the install method:

--no-check-downgrade

Do not perform a check if current installation is a downgrade.

--no-check-majorupgrade

Do not perform a check if current installation is a major upgrade.

--native-module-skip

If a library depends on a native module, just skip the installation of the module.

--native-module-add

If a library depends on a native module, just add the native module to the tiapp.xml

--native-module-skip

If a library depends on a native module, try to install the native module via package manager (GITTIO).

Configure libraries

You can specify later (after installation) which libraries you want to add, just type:

trimethyl add {module}

It will add the library to your trimethyl.json file.

Now just type trimethyl install to perform the installation again.

Configuration

Each library reads from the config.json your personal configuration, extending its default.

For example, the module named {Module}, will read the Alloy.CFG.T.{module} object; the submodule {Sub} of {Module}, will read Alloy.CFG.T.{module}.{submodule}.

You can customize the options, editing your config.json file:

{
   "T":{
      "module": {
         "sub": {}
      },
   }
}

For example to set the base URL for the HTTP library, configure the T section just like this:

{
   "T":{
      "http":{
         "base": "http://yourserver.com/api/v1"
       }
    }
}

Initialization of the libraries

The first thing you have to do is, in your app/alloy.js file, to require the framework bootstrap and define a global helper T:

// Global T helper to load internal Trimethyl libraries
var T = function (name) { return require('T/' + name); }

// Bootstrap Trimethyl
T('trimethyl');

Requiring trimethyl using the code T('trimethyl') on startup will bootstrap some important framework files, set prototypes, TSS vars and Alloy.Globals variables.

You have to do that, otherwise some libraries will break up.

Libraries

To use a library, just require with T helper.

var Util = T('util');

It's useful to declare global modules that you'll use in the entire app in the alloy.js file to make them available through the variable name.

Otherwise, just like all CommonJS modules, you can require them later in your controllers.

UIFactory library

The UIFactory library is special library that handle all UI proxies. Thanks to an Alloy feature, you have the ability to create UI objects directly from Alloy Views, using the module keyword. For example:

<Alloy>
	<Window title="Awesome window" module="T/uifactory">
		<TextField module="T/uifactory" />
	</Window>
</Alloy>

Example app

You can check an example app here: https://github.com/caffeinalab/magneto

API Documentation

Please refer to the documentation for full-usage of all APIs.

Dash Kapeli URL

dash-feed://https%3A%2F%2Fraw.githubusercontent.com%2Fcaffeinalab%2Ftrimethyl%2Fmaster%2Fdocset%2FTrimethyl.xml

Copyright and license

Copyright 2014 Caffeina srl under the MIT license.

trimethyl's People

Contributors

chiquitto avatar douglashennrich avatar fokkezb avatar gitter-badger avatar ianko avatar jei avatar kopiro avatar progress44 avatar seanhussey avatar topener avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trimethyl's Issues

Illegal invocation function in T/permissions.js

Hi guys!
Thanks for the great work, I'm having a problem using the camera module that makes use of the permissions. Apparently it is related to the execution of the has() function, if I change directly to Ti[type.proxy]['has' + type.name + 'Permissions'](), everything works as expected.
Do you have any idea how I can solve this problem?

[ERROR] TiExceptionHandler: (main) [4233,10986] ----- Titanium Javascript Runtime Error -----
[ERROR] TiExceptionHandler: (main) [0,10986] - In T/permissions.js:1,69
[ERROR] TiExceptionHandler: (main) [0,10986] - Message: Uncaught TypeError: Illegal invocation
[ERROR] TiExceptionHandler: (main) [0,10986] - Source: ="+e.proxy+" - type.name="+e.name),console.log("aqui0"),void(!0!==r.call()?(co
[ERROR] V8Exception: Exception occurred at T/permissions.js:1: Uncaught TypeError: Illegal invocation
[ERROR] Uncaught TypeError: Illegal invocation @ [object App]:1

Trimethyl install bug

Hello,

Si i followed this post : https://developers.caffeina.com/crosplatform-app-development-907a9788c668

when install a module :

  • trimethyl install
  • select module with keyboard space
  • hit enter

I got error :
` is not a valid Trimethyl library./usr/local/lib/node_modules/trimethyl/cli.js:412
if (trimethyl_map[name].internal) {
^

TypeError: Cannot read property 'internal' of undefined
at Command. (/usr/local/lib/node_modules/trimethyl/cli.js:412:26)
at Command.listener (/usr/local/lib/node_modules/trimethyl/node_modules/commander/index.js:315:8)
at emitTwo (events.js:126:13)
at Command.emit (events.js:214:7)
at Command.parseArgs (/usr/local/lib/node_modules/trimethyl/node_modules/commander/index.js:651:12)
at Command.parse (/usr/local/lib/node_modules/trimethyl/node_modules/commander/index.js:474:21)
at Object. (/usr/local/lib/node_modules/trimethyl/cli.js:468:9)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
`

zoomimageview - how to use module "org.iotashan.TiTouchImageView"

Hello, i have a general question about this project, in particolar about the component “uifactory/zoomimageview.js”. I noticed that it uses the native module “org.iotashan.TiTouchImageView” for OS android. I downloaded it from "https://github.com/iotashan/TiTouchImageView" but I don't know how to use it: I have an error like “module not found”, like I am not placing the right folder in the right path or I'm missing something, even if I followed this istructions too (http://docs.appcelerator.com/titanium/latest/#!/guide/Using_a_Module). Could you help me how to use "org.iotashan.TiTouchImageView"?
Thank you.

Stefano Bertoli, Creative Web Specialist Brescia Italy

select concatened

kopiro if you have time before go to drink a beeer at codemotion....
I have selectA
which take data from a table from remote server and a selectB
that have to take data from another table but using selected selectA value to create a subset data with query.
I don't understand how I can take value of selectA on selectA change event and ask to remote server to update selectB data...

T/ga Google Analytics not working with 7.3.1GA

after upgrading project to 7.3.1GA started to receive the following message while launching the application:

[ERROR] : GA: initialization failed, unable to find module

The module ti.ga seems to be correctly installed.

Share PDF file

Is there a way i can share (for mms, whatsapp, email) a pdf file? instead only the url it self?

Best installer handling

If you interrupt the installation, you get an half installation of the files.
The files must be copied in block.

[ui/select type=date] init value

how I can set init value and init format?
if I use dateformat in xml file this component will ave theValue property set correctly but I can see date on the screen(I suppose text property)

web dir of WebAlloy

I try to put web directory into app dir, into root diir, into asets dir...
but every time I received error:
Weballoy: File not found (web/app.tpl)
and more... one for every file I create.
I simply create
var WebAlloy= T('weballoy');
WebAlloy.createView({
name: 'inno'
});

where I have to create web directory?

Android: Window.exitOnBack closes the current activity instead of the main

When Window.exitOnBack is set to true, the back button is supposed to close the main activity of the Titanium app. What we're doing instead is:

			$this.addEventListener('androidback', function() {
				$this.exitOnClose = true; // Set exitOnClose to true, since every window is an activity
				Ti.Android.currentActivity.finish();
			});

which means that the main activity of the app still exists even after pressing the back button.
One side effect is that the previous intent data is retained if we open the app again from the opened apps menu, which means that, if we start the app with a url schema, it will be read again.

[ui/select type=date] on choose date crash

with last update this evening when I choose a date with select with type="date" it crash
[ERROR] : Script Error {
[ERROR] : backtrace = "#0 () at file:///Users/admin/Library/Developer/CoreSimulator/Devices/1DC94833-A0E0-485E-A966-C764203AD813/data/Containers/Bundle/Application/26C20F6F-749B-496D-8C01-1D7C2F6225B3/Iluna%20Cat.app/T/uifactory/select.js:54";
[ERROR] : line = 102;
[ERROR] : message = "'undefined' is not a function (evaluating '$popover.close()')";
[ERROR] : name = TypeError;
[ERROR] : sourceId = 319682720;
[ERROR] : sourceURL = "file:///Users/admin/Library/Developer/CoreSimulator/Devices/1DC94833-A0E0-485E-A966-C764203AD813/data/Containers/Bundle/Application/26C20F6F-749B-496D-8C01-1D7C2F6225B3/Iluna%20Cat.app/T/uifactory/select.js";
[ERROR] : }

sample of youtube video player

After I create YoutubeVideoPlayer
I put in a click buttton event this code
require('T/uifactory').createYoutubeVideoWebView({videoId:"kZ2JnCx0a7A"});

but nothng happned?
sample? idea?
thanks

INIT SELECT TYPE=DATE

I tried to init using text property and I see correct date, but when I try to open it start with today, in fact if I don't change the date it save current date.
So I tried to set theValue property with
$.delivery_date.theValue= plib.StringToDate(riga_ordine['delivery_date']);
where StringToDate convert a string date DD/MM/YYYY into a Date
how I can init a select?

Examples in the documentation

Is there any plan to include examples in the documentation? I missed to understand some things in the beginning, I believe it can help other developers.
Can I contribute to this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.