Coder Social home page Coder Social logo

util's Introduction

UTiL Titanium Alloy

A collection of utility libraries for Appcelerator's Titanium and it's Alloy MVC framework. The app contains samples and tests for some of the libraries.

This is a public, but personal library. It may change at any time without notice! Feel free to fork and contribute, but I'll decide what PR's to accept based on their potential use for my own projects.

XCallbackURL: docs / source

CommonJS module for parsing URLs according to the X-Callback-URL standard.

Alloy: docs / source

CommonJS module to allow modules built for Alloy to function in classic projects.

Gate: docs / source / example

CommonJS module providing simple mathematical question as parental gate for kids apps.

Image: docs / source / example

CommonJS module providing image manipulation methods.

Menu: docs / source

CommonJS module for managing the Android Activity Menu and ActionBar.

Rate: docs / source

CommonJS module popping the 'rate-my-app' question at just the right time.

Reporter: docs / source

CommonJS module using yy.logcatcher to let the user report run-time errors.

Share: docs / source

CommonJS module providing a one-in-all social sharing solution for iOS and Android.

CommonJS module extending some Ti.UI.create* factories.

Update: docs / source

CommonJS module checking for updates of the app.

Urban Airport: docs / source

CommonJS module wrapping Appcelerator's iOS and Android modules for Urban Airship.

Validate: docs / source

CommonJS module providing validation.

XP.UI: docs / source

CommonJS module providing cross-platform UI elements.

License

Copyright 2013-2015 Fokke Zandbergen

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

util's People

Contributors

botmaster avatar fokkezb avatar hansemannn avatar helloszabi avatar iotashan avatar jasonkneen avatar joseandro avatar kopiro avatar nicka avatar pabloveintimilla avatar ricardoalcocer avatar wood1k avatar xcash 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  avatar

Watchers

 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

util's Issues

reporter module raise error: ActionBarView can only be used with android:layout_width="match_parent" (or fill_parent)

