jasonkneen / util Goto Github PK
View Code? Open in Web Editor NEWCollection of utility scripts for Titanium (Alloy).
Collection of utility scripts for Titanium (Alloy).
I using your Share utility and its awesome.
but I need to share with instragram too
its is possible and you know how ?
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
@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?
How to show "via MYAPPNAME" ?
today show "via IOS"
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.
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"
}
Someone have this bug too?
< Alloy >
< NavigationWindow id="win1" module="xp.ui" >
< Window id="tableFiles" >
< TableView id="table" >< /TableView >
< /Window >
< /NavigationWindow >
< /Alloy >
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 ],
});
}
@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
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.
AFAIK there's no service, but it could do a regexp on:
https://play.google.com/store/apps/details?id=nl.tera.mrmovie&hl=nl
which has:
<div class="content" itemprop="softwareVersion"> 1.50.0 </div>
window animation has not been working while navigating the window. i have placed the slide animation xml's in platform->android->res->anim folder.
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?
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.
[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)
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.
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
After a user has said "not now" for maxrepeat
number of times, handle as "not for this version".
[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] : }
[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] : }
[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
@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.
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.
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> ";
Could you put a "setHtml" in this module ?
Thanks.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.