luddep / LPKit

A collection of re-usable views, controls & utilities for Cappuccino.

This URL has Read+Write access

LPKit /
name age message
file CPArray+Additions.j Fri Dec 11 09:50:23 -0800 2009 added LPAnchorButton, and started working on be... [luddep]
file Info.plist Fri Oct 16 11:35:28 -0700 2009 reverted change in plist, made loads freeze. [luddep]
file Jakefile Fri Dec 11 09:50:23 -0800 2009 added LPAnchorButton, and started working on be... [luddep]
file LICENSE Mon Oct 12 12:40:11 -0700 2009 added license [luddep]
file LPAnchorButton.j Sat Dec 12 08:18:26 -0800 2009 removed min-size theme attr on LPAnchorButton [luddep]
file LPCalendarHeaderView.j Sun Dec 06 09:39:41 -0800 2009 Fixed: if a loaded CalendarView was resized hor... [aljungberg]
file LPCalendarMonthView.j Tue Dec 29 17:52:21 -0800 2009 Fixed: if a window had a toolbar, clicking to s... [aljungberg]
file LPCalendarView.j Sun Dec 06 09:39:42 -0800 2009 Moved some initialization code from setMonth to... [aljungberg]
file LPChartView.j Sat Jan 02 02:56:19 -0800 2010 fixed a bug in chartView that happened if you a... [luddep]
file LPCookieController.j Thu Nov 12 11:21:55 -0800 2009 added LPCookieController [luddep]
file LPEmail.j Sun Dec 06 08:35:38 -0800 2009 Shouldn't be two calls to test the email patter... [luddep]
file LPKit.j Fri Dec 11 09:50:23 -0800 2009 added LPAnchorButton, and started working on be... [luddep]
file LPLocationController.j Sat Nov 21 13:48:00 -0800 2009 added LPLocationController, docs & examples com... [luddep]
file LPSlideView.j Thu Nov 19 12:34:25 -0800 2009 optimized calendarview. [luddep]
file LPSparkLine.j Wed Nov 18 11:49:56 -0800 2009 Made sparkline CPCoding compatible and made dra... [luddep]
file LPSwitch.j Sun Nov 08 11:09:13 -0800 2009 label-offset needed a default to not break when... [luddep]
file LPURLPostRequest.j Sat Nov 07 11:59:16 -0800 2009 initial LPSwitch commit, not yet finished. [luddep]
file LPViewAnimation.j Sat Nov 07 15:49:11 -0800 2009 added theming to LPSwitch [luddep]
file README.markdown Thu Nov 12 11:25:37 -0800 2009 updated readme to use valueForKey in a more obv... [luddep]
directory Resources/ Mon Oct 12 12:34:29 -0700 2009 initial commit [luddep]
README.markdown

LPKit

A collection of different generic views & utilities for Cappuccino, extracted from the up-coming cappuccino port of Observer.

A demo is available at http://luddep.se/static/LPKit-Examples/, with the source code in the LPKit-Examples repository.

LPKit requires a version higher than 0.7.1 to run, which at the time of writing is only available as the master (or jake) trunk.

Installation

Place the entire LPKit folder in your Frameworks folder, or any directory that you add using OBJJ_INCLUDE_PATHS.

What's inside

Slide view

LPSlideView lets you slide between different subviews. Only one subview will be visible, and the sliding only shows the relevant subviews - no matter how many other views might be between them.

Calendar view

calendar view

LPCalendarView is a calendar view based on the iPhone calendar app, with the same sliding when changing months. Currently supports selecting days & weeks, also marking a special day as highlighted - such as the current day or week.

Sparkline

sparkline

A simple sparkline chart, comparable to the Google Chart sparklines - but using CoreGraphics rather than an image.

Switch control

switch control

A port of the UISwitch from the iPhone SDK, with the same behavior and feel.

Utilities

LPEmail

A simple object which lets you validate emails, for now. NOTE: the current regexp is broken, needs to be replaced with one that actually works.

LPURLPostRequest

A wrapper around CPURLRequest to make working with post requests a bit simpler. Rather than manually settings the HTTPBody & Content-Type, you pass it a javascript object with key value pairs of strings which you want to send as a POST request.

Example:

var request = [LPURLPostRequest requestWithURL:[CPURL URLWithString:@"/my-url/"]],
    content = {
                  'name': 'Lorem ipsum',
                  'age': '18'
              };

[request setContent:content]
[CPURLConnection connectionWithRequest:request delegate:self];

LPCookieController

A utility class to work with document.cookie, without the tedious stuff.

Example:

var cookieController = [LPCookieController sharedCookieController];

// Set a session, which will be deleted when the browser closes.
[cookieController setValue:@"My value" forKey:@"MyKey"];

// Set a cookie which won't be flushed
[cookieController setValue:@"My value" forKey:@"MyOtherKey" expirationDate:[CPDate distantFuture]];

// Get the value of the session
console.log('value for MyKey: ' + [cookieController valueForKey:@"MyKey"]);

Themes

LPKit makes heavy use of the theme API in Cappuccino. An example on how to use themes with LPKit is available in in the LPKit-Examples repository which has a demo theme with an Aristo inspired look.