Code Monkey home page Code Monkey logo

lpkit's Introduction

LPKit

A collection of different generic views & utilities for Cappuccino, extracted from Observer.

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

LPKit requires Cappuccino 0.8.1.

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.

ChartView

calendar view

A fully customizable chart view that can be used to implement either Bar or Line charts.

PieChartView

calendar view

A fully customizable pie chart view.

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.

Anchor Button

A control which can either simulate anchors, or if provided with a CPURL creates an anchor element. Useful for creating hyperlinks.

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.

Contributors

lpkit's People

Watchers

 avatar

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.