[ERROR] :  TiExceptionHandler: (main) [306,86639] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [0,86639] - In reporter.js:2,14
[ERROR] :  TiExceptionHandler: (main) [0,86639] - Message: Uncaught Error: ActionBarView can only be used with android:layout_width="match_parent" (or fill_parent)
[ERROR] :  TiExceptionHandler: (main) [0,86639] - Source:     Ti.Media.takeScreenshot(function(screenshot) {
[ERROR] :  V8Exception: Exception occurred at reporter.js:2: Uncaught Error: ActionBarView can only be used with android:layout_width="match_parent" (or fill_parent)

Ui.js use in a ListView ( multiple instances )

@FokkeZB , thank you again for the prior code update to handle remote images, this module is great and I use it frequently. That said I have hit a bit of a snag in terms of multiple instances of this in a list view.

In short, I am using a list view and an itemTemplate where I have 4 of these <View module="ui"... setup in a grid. Each with it's own unique bindId. In the creation of the list view I am setting the correct properties.

The behaviour I am getting is a bit odd. In short the first of the 4 views works as it should, but the other 3 are blank. When I the code of the other 3 to <ImageView ... everything works so I can rule out any view positioning issues.

I am thinking that there is some mechanic of ListvView and instance of Ui.js that is only allowing one of the 4 Views to work correctly.

Thoughts? and many thanks.

@masterbee

Alloy.js

Firstly, I am not sure where to place the file.
Secondly, Alloy seems to be falling over on:

    exports.infect(scope) {

Suggesting that it is not valid js.

I want to use it in an alloy project, as I like the way (as fas as I understand) that I could use "if(ENV_DEVELOPMENT)" etc throughout my project.

Please help.

Share with Instagram

I using your Share utility and its awesome.
but I need to share with instragram too
its is possible and you know how ?

Changing the image

Hi @FokkeZB,

I am noticing that the only way to change the image is to change the backgroundImage property and then trigger a post layout event. Is this the correct way to change the image? I was hoping to have the new image go through the same treatment as the original by being resize and cropped to cover correctly.

I am not sure that is the right way since the first image is well proportioned but the next image get treated like the regular Alloy background image ( sized and distorted to fit )...

Thoughts?

Alloy Code:

<View id="cover" module="utilities/image" onSingletap="addCover" backgroundImage="images/personal.cover.create.jpg" backgroundSize="cover" bottom="25%"   top="0">
 <View  id="covertext" class="fillwidth vertical" top="30dp" touchEnabled="false" >
  <Label text="+" top="0" class="fullwidth huge-font-bold font-white" textAlign="center" touchEnabled="false"/>
  <Label text="L('add_cover', 'Add Cover')" top="0" class="fullwidth large-font-bold font-white" textAlign="center" touchEnabled="false" />
 </View>
</View>

JS:

function addCover( e ) {
    addImage( e );
    $.covertext.visible = false;
});

function addImage( e ) {
    var source = e,
    element = e.source;

    Ti.Media.openPhotoGallery({
        success: function( event ) {
            var cropRect = event.cropRect;
            var image = event.media;
            if ( event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO ) {
                var cropped = Image.fit( image, cropRect, true );
                element.backgroundImage = cropped;
                element.rawData = cropped;
                element.fireEvent( 'postlayout' );
            }

        },
        cancel: function() {},
        error: function( error ) {},
        allowEditing: true,
        showControls: true,
        mediaTypes: [ Ti.Media.MEDIA_TYPE_PHOTO ],
    });
}

*** -[NSURL initFileURLWithPath:]: nil string parameter

I'm using the UI module in order to use backgroundSize. I'm getting a strange error though. Here's my alloy code and the error.

<View module="ui" class="avatar-wrapper" backgroundSize="cover" width="96" height="96" backgroundImage="images/no-user.png"></View>
I tried a / before images as well..

[ERROR] [iphone, 8.4, 192.168.1.6] {
  "message": "*** -[NSURL initFileURLWithPath:]: nil string parameter",
  "line": 38,
  "column": 70,
  "stack": "_resizeBackgroundImage\n_setBackgroundImage\ncreateView\nController\ncreateController\n\nemit\ndispatch\nsetState\n\n\nonload"
}

xp.ui labels in listview itemtemplate

Hey @FokkeZB,

Is there a way to use the xp.ui overrides for createLabel in list view templates? Alloy renders those templates in a different way then ordinary labels, making it ignore the module declaration.

I'd still like to use this logic though somehow. Any advice would be appreciated.

xp.ui compile issue

When I follow the instructions for "How to use it" on https://github.com/FokkeZB/UTiL/tree/master/xp.ui, I get Alloy compile issues:

[INFO] : [config.json] config.json unchanged, using cached config.json...
[INFO] : file-name">
[ERROR] : (err);
[INFO] : ">
[ERROR] : -message" class="flash flash-error">
[ERROR] : -dismiss" aria-label="Dismiss error">
[ERROR] :
[ERROR] : (/usr/local/lib/node_modules/alloy/node_modules/uglify-js/lib/parse.js:189:18)
[ERROR] : (/usr/local/lib/node_modules/alloy/node_modules/uglify-js/lib/parse.js:197:11)
[ERROR] : (/usr/local/lib/node_modules/alloy/node_modules/uglify-js/lib/parse.js:664:9)
[ERROR] : Alloy compiler failed

If I delete app/lib/xp.ui.js and try to recompile it's working fine.

Ti 3.4.1, OSX, attempting to compile to the iOS simulator.

Tags are not written to the UA tags

When i'm setting tags with a string:

[DEBUG] :  [URBANAIRPORT] INIT: {
[DEBUG] :   "debug": true,
[DEBUG] :   "sound": true,
[DEBUG] :   "vibrate": true,
[DEBUG] :   "badge": true,
[DEBUG] :   "alert": true,
[DEBUG] :   "autoBadge": false,
[DEBUG] :   "compatibility": true,
[DEBUG] :   "alias": "WooD1k",
[DEBUG] :   "tags": "1.0"
[DEBUG] :  }
[DEBUG] :  [URBANAIRPORT] setting autoBadge
[INFO] :   [object DkNappSocialModule] loaded
[INFO] :   [object TiUrbanairshipModule] loaded
[ERROR] :  Script Error {
[ERROR] :      backtrace = "#0 () at file:///Users/achu/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/alloy/underscore.js:87\n#1 () at file:///Users/achu/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/urbanairport.js:78";
[ERROR] :      line = 46;
[ERROR] :      message = "Invalid type passed to function";
[ERROR] :      nativeLocation = " in -[TiUrbanairshipModule setTags:] (TiUrbanairshipModule.m:325)";
[ERROR] :      nativeReason = "expected: NSArray, was: __NSCFString";
[ERROR] :      sourceId = 294708192;
[ERROR] :      sourceURL = "file:///Users/achu/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/urbanairport.js";
[ERROR] :  }

When i'm trying to set tags as a variable(string):

[DEBUG] :  [URBANAIRPORT] INIT: {
[DEBUG] :   "debug": true,
[DEBUG] :   "sound": true,
[DEBUG] :   "vibrate": true,
[DEBUG] :   "badge": true,
[DEBUG] :   "alert": true,
[DEBUG] :   "autoBadge": false,
[DEBUG] :   "compatibility": true,
[DEBUG] :   "alias": "WooD1k",
[DEBUG] :   "tags": "1.0"
[DEBUG] :  }
[DEBUG] :  [URBANAIRPORT] setting autoBadge
[ERROR] :  Script Error {
[ERROR] :      backtrace = "#0 () at file:///Users/achu/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/alloy/underscore.js:87\n#1 () at file:///Users/achu/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/urbanairport.js:78";
[ERROR] :      line = 46;
[ERROR] :      message = "Invalid type passed to function";
[ERROR] :      nativeLocation = " in -[TiUrbanairshipModule setTags:] (TiUrbanairshipModule.m:325)";
[ERROR] :      nativeReason = "expected: NSArray, was: __NSCFString";
[ERROR] :      sourceId = 295896032;
[ERROR] :      sourceURL = "file:///Users/achu/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/urbanairport.js";
[ERROR] :  }

When i'm trying to set tags as an array with 1 variable(string), it works, but tags are not written to the UA tags:

[DEBUG] :  [URBANAIRPORT] INIT: {
[DEBUG] :   "debug": true,
[DEBUG] :   "sound": true,
[DEBUG] :   "vibrate": true,
[DEBUG] :   "badge": true,
[DEBUG] :   "alert": true,
[DEBUG] :   "autoBadge": false,
[DEBUG] :   "compatibility": true,
[DEBUG] :   "alias": "WooD1k",
[DEBUG] :   "tags": [
[DEBUG] :       "1.0"
[DEBUG] :   ]
[DEBUG] :  }
[DEBUG] :  [URBANAIRPORT] setting autoBadge
[DEBUG] :  Loading: /Users/achu/Library/Application Support/iPhone Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/alloy/controllers/index.js, Resource: alloy/controllers/index_js
[DEBUG] :  Loading: /Users/achu/Library/Application Support/iPhone Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/alloy/controllers/BaseController.js, Resource: alloy/controllers/BaseController_js
[DEBUG] :  Loading: /Users/achu/Library/Application Support/iPhone Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/ti.cloud.js, Resource: ti_cloud_js
[DEBUG] :  Loading: /Users/achu/Library/Application Support/iPhone Simulator/7.0/Applications/57B00B44-FBBD-4E0B-8499-D9DE3A21FD53/datingList.app/alloy/controllers/log_in.js, Resource: alloy/controllers/log_in_js
[DEBUG] :  Application booted in 1188.112974 ms

Image URL without file extension fails

@FokkeZB
Try this URL as a backgroundImage on a view with module="ui"
http://scene7.targetimg1.com/is/image/Target/14892950?wid=480&hei=480

Get the following error on the console and the image never renders
[UI] Could not write downloaded file to: file:///Users/shekyboy/Library/Developer/CoreSimulator/Devices/2BA6217A-8675-4839-B11C-63140D25DC0E/data/Containers/Data/Application/CB611D38-3182-46A2-A480-1039923DC56C/tmp/dd511f123993e678b57373e7d51626b9dd7f3fe5.com/is/image/Target/14892950%3Fwid=480&hei=480

Think this might be an issue with servers which serve images dynamically and expect clients to operate using mime type information rather than extensions in the URL.

Any recommendations on how to fix this

Tags or Alias not are set !

It registers the device ok, but no tags or alias is set.

using:
Titanium SDK 3.2.0 GA
IOS SDK 7.0
Classic Titanium project

About passing the data into facebook using facebook app dailog

Hi fokke,
I am using this module for sharing the comments in android and i am facing the issue in sharing the text in facebook. when i am trying to share the text, it will open the andriod facebook native app dailog properly but i cant see any text into the facebook dailog, i am sharing url also but nothing is display into dailog.

I need your help in solving this issue.

Thanx

fb

html in iOS for links and other tags are hard to format

hi @FokkeZB,

I am truly enjoying this module since it is really handy and I am experimenting with the attributeString. I am having a bit of a hard time trying to format the text for the following html. I really would like the links to be just a different colour and linkable, but they are alway a noticably smaller text, I was under the impression from your code base that it keeps the labels font size and type as a default.

Thoughts?

  html = "Been having a lot of fun with my photography of late. Still happy with my <a href=\"#Nikon\"><font color=\"#003a76\" face=\"Helvetica-Light\">#Nikon</font></a> <a href=\"#D300S\"><font color=\"#003a76\" face=\"Helvetica-Light\">#D300S</font></a> 5 years later. <a href=\"#quality\"><font color=\"#003a76\" face=\"Helvetica-Light\">#quality</font></a> <a href=\"#greatinvestment\"><font color=\"#003a76\" face=\"Helvetica-Light\">#greatinvestment</font></a> <a href=\"#photography\"><font color=\"#003a76\" face=\"Helvetica-Light\">#photography</font></a> ";

screen

gate.js

This is most probably something that no one but apple can do - but in landscape mode the text is hidden - its scrolled down too far, you have to scroll the text up to read the question. Even though when you do scroll up all of the text does actually fit in - most odd, and a little frustrating - but like I speculate, there is probably nothing we can do about it, just though i'd check before writing it off.

add URL capability to ui.js backgroundImage

@FokkeZB , great work on this this backgroundImage:cover issue. I was wondering, since you are already working with the file image natively, and leveraging Ti.Blob. Could we add in the capability for the backgroundImage to be a URL? IMHO it is what is truly missing from the Ti.UI.View.

Thoughts?

UALib: No APID ...

Hi there.

I'm trying to implement your urbanairport wrapper in my titanium alloy project.

I have a checkbox that is supposed to register the device for push notifications but when I check it and try register it I'm getting the following errors.

[ERROR] : E/**** - UALib: No APID. Cannot delete.

I suspect I might have my airshipconfig.properties file in the wrong location.

It's currently in the ~/platform/android/bin/assets folder but my project explorer is saying that everything after ~/platform/android is "[ignored]".

Could this be the problem?

Kind Regards and thanks in advance.

Devon Britton.

xp.ui commonjs module & tiShadow

I'm not sure if tiShadow even supports the new module attribute in Alloy views, but I am trying to use xp.ui.js in a view and tiShadow isn't liking it:

Couldn't find module: /xp.ui

I have tried many different paths and none have worked yet. Anyone found a way to get this working in tiShadow?

[ERROR] [UI] backgroundImage not found

I get this Error

[ERROR] [UI] backgroundImage not found: file:///android_asset/Resources/images/appicon.png

That's a part of the View

<View class="iconColumn">
    <View module="ui" backgroundSize="cover" class="categoryIcon" backgroundImage="images/appicon.png" />
</View>

The image lies in app/assets/android/images. Without the module its working.

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.