Commit a8261345 by 杨子

增加送货地址插件

parent 022b3923
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
......@@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -329,7 +329,7 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
......
.woocommerce-account .add-new-address {
clear: both;
}
.woocommerce-account .address-book .wc-address-book-meta {
float: right;
}
.woocommerce-account .address-book .wc-address-book-meta a {
display: block;
}
.woocommerce-account .address-book .wc-address-book-meta a:hover {
cursor: pointer;
}
.wc-updating:before {
bottom: 0;
content: "";
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 9999;
}
(function (window, $, undefined) {
$(document).ready(function () {
// Select2 Enhancement if it exists
if ($().select2) {
var wc_address_book_select_select2 = function () {
$('select#shipping_address:visible, select#address_book:visible').each(function () {
$(this).select2();
});
};
wc_address_book_select_select2();
}
/*
* AJAX call to delete address books.
*/
$('.address_book .wc-address-book-delete').click(function (e) {
e.preventDefault();
$(this).closest('.wc-address-book-address').addClass('blockUI blockOverlay wc-updating');
var name = $(this).attr('id');
$.ajax({
url: wc_address_book.ajax_url,
type: 'post',
data: {
action: 'wc_address_book_delete',
name: name
},
success: function (response) {
$('.wc-updating').remove();
}
});
});
/*
* AJAX call to switch address to primary.
*/
$('.address_book .wc-address-book-make-primary').click(function (e) {
e.preventDefault();
var name = $(this).attr('id');
var primary_address = $('.woocommerce-Addresses .u-column2.woocommerce-Address address');
var alt_address = $(this).parent().siblings('address');
// Swap HTML values for address and label
var pa_html = primary_address.html();
var aa_html = alt_address.html();
alt_address.html(pa_html);
primary_address.html(aa_html);
primary_address.addClass('blockUI blockOverlay wc-updating');
alt_address.addClass('blockUI blockOverlay wc-updating');
$.ajax({
url: wc_address_book.ajax_url,
type: 'post',
data: {
action: 'wc_address_book_make_primary',
name: name
},
success: function (response) {
$('.wc-updating').removeClass('blockUI blockOverlay wc-updating');
}
});
});
/*
* AJAX call display address on checkout when selected.
*/
function shipping_checkout_field_prepop() {
var that = $('#address_book_field #address_book');
var name = $(that).val();
if (name !== undefined) {
if ('add_new' == name) {
// Clear values when adding a new address.
$('.shipping_address input').not($('#shipping_country')).each(function () {
$(this).val('');
});
// Set Country Dropdown.
// Don't reset the value if only one country is available to choose.
if (typeof $('#shipping_country').attr('readonly') == 'undefined') {
$('#shipping_country').val('').change();
$("#shipping_country_chosen").find('span').html('');
}
// Set state dropdown.
$('#shipping_state').val('').change();
$("#shipping_state_chosen").find('span').html('');
return;
}
if (name.length > 0) {
$(that).closest('.shipping_address').addClass('blockUI blockOverlay wc-updating');
$.ajax({
url: wc_address_book.ajax_url,
type: 'post',
data: {
action: 'wc_address_book_checkout_update',
name: name
},
dataType: 'json',
success: function (response) {
// Loop through all fields incase there are custom ones.
Object.keys(response).forEach(function (key) {
$('#' + key).val(response[key]).change();
});
// Set Country Dropdown.
$('#shipping_country').val(response.shipping_country).change();
$("#shipping_country_chosen").find('span').html(response.shipping_country_text);
// Set state dropdown.
$('#shipping_state').val(response.shipping_state);
var stateName = $('#shipping_state option[value="' + response.shipping_state + '"]').text();
$("#s2id_shipping_state").find('.select2-chosen').html(stateName).parent().removeClass('select2-default');
// Remove loading screen.
$('.shipping_address').removeClass('blockUI blockOverlay wc-updating');
}
});
}
}
}
shipping_checkout_field_prepop();
$('#address_book_field #address_book').change(function () {
shipping_checkout_field_prepop();
});
});
})(window, jQuery);
# Copyright (C) 2018 WooCommerce Address Book
# This file is distributed under the same license as the WooCommerce Address Book package.
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce Address Book 1.3.4\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-address-book\n"
"POT-Creation-Date: 2018-03-06 01:20:10+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#: templates/myaccount/my-address-book.php:34
msgid "Shipping Address Book"
msgstr ""
#: templates/myaccount/my-address-book.php:37
msgid "The following addresses are available during the checkout process."
msgstr ""
#: templates/myaccount/my-address-book.php:71
msgid "Edit"
msgstr ""
#: templates/myaccount/my-address-book.php:72
msgid "Delete"
msgstr ""
#: templates/myaccount/my-address-book.php:73
msgid "Make Primary"
msgstr ""
#: woocommerce-address-book.php:36
msgid "WooCommerce Address Book requires WooCommerce and has been deactivated."
msgstr ""
#: woocommerce-address-book.php:221
msgid "Add New Shipping Address"
msgstr ""
#: woocommerce-address-book.php:269 woocommerce-address-book.php:551
msgid "Address Book"
msgstr ""
#: woocommerce-address-book.php:304
msgid "required"
msgstr ""
#: woocommerce-address-book.php:355
msgid "Select a country&hellip;"
msgstr ""
#: woocommerce-address-book.php:363
msgid "Update country"
msgstr ""
#: woocommerce-address-book.php:566
msgid "Add New Address"
msgstr ""
#. Plugin Name of the plugin/theme
msgid "WooCommerce Address Book"
msgstr ""
#. Description of the plugin/theme
msgid ""
"Gives your customers the option to store multiple shipping addresses and "
"retrieve them on checkout.."
msgstr ""
#. Author of the plugin/theme
msgid "Hall Internet Marketing"
msgstr ""
#. Author URI of the plugin/theme
msgid "https://hallme.com"
msgstr ""
=== WooCommerce Address Book ===
Contributors: hallme, doomwaxer, timbhowe
Tags: WooCommerce, address book, multiple addresses, address
Requires at least: 4.0
Tested up to: 5.0.2
Stable tag: 1.4.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Gives your customers the option to store multiple shipping addresses and retrieve them on checkout.
== Description ==
Gives your customers the option to store multiple shipping addresses and retrieve them on checkout. Addresses can be updated and modified quickly and easily in /my-account/, or saved as part of the checkout process.
= Code =
View the source on [GitHub](https://github.com/hallme/woo-address-book). You can also submit an [issue](https://github.com/hallme/woo-address-book/issues) or pull request for anything new.
== Installation ==
1. Upload the `woo-address-book` folder to the `/wp-content/plugins/` directory
2. Make sure you have WooCommerce installed and enabled.
3. Activate the WooCommerce Address Book through the 'Plugins' menu in WordPress.
4. Address Book options will now appear on the customer's account page and checkout once they've entered their primary shipping address.
== Frequently Asked Questions ==
= Why can't I add a new address to my address book? =
The address book will only begin to display after the primary shipping address has been created for the customer.
= Will this plugin allow my customers to ship to multiple locations with a single order? =
No, this plugin only allows for the storage of multiple shipping addresses. If a customer would like to ship to multiple locations, they should complete multiple orders.
== Screenshots ==
1. Manage your address book on the account page. Choose your primary shipping address, or add multiple alternative addresses.
2. Easily select your shipping address on checkout.
== Changelog ==
= 1.4.1 =
* Limit get_users to just returning IDs. Significantly decreases the amount of memory needed on activation on a site with many users. ([thanks pjv](https://github.com/hallme/woo-address-book/pull/40))
* PHP and JS formatting cleanup
= 1.4.0 =
* Trim any trailing slashes when getting the address name from the URL
* Do not display the address book dropdown on checkout if a default shipping address has not been set.
* Various bug fixes.
= 1.3.6 =
* Added `wc_address_book_addresses` filter to allow for modification of Address Book addresses.
* JS improvments of address book dropdown on Checkout. Thanks to ebelrose for their contributions!
= 1.3.5 =
* Added languages folder with .pot file for i18n.
* Added `isset()` conditions for `address_select_label()` in case fields have been removed.
= 1.3.4 =
* Updated the filter wc_address_book_address_select_label to add $address and $name, which should open a lot of options for modifying the output.
* Cleaned up the codebase to align with [WordPress-Coding-Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards).
= 1.3.3 =
* Added text domain and updated AJAX's scope on my-account. Thanks to pabl0rg and nicolasmn for their contributions!
= 1.3.2 =
* Fixed a bug to properly reset the state value when selecting 'new address'.
= 1.3.1 =
* Fixed a bug which prevents shipping country field from clearing if only one country is a checkout option.
= 1.3.0 =
* Add multisite support.
= 1.2.1 =
* Fixed a bug which prevented address from saving.
= 1.2 =
* Clear checkout fields when adding a new address.
= 1.1 =
* Changed Address Book to using $_GET vars to allow for custom fields to be saved.
= 1.0 =
* Initial Release.
<?php
/**
* Woo Address Book
*
* @author Hall Internet Marketing
* @package WooCommerce Address Book/Templates
* @version 1.4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$wc_address_book = new WC_Address_Book();
$customer_id = get_current_user_id();
$address_book = $wc_address_book->get_address_book( $customer_id );
// Do not display on address edit pages.
if ( ! $type ) : ?>
<?php
$shipping_address = get_user_meta( $customer_id, 'shipping_address_1', true );
// Only display if primary addresses are set and not on an edit page.
if ( ! empty( $shipping_address ) ) :
?>
<hr />
<div class="address_book">
<h2><?php __( 'Shipping Address Book', 'wc-address-book' ); ?></h2>
<p class="myaccount_address">
<?php echo apply_filters( 'woocommerce_my_account_my_address_book_description', __( 'The following addresses are available during the checkout process.', 'wc-address-book' ) ); ?>
</p>
<?php
if ( ! wc_ship_to_billing_address_only() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) {
echo '<div class="col2-set addresses address-book">';
}
foreach ( $address_book as $name => $fields ) :
// Prevent default shipping from displaying here.
if ( 'shipping' === $name || 'billing' === $name ) {
continue;
}
$address = apply_filters(
'woocommerce_my_account_my_address_formatted_address',
array(
'first_name' => get_user_meta( $customer_id, $name . '_first_name', true ),
'last_name' => get_user_meta( $customer_id, $name . '_last_name', true ),
'company' => get_user_meta( $customer_id, $name . '_company', true ),
'address_1' => get_user_meta( $customer_id, $name . '_address_1', true ),
'address_2' => get_user_meta( $customer_id, $name . '_address_2', true ),
'city' => get_user_meta( $customer_id, $name . '_city', true ),
'state' => get_user_meta( $customer_id, $name . '_state', true ),
'postcode' => get_user_meta( $customer_id, $name . '_postcode', true ),
'country' => get_user_meta( $customer_id, $name . '_country', true ),
),
$customer_id,
$name
);
$formatted_address = WC()->countries->get_formatted_address( $address );
if ( $formatted_address ) :
?>
<div class="wc-address-book-address">
<div class="wc-address-book-meta">
<a href="<?php echo esc_url( wc_get_endpoint_url( 'edit-address', 'shipping/?address-book=' . $name ) ); ?>" class="wc-address-book-edit"><?php echo esc_attr__( 'Edit', 'wc-address-book' ); ?></a>
<a id="<?php echo esc_attr( $name ); ?>" class="wc-address-book-delete"><?php echo esc_attr__( 'Delete', 'wc-address-book' ); ?></a>
<a id="<?php echo esc_attr( $name ); ?>" class="wc-address-book-make-primary"><?php echo esc_attr__( 'Make Primary', 'wc-address-book' ); ?></a>
</div>
<address>
<?php echo wp_kses( $formatted_address, array( 'br' => array() ) ); ?>
</address>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php
// Add link/button to the my accounts page for adding addresses.
if ( ! empty( get_user_meta( $customer_id, 'shipping_address_1' ) ) ) {
$wc_address_book->add_additional_address_button();
}
?>
<?php endif; ?>
<?php
function wooccm_checkout_billing_fields( $fields = array() ) {
$options = get_option( 'wccs_settings3' );
$buttons = ( isset( $options['billing_buttons'] ) ? $options['billing_buttons'] : false );
// Check if we have any fields to process
if( empty( $buttons ) )
return $fields;
$billing = array(
'address_1',
'address_2',
'city',
'postcode',
'state',
'country'
);
foreach( $buttons as $btn ) {
if( !empty( $btn['cow'] ) && empty( $btn['deny_checkout'] ) ) {
$key = sprintf( 'billing_%s', $btn['cow'] );
if( $btn['cow'] == 'country' ) {
// Country override
$fields[$key]['type'] = 'wooccmcountry';
} elseif( $btn['cow'] == 'state' ) {
// State override
$fields[$key]['type'] = 'wooccmstate';
} else {
$fields[$key]['type'] = $btn['type'];
}
if( $btn['cow'] !== 'country' || $btn['cow'] !== 'state' )
$fields[$key]['placeholder'] = ( isset( $btn['placeholder'] ) ? $btn['placeholder'] : '' );
// Default to Position wide
$btn['position'] = ( isset( $btn['position'] ) ? $btn['position'] : 'form-row-wide' );
$fields[$key]['class'] = array( $btn['position'] . ' ' . ( isset( $btn['conditional_tie'] ) ? $btn['conditional_tie'] : '' ) .' '. ( isset( $btn['extra_class'] ) ? $btn['extra_class'] : '' ) );
$fields[$key]['label'] = wooccm_wpml_string( $btn['label'] );
$fields[$key]['clear'] = ( isset( $btn['clear_row'] ) ? $btn['clear_row'] : '' );
$fields[$key]['default'] = ( isset( $btn['force_title2'] ) ? $btn['force_title2'] : '' );
$fields[$key]['options'] = ( isset( $btn['option_array'] ) ? $btn['option_array'] : '' );
$fields[$key]['user_role'] = ( isset( $btn['user_role'] ) ? $btn['user_role'] : '' );
$fields[$key]['role_options'] = ( isset( $btn['role_options'] ) ? $btn['role_options'] : '' );
$fields[$key]['role_options2'] = ( isset( $btn['role_options2'] ) ? $btn['role_options2'] : '' );
$fields[$key]['required'] = ( isset( $btn['checkbox'] ) ? $btn['checkbox'] : '' );
$fields[$key]['wooccm_required'] = ( isset( $btn['checkbox'] ) ? $btn['checkbox'] : '' );
$fields[$key]['cow'] = ( isset( $btn['cow'] ) ? $btn['cow'] : '' );
$fields[$key]['color'] = ( isset( $btn['colorpickerd'] ) ? $btn['colorpickerd'] : '' );
$fields[$key]['colorpickertype'] = ( isset( $btn['colorpickertype'] ) ? $btn['colorpickertype'] : '' );
$fields[$key]['order'] = ( isset( $btn['order'] ) ? $btn['order'] : '' );
$fields[$key]['priority'] = ( isset( $btn['priority'] ) ? $btn['priority'] : $fields[$key]['order'] );
$fields[$key]['fancy'] = ( isset( $btn['fancy'] ) ? $btn['fancy'] : '' );
// Check if Multi-checkbox has options assigned to it
if( $btn['type'] == 'multicheckbox' && empty( $btn['option_array'] ) )
$btn['disabled'] = true;
// Bolt on address-field for address-based fields
if( in_array( $btn['cow'], $billing ) )
$fields[$key]['class'][] = 'address-field';
// Override for State fields
if( $fields[$key]['type'] == 'wooccmstate' ) {
$country_key = false;
if( $key == 'billing_state' )
$country_key = 'billing_country';
if( $key == 'shipping_state' )
$country_key = 'shipping_country';
if( !empty( $country_key ) ) {
$current_cc = WC()->checkout->get_value( $country_key );
$states = WC()->countries->get_states( $current_cc );
if( empty( $states ) ) {
$fields[$key]['required'] = false;
$fields[$key]['wooccm_required'] = false;
}
}
}
// Remove disabled fields
if( !empty( $btn['disabled'] ) )
unset( $fields[$key] );
}
}
// Resort the fields by order
$fields[] = uasort( $fields, 'wooccm_sort_fields' );
if( $fields[0] )
unset( $fields[0] );
return $fields;
}
?>
\ No newline at end of file
<?php
function wooccm_checkout_shipping_fields( $fields = array() ) {
$options = get_option( 'wccs_settings2' );
$buttons = ( isset( $options['shipping_buttons'] ) ? $options['shipping_buttons'] : false );
// Check if we have any fields to process
if( empty( $buttons ) )
return $fields;
$shipping = array(
'address_1',
'address_2',
'city',
'postcode',
'state',
'country'
);
foreach( $buttons as $btn ) {
if( !empty( $btn['cow'] ) && empty( $btn['deny_checkout'] ) ) {
$key = sprintf( 'shipping_%s', $btn['cow'] );
if( $btn['cow'] == 'country' ) {
// Country override
$fields[$key]['type'] = 'wooccmcountry';
} elseif( $btn['cow'] == 'state' ) {
// State override
$fields[$key]['type'] = 'wooccmstate';
} else {
$fields[$key]['type'] = $btn['type'];
}
if( $btn['cow'] !== 'country' || $btn['cow'] !== 'state' )
$fields[$key]['placeholder'] = ( isset( $btn['placeholder'] ) ? $btn['placeholder'] : '' );
// Default to Position wide
$btn['position'] = ( isset( $btn['position'] ) ? $btn['position'] : 'form-row-wide' );
$fields[$key]['class'] = array( $btn['position'] . ' ' . ( isset( $btn['conditional_tie'] ) ? $btn['conditional_tie'] : '' ) .' '. ( isset( $btn['extra_class'] ) ? $btn['extra_class'] : '' ) );
$fields[$key]['label'] = wooccm_wpml_string( $btn['label'] );
$fields[$key]['clear'] = ( isset( $btn['clear_row'] ) ? $btn['clear_row'] : '' );
$fields[$key]['default'] = ( isset( $btn['force_title2'] ) ? $btn['force_title2'] : '' );
$fields[$key]['options'] = ( isset( $btn['option_array'] ) ? $btn['option_array'] : '' );
$fields[$key]['user_role'] = ( isset( $btn['user_role'] ) ? $btn['user_role'] : '' );
$fields[$key]['role_options'] = ( isset( $btn['role_options'] ) ? $btn['role_options'] : '' );
$fields[$key]['role_options2'] = ( isset( $btn['role_options2'] ) ? $btn['role_options2'] : '' );
$fields[$key]['required'] = ( isset( $btn['checkbox'] ) ? $btn['checkbox'] : '' );
$fields[$key]['wooccm_required'] = ( isset( $btn['checkbox'] ) ? $btn['checkbox'] : '' );
$fields[$key]['cow'] = ( isset( $btn['cow'] ) ? $btn['cow'] : '' );
$fields[$key]['color'] = ( isset( $btn['colorpickerd'] ) ? $btn['colorpickerd'] : '' );
$fields[$key]['colorpickertype'] = ( isset( $btn['colorpickertype'] ) ? $btn['colorpickertype'] : '' );
$fields[$key]['order'] = ( isset( $btn['order'] ) ? $btn['order'] : '' );
$fields[$key]['priority'] = ( isset( $btn['priority'] ) ? $btn['priority'] : $fields[$key]['order'] );
$fields[$key]['fancy'] = ( isset( $btn['fancy'] ) ? $btn['fancy'] : '' );
// Check if Multi-checkbox has options assigned to it
if( $btn['type'] == 'multicheckbox' && empty( $btn['option_array'] ) )
$btn['disabled'] = true;
// Bolt on address-field for address-based fields
if( in_array( $btn['cow'], $shipping ) )
$fields[$key]['class'][] = 'address-field';
// Remove disabled fields
if( !empty( $btn['disabled'] ) )
unset( $fields[$key] );
}
}
// Resort the fields by order
$fields[] = uasort( $fields, 'wooccm_sort_fields' );
if( $fields[0] )
unset( $fields[0] );
return $fields;
}
?>
\ No newline at end of file
<?php
/**
* WooCommerce Checkout Manager
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
// =======================================================
// IMPORT FUNCTION
// =======================================================
$options = get_option( 'wccs_settings' );
$options2 = get_option( 'wccs_settings2' );
$options3 = get_option( 'wccs_settings3' );
if( isset($_FILES['import']) && check_admin_referer('ie-import') ) {
if( $_FILES['import']['error'] > 0 ) {
// @mod - Add in error reporting
// Do something
} else {
$encode_options = $_FILES['import']['tmp_name'];
if( ( $handle = fopen( $encode_options , "r" ) ) !== FALSE ) {
$rows = 0;
$header = fgetcsv($handle, 10000, ",");
while( ( $data = fgetcsv($handle, 10000, ",")) !== FALSE ) {
$c = 0;
foreach( $header as $value ) {
$options['buttons'][$rows][$value] = $data[$c];
$c++;
}
$rows++;
update_option( 'wccs_settings', $options );
}
fclose($handle);
}
}
}
// BILLING IMPORT ===========================================================
// ==========================================================================
if( isset( $_FILES['billing-import'] ) && check_admin_referer( 'ie-import' ) ) {
if( $_FILES['billing-import']['error'] > 0 ) {
// @mod - Add in error reporting
// Do something
} else {
$encode_options = $_FILES['billing-import']['tmp_name'];
if( ( $handle = fopen( $encode_options , "r") ) !== FALSE ) {
$rows = 0;
$header = fgetcsv($handle, 10000, ",");
while( ( $data = fgetcsv($handle, 10000, ",")) !== FALSE ) {
$c = 0;
foreach( $header as $value ) {
$options3['billing_buttons'][$rows][$value] = $data[$c];
$c++;
}
$rows++;
update_option( 'wccs_settings3', $options3 );
}
fclose($handle);
}
}
}
// SHIPPING IMPORT ================================================================
// ================================================================================
if( isset( $_FILES['shipping-import'] ) && check_admin_referer( 'ie-import' ) ) {
if( $_FILES['shipping-import']['error'] > 0 ) {
// @mod - Add in error reporting
// Do something
} else {
$encode_options = $_FILES['shipping-import']['tmp_name'];
if( ( $handle = fopen( $encode_options , "r" ) ) !== FALSE ) {
$rows = 0;
$header = fgetcsv($handle, 10000, ",");
while( ($data = fgetcsv($handle, 10000, ",")) !== FALSE ) {
$c = 0;
foreach( $header as $value ) {
$options2['shipping_buttons'][$rows][$value] = $data[$c];
$c++;
}
$rows++;
update_option( 'wccs_settings2', $options2 );
}
fclose($handle);
}
}
}
// GENERAL IMPORT =========================================================== ..
// ==========================================================================
if( isset( $_FILES['general-import'] ) && check_admin_referer( 'ie-import' ) ) {
if( $_FILES['general-import']['error'] > 0 ) {
// @mod - Add in error reporting
// Do something
} else {
$encode_options = $_FILES['general-import']['tmp_name'];
if( ( $handle = fopen( $encode_options , "r" ) ) !== FALSE ) {
$rows = 0;
$header = fgetcsv($handle, 10000, ",");
while( ($data = fgetcsv($handle, 10000, ",") ) !== FALSE ) {
$c = 0;
foreach( $header as $value ) {
$options['checkness'][$value] = $data[$c];
$c++;
}
$rows++;
update_option( 'wccs_settings', $options );
}
}
fclose($handle);
}
}
// =======================================================================================================
?>
<form method='post' class='import_form' enctype='multipart/form-data'>
<?php wp_nonce_field('ie-import'); ?>
<input type="button" id="wccs_import_submit" class="button button-hero button-secondary import" value="Import" />
<div id="wp-auth-check-wrap" class="click_showWccm" style="display:none;">
<div id="wp-auth-check-bg"></div>
<div id="wp-auth-check" style="max-height: 700px;">
<div class="wp-auth-check-close" tabindex="0" title="Close"></div>
<div class="updated">
<h3><?php _e( 'Field Data Import', 'woocommerce-checkout-manager' ); ?></h3>
<p>
<?php _e( 'Import General Settings or new Billing, Shipping or Additional fields exported from the WooCheckout > Export screen back into WooCheckout.' ); ?><br /><br />
<span class="make_smalla">Max Upload Size: <?php echo size_format( wp_max_upload_size() ); ?> <br /></span>
</p>
</div>
<div class="updated jellow">
<p>
<span class="heading_smalla"><?php _e( 'General Settings', 'woocommerce-checkout-manager'); ?><br></span>
<input type="file" name="general-import" class="wccm_importer" />
<input type="submit" class="button button-primary wccm_importer_submit" name="submit" value="<?php _e('Import CSV', 'woocommerce-checkout-manager'); ?>" />
</p>
<hr />
<p>
<span class="heading_smalla"><?php _e( 'Billing fields', 'woocommerce-checkout-manager'); ?></span>
<input type="file" name="billing-import" class="wccm_importer" />
<input type="submit" class="button button-primary wccm_importer_submit" name="submit" value="<?php _e('Import CSV', 'woocommerce-checkout-manager'); ?>" />
</p>
<hr />
<p>
<span class="heading_smalla"><?php _e( 'Shipping fields', 'woocommerce-checkout-manager'); ?></span>
<input type="file" name="shipping-import" class="wccm_importer" />
<input type="submit" class="button button-primary wccm_importer_submit" name="submit" value="<?php _e('Import CSV', 'woocommerce-checkout-manager'); ?>" />
</p>
<hr />
<p>
<span class="heading_smalla"><?php _e( 'Additional fields', 'woocommerce-checkout-manager'); ?></span>
<input type="file" name="import" class="wccm_importer" />
<input type="submit" class="button button-primary wccm_importer_submit" name="submit" value="<?php _e('Import CSV', 'woocommerce-checkout-manager'); ?>" />
</p>
</div>
<!-- .updated -->
</div>
<!-- #wp-auth-check -->
</div>
<!-- #wp-auth-check-wrap -->
</form>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#wccs_import_submit').click(function() {
jQuery('#wp-auth-check-wrap').slideToggle('slow');
});
});
</script>
\ No newline at end of file
<?php
function wooccm_mul_array( $val, $array ) {
if( !empty( $array ) ) {
if( is_array( $array ) ) {
foreach( $array as $item ) {
if( isset( $item['cow'] ) && $item['cow'] == $val ) {
return true;
}
}
}
}
}
function wooccm_mul_array2( $val ) {
global $wpdb;
foreach( $wpdb->last_result as $item => $tru ) {
if( isset($tru->meta_key) && $tru->meta_key == $val ) {
return true;
}
}
return false;
}
function wooccm_get_value_by_key( $array, $key ) {
if( !empty( $array ) ) {
foreach( $array as $k => $each ){
if( $k == $key ) {
return $each;
}
if( is_array( $each ) ) {
if( $return = wooccm_get_value_by_key( $each,$key ) ) {
return $return;
}
}
}
}
}
function wooccm_does_existw( $array ) {
if( empty( $array ) )
return;
if( !is_array( $array ) )
return;
foreach( $array as $sub ) {
if( wooccm_mul_array2( wooccm_get_value_by_key( $sub, 'cow' ) ) ) {
return true;
}
}
}
function wooccm_clean( $string ) {
$trim_length = 200; //desired length of text to display
$string = str_replace('-', '', $string); // Replaces all spaces with hyphens.
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
// $string = preg_replace('/\s+/', '', strip_tags($string)); // removes html and spaces
// $string = preg_replace('/\d/', '', $string); // Replaces multiple hyphens with single one.
return rtrim( substr( $string, 0, $trim_length ) );
}
function wooccm_wpml_string( $input = '' ) {
if( function_exists( 'icl_t' ) ) {
return icl_t('WooCommerce Checkout Manager', $input, $input );
} else {
return $input;
}
}
// Sort Checkout fields based on order
function wooccm_sort_fields( $a, $b ) {
if( !isset( $a['order'] ) || !isset( $b['order'] ) )
return 0;
if( $a['order'] == $b['order'] )
return 0;
return ( $a['order'] < $b['order'] ) ? -1 : 1;
}
?>
\ No newline at end of file
<?php
// We use wooccm_error_log() for reporting to the WooCommerce Logs system
function wooccm_error_log( $message = '' ) {
if( $message == '' )
return;
if( class_exists( 'WC_Logger' ) ) {
$logger = new WC_Logger();
$logger->add( 'wooccm', $message );
return true;
} else {
// Fallback where the WooCommerce logging engine is unavailable
error_log( sprintf( '[checkout-manager] %s', $message ) );
}
}
function wooccm_get_woo_version() {
$version = false;
if( defined( 'WC_VERSION' ) ) {
$version = WC_VERSION;
// Backwards compatibility
} else if( defined( 'WOOCOMMERCE_VERSION' ) ) {
$version = WOOCOMMERCE_VERSION;
}
return $version;
}
?>
\ No newline at end of file
<?php
// Plugin activation script
function wooccm_install() {
$options = get_option( 'wccs_settings' );
$options2 = get_option( 'wccs_settings2' );
$options3 = get_option( 'wccs_settings3' );
update_option( WOOCCM_PREFIX . '_update_notice', 0 );
if( function_exists( 'icl_register_string' ) )
icl_register_string( 'WooCommerce Checkout Manager', 'is a required field.', 'is a required field.' );
if( empty( $options['checkness']['position'] ) ) {
$options['checkness']['position'] = 'after_order_notes';
}
if( empty( $options['checkness']['wooccm_notification_email'] ) ) {
$options['checkness']['wooccm_notification_email'] = get_option( 'admin_email' );
}
if( empty( $options['checkness']['payment_method_d'] ) ) {
$options['checkness']['payment_method_d'] = 'Payment Method';
}
if( empty( $options['checkness']['time_stamp_title'] ) ) {
$options['checkness']['time_stamp_title'] = 'Order Time';
}
if( empty( $options['checkness']['payment_method_t'] ) ) {
$options['checkness']['payment_method_t'] = '1';
}
if( empty( $options['checkness']['shipping_method_d'] ) ) {
$options['checkness']['shipping_method_d'] = 'Shipping Method';
}
if( empty( $options['checkness']['shipping_method_t'] ) ) {
$options['checkness']['shipping_method_t'] = '1';
}
if( empty( $options2['shipping_buttons'] ) ) {
$shipping = array(
'country' => 'Country',
'first_name' => 'First Name',
'last_name' => 'Last Name',
'company' => 'Company Name',
'address_1' => 'Address',
'address_2' => '',
'city' => 'Town/ City',
'state' => 'State',
'postcode' => 'Zip'
);
$ship = 0;
foreach( $shipping as $name => $value ) {
$options2['shipping_buttons'][$ship]['label'] = ( !empty( $value ) ? __( $value, 'woocommerce-checkout-manager' ) : false );
$options2['shipping_buttons'][$ship]['cow'] = $name;
$options2['shipping_buttons'][$ship]['checkbox'] = 'true';
$options2['shipping_buttons'][$ship]['order'] = $ship + 1;
$options2['shipping_buttons'][$ship]['type'] = 'wooccmtext';
if ( $name == 'country') {
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
}
if ( $name == 'first_name') {
$options2['shipping_buttons'][$ship]['position'] = 'form-row-first';
}
if ( $name == 'last_name') {
$options2['shipping_buttons'][$ship]['position'] = 'form-row-last';
$options2['shipping_buttons'][$ship]['clear_row'] = true;
}
if ( $name == 'company') {
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
}
if ( $name == 'address_1') {
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
$options2['shipping_buttons'][$ship]['placeholder'] = __( 'Street address', 'woocommerce-checkout-manager' );
}
if ( $name == 'address_2') {
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
$options2['shipping_buttons'][$ship]['placeholder'] = __( 'Apartment, suite, unit etc. (optional)', 'woocommerce-checkout-manager' );
}
if ( $name == 'city') {
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
$options2['shipping_buttons'][$ship]['placeholder'] = __( 'Town / City', 'woocommerce-checkout-manager' );
}
if ( $name == 'state') {
$options2['shipping_buttons'][$ship]['position'] = 'form-row-first';
}
if ( $name == 'postcode') {
$options2['shipping_buttons'][$ship]['position'] = 'form-row-last';
$options2['shipping_buttons'][$ship]['placeholder'] = __( 'Postcode / Zip', 'woocommerce-checkout-manager' );
$options2['shipping_buttons'][$ship]['clear_row'] = true;
}
$ship++;
}
}
if( empty( $options3['billing_buttons'] ) ) {
$billing = array(
'country' => 'Country',
'first_name' => 'First Name',
'last_name' => 'Last Name',
'company' => 'Company Name',
'address_1' => 'Address',
'address_2' => '',
'city' => 'Town/ City',
'state' => 'State',
'postcode' => 'Zip',
'email' => 'Email Address',
'phone' => 'Phone'
);
$bill = 0;
foreach( $billing as $name => $value ) {
$options3['billing_buttons'][$bill]['label'] = ( !empty( $value ) ? __( $value, 'woocommerce-checkout-manager' ) : false );
$options3['billing_buttons'][$bill]['cow'] = $name;
$options3['billing_buttons'][$bill]['checkbox'] = 'true';
$options3['billing_buttons'][$bill]['order'] = $bill + 1;
$options3['billing_buttons'][$bill]['type'] = 'wooccmtext';
if ( $name == 'country') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
}
if ( $name == 'first_name') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-first';
}
if ( $name == 'last_name') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-last';
$options3['billing_buttons'][$bill]['clear_row'] = true;
}
if ( $name == 'company') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
}
if ( $name == 'address_1') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
$options3['billing_buttons'][$bill]['placeholder'] = __( 'Street address', 'woocommerce-checkout-manager' );
}
if ( $name == 'address_2') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
$options3['billing_buttons'][$bill]['placeholder'] = __( 'Apartment, suite, unit etc. (optional)', 'woocommerce-checkout-manager' );
}
if ( $name == 'city') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
$options3['billing_buttons'][$bill]['placeholder'] = __( 'Town / City', 'woocommerce-checkout-manager' );
}
if ( $name == 'state') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-first';
}
if ( $name == 'postcode') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-last';
$options3['billing_buttons'][$bill]['placeholder'] = __( 'Postcode / Zip', 'woocommerce-checkout-manager' );
$options3['billing_buttons'][$bill]['clear_row'] = true;
}
if ( $name == 'email') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-first';
}
if ( $name == 'phone') {
$options3['billing_buttons'][$bill]['position'] = 'form-row-last';
$options3['billing_buttons'][$bill]['clear_row'] = true;
}
$bill++;
}
}
if ( !empty($options['buttons']) ) {
foreach( $options['buttons'] as $i => $btn ) {
if( !empty($btn['check_1']) || !empty($btn['check_2']) ) {
$options['buttons'][$i]['option_array'] = implode( '||', array( wooccm_wpml_string( $btn['check_1'] ), wooccm_wpml_string( $btn['check_2'] ) ) );
$options['buttons'][$i]['check_1'] = '';
$options['buttons'][$i]['check_2'] = '';
}
$options['buttons'][$i]['type'] = ( $btn['type'] == 'checkbox' ) ? 'checkbox_wccm' : $btn['type'];
$options['buttons'][$i]['type'] = ( $btn['type'] == 'text' ) ? 'wooccmtext' : $btn['type'];
$options['buttons'][$i]['type'] = ( $btn['type'] == 'select' ) ? 'wooccmselect' : $btn['type'];
$options['buttons'][$i]['type'] = ( $btn['type'] == 'date' ) ? 'datepicker' : $btn['type'];
if (empty($btn['option_array'])) {
$btn['option_array'] = '';
}
$mysecureop = explode( '||', $btn['option_array']);
if ( !empty($btn['option_a']) ) {
array_push($mysecureop, $btn['option_a'] );
}
if ( !empty($btn['option_b']) ) {
array_push($mysecureop, $btn['option_b'] );
}
$uniqueThevalues = array_unique($mysecureop);
$options['buttons'][$i]['option_array'] = implode( '||', $uniqueThevalues);
}
}
foreach( $options3['billing_buttons'] as $i => $btn ) {
if( !empty($btn['check_1']) || !empty($btn['check_2']) ) {
$options3['billing_buttons'][$i]['option_array'] = implode( '||', array( wooccm_wpml_string( $btn['check_1'] ), wooccm_wpml_string( $btn['check_2'] ) ) );
$options3['billing_buttons'][$i]['check_1'] = '';
$options3['billing_buttons'][$i]['check_2'] = '';
}
$options3['billing_buttons'][$i]['type'] = ( $btn['type'] == 'checkbox' ) ? 'checkbox_wccm' : $btn['type'];
$options3['billing_buttons'][$i]['type'] = ( $btn['type'] == 'text' ) ? 'wooccmtext' : $btn['type'];
$options3['billing_buttons'][$i]['type'] = ( $btn['type'] == 'select' ) ? 'wooccmselect' : $btn['type'];
$options3['billing_buttons'][$i]['type'] = ( $btn['type'] == 'date' ) ? 'datepicker' : $btn['type'];
}
foreach( $options2['shipping_buttons'] as $i => $btn ) {
if( !empty($btn['check_1']) || !empty($btn['check_2']) ) {
$options2['shipping_buttons'][$i]['option_array'] = implode( '||', array( wooccm_wpml_string( $btn['check_1'] ), wooccm_wpml_string( $btn['check_2'] ) ) );
$options2['shipping_buttons'][$i]['check_1'] = '';
$options2['shipping_buttons'][$i]['check_2'] = '';
}
$options2['shipping_buttons'][$i]['type'] = ( $btn['type'] == 'checkbox' ) ? 'checkbox_wccm' : $btn['type'];
$options2['shipping_buttons'][$i]['type'] = ( $btn['type'] == 'text' ) ? 'wooccmtext' : $btn['type'];
$options2['shipping_buttons'][$i]['type'] = ( $btn['type'] == 'select' ) ? 'wooccmselect' : $btn['type'];
$options2['shipping_buttons'][$i]['type'] = ( $btn['type'] == 'date' ) ? 'datepicker' : $btn['type'];
}
update_option( 'wccs_settings', $options );
update_option( 'wccs_settings2', $options2 );
update_option( 'wccs_settings3', $options3 );
}
?>
\ No newline at end of file
--name "CamanJS"
--readme README.md
--title "CamanJS Documentation"
--output-dir ./api
./src
\ No newline at end of file
language: node_js
env: TRAVISCI=true
node_js:
- "0.10"
- "0.8"
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
\ No newline at end of file
fs = require 'fs'
{exec} = require 'child_process'
util = require 'util'
{jsmin} = require 'jsmin'
try
packer = require 'packer'
catch err
packer = null
targetName = "caman"
###
CoffeeScript Options
###
csSrcDir = "src"
csTargetDir = "dist"
targetCoffee = "#{csTargetDir}/caman"
targetCoreJS = "#{csTargetDir}/#{targetName}.js"
targetCoreMinJS = "#{csTargetDir}/#{targetName}.min.js"
targetCorePackJS = "#{csTargetDir}/#{targetName}.pack.js"
coffeeCoreOpts = "-j #{targetName}.js -o #{csTargetDir}"
targetFullJS = "#{csTargetDir}/#{targetName}.full.js"
targetFullMinJS = "#{csTargetDir}/#{targetName}.full.min.js"
targetFullPackJS = "#{csTargetDir}/#{targetName}.full.pack.js"
coffeeFullOpts = "-j #{targetName}.full.js -o #{csTargetDir}"
# All source files listed in include order
coffeeFiles = [
"core/module"
"core/util"
# Core library
"core/caman"
# Everything else
"core/analyze"
"core/autoload"
"core/blender"
"core/calculate"
"core/convert"
"core/event"
"core/filter"
"core/io"
"core/layer"
"core/logger"
"core/pixel"
"core/plugin"
"core/renderer"
"core/store"
# Non-core files
"lib/blenders"
"lib/filters"
"lib/size"
]
pluginsFolder = "src/plugins/src"
###
Event System
###
finishedCallback = {}
finished = (type) ->
finishedCallback[type]() if finishedCallback[type]?
finishListener = (type, cb) ->
finishedCallback[type] = cb
getPlugins = ->
content = ""
util.log "Gathering plugin files in #{pluginsFolder}"
pluginFiles = fs.readdirSync pluginsFolder
util.log "Discovered #{pluginFiles.length} plugins"
for plugin in pluginFiles
continue if fs.statSync("#{pluginsFolder}/#{plugin}").isDirectory()
content += fs.readFileSync("#{pluginsFolder}/#{plugin}", "utf8") + "\n\n"
return content
###
Tasks
###
task 'docs', 'Generates documentation for the coffee files', ->
util.log 'Invoking docco on the source files'
files = []
files[i] = "src/#{coffeeFiles[i]}.coffee" for i in [0...coffeeFiles.length]
pluginFiles = fs.readdirSync pluginsFolder
for plugin in pluginFiles
continue if fs.statSync("#{pluginsFolder}/#{plugin}").isDirectory()
files.push "#{pluginsFolder}/#{plugin}"
exec "node_modules/docco/bin/docco -l parallel #{files.join(' ')}", (err, stdout, stderr) ->
util.log err if err
util.log "Documentation built into the docs/ folder."
util.log 'Invoking codo on the source files'
exec "node_modules/codo/bin/codo", (err, stdout, stderr) ->
util.log err if err
util.log "API reference built into the api/ folder."
console.log stdout
option '-d', '--docs', 'Automatically recompile documentation (used with watch)'
task 'watch', 'Automatically recompile the CoffeeScript files when updated', (options) ->
util.log "Watching for changes in #{csSrcDir}"
util.log "Automatically recompiling documentation!" if options.docs
for jsFile in coffeeFiles then do (jsFile) ->
fs.watchFile "#{csSrcDir}/#{jsFile}.coffee", (curr, prev) ->
if +curr.mtime isnt +prev.mtime
util.log "#{csSrcDir}/#{jsFile}.coffee updated"
invoke 'build'
invoke 'docs' if options.docs
task 'build', 'Compile and minify all CoffeeScript source files', ->
finishListener 'js', -> invoke 'minify'
invoke 'compile'
option '-m', '--map', 'Compile with source maps'
task 'compile', 'Compile all CoffeeScript source files', (options) ->
util.log "Building #{targetCoreJS} and #{targetFullJS}"
contents = []
remaining = coffeeFiles.length
util.log "Appending #{coffeeFiles.length} files to #{targetCoffee}.coffee"
for file, index in coffeeFiles then do (file, index) ->
fs.readFile "#{csSrcDir}/#{file}.coffee", "utf8", (err, fileContents) ->
util.log err if err
contents[index] = fileContents
util.log "[#{index + 1}] #{file}.coffee"
process() if --remaining is 0
process = ->
core = contents.join("\n\n")
full = core + "\n\n" + getPlugins()
if options.map
util.log "Source map support enabled"
coreOpts = "#{coffeeCoreOpts} -m #{targetCoffee}.coffee"
fullOpts = "#{coffeeFullOpts} -m #{targetCoffee}.full.coffee"
else
coreOpts = "#{coffeeCoreOpts} -c #{targetCoffee}.coffee"
fullOpts = "#{coffeeFullOpts} -c #{targetCoffee}.full.coffee"
fs.writeFile "#{targetCoffee}.coffee", core, "utf8", (err) ->
util.log err if err
exec "coffee #{coreOpts}", (err, stdout, stderr) ->
util.log err if err
util.log "Compiled #{targetCoreJS}"
if options.map
map = JSON.parse fs.readFileSync("#{targetCoffee}.map")
map.sources = ["caman.coffee"]
fs.writeFileSync "#{targetCoffee}.map", JSON.stringify(map)
fs.writeFile "#{targetCoffee}.full.coffee", full, "utf8", (err) ->
util.log err if err
exec "coffee #{fullOpts}", (err, stdout, stderr) ->
util.log err if err
util.log "Compiled #{targetFullJS}"
if options.map
map = JSON.parse fs.readFileSync("#{targetCoffee}.full.map")
map.sources = ["caman.full.coffee"]
fs.writeFileSync "#{targetCoffee}.full.map", JSON.stringify(map)
# if not err
# fs.unlink "#{targetCoffee}.full.coffee", (err) -> util.log err if err
finished('js')
task 'minify', 'Minify the CoffeeScript files', ->
util.log "Minifying #{targetCoreJS}"
fs.readFile targetCoreJS, "utf8", (err, contents) ->
fs.writeFile targetCoreMinJS, jsmin(contents), "utf8", (err) ->
util.log err if err
if packer
util.log "Packing #{targetCoreJS}"
fs.writeFile targetCorePackJS, packer.pack(contents, true), "utf8", (err) ->
util.log err if err
util.log "Minifying #{targetFullJS}"
fs.readFile targetFullJS, "utf8", (err, contents) ->
fs.writeFile targetFullMinJS, jsmin(contents), "utf8", (err) ->
util.log err if err
if packer
util.log "Packing #{targetFullJS}"
fs.writeFile targetFullPackJS, packer.pack(contents, true), "utf8", (err) ->
util.log err if err
\ No newline at end of file
Copyright (c) 2010-2014, Ryan LeFevre
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Ryan LeFevre nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# About the Project
[![Build Status](https://secure.travis-ci.org/meltingice/CamanJS.png)](http://travis-ci.org/meltingice/CamanJS)
The main focus of CamanJS is manipulating images using the HTML5 canvas and Javascript. It's a combination of a simple-to-use interface with advanced and efficient image/canvas editing techniques. It is also completely library independent and can be safely used next to jQuery, YUI, Scriptaculous, MooTools, etc.
CamanJS is very easy to extend with new filters and plugins, and it comes with a wide array of image editing functionality, which is only growing as the community makes more plugins. All features that are not a part of the core CamanJS library are in a [separate plugins repository](https://github.com/meltingice/CamanJS-Plugins).
For more information, I highly recommend taking a look at the [official website](http://camanjs.com) where there is more comprehensive documentation and interactive demos. You can also [read the wiki](https://github.com/meltingice/CamanJS/wiki) for some basic information about the project and how to use it.
CamanJS is written in [Coffeescript](http://coffeescript.org) as of version 3.0. **It works both in-browser and in NodeJS.**
CamanJS is a project that I work on in purely my own spare time. If you would like to pitch in a beer or donate to say thanks, my Bitcoin address is: 1EVNQ7FiWDaqpfYXRLCtgMe5RBcz3kEuAG
## Usage
Include one of the versions in the `dist/` folder, then you can run:
```js
Caman("#image-id", function () {
this.brightness(10);
this.contrast(20);
this.render(function () {
alert("Done!");
});
});
```
Caman also supports modifying images via the `data-caman` HTML attribute. Simply separate each instruction with a space. Images with the `data-caman` attribute will automatically be modified at page load.
```html
<img data-caman="saturation(-10) brightness(20) vignette('10%')" src="path/to/image.jpg">
```
### HiDPI Support
Version 4 introduces better support for HiDPI (Retina) displays. It allows you to specify a higher resolution replacement using HTML data attributes. Keep in mind, however, that higher resolution images take longer to render.
**HTML data attributes**
* `data-caman-hidpi`: URL to the high resolution replacement image
* `data-caman-hidpi-disabled`: HiDPI support is enabled by default, so add this attribute if you wish to force disable it
## Upgrading to Version 4
There is only 1 breaking change that occured with the version 4 release. When you initialize CamanJS with a canvas and an image, the parameter order has changed. It is now:
``` javascript
Caman("#canvas-id", "/path/to/image.png", function() {});
```
This is in order to be more consistent with initialization, such that the "initialization object" is always the first parameter. Update your code accordingly.
## Development
If you are a developer who is contributing directly to the project, there are some tools to help you out.
### Building
To install all dependencies required for development, run `npm install -d`.
Because all plugins are in a separate repository, make sure you run:
```
git submodule init && git submodule update
```
To build, simply run `cake build`. The resulting files will be placed in the dist/ folder. Plugins will be automatically discovered and added to caman.full.js after the core library. You can also auto-compile when a file changes by using `cake watch`.
If you add any files to the core library, you will need to add them to the `coffeeFiles` array in the Cakefile. The point of this is so that order is preserved when generating the file JS file. Plugins do not need to be added to the Cakefile.
You will probably want to generate documentation if you make any changes. In addition to the normal requirements, you will also need the Python library Pygments.
To generate the documentation, run `cake docs`.
## CDN JS Hosting
CamanJS is hosted on CDN JS if you're looking for a CDN hosting solution. It is the full and minified version of the library, which means all plugins are included. Simply load CamanJS directly from [this URL](http://cdnjs.cloudflare.com/ajax/libs/camanjs/3.3.0/caman.full.min.js) for usage on your site.
## NodeJS Compatibility
CamanJS is fully compatible with NodeJS. The easiest way to install it is:
```
npm install caman
```
**Saving from NodeJS**
To save your modified image in NodeJS, simply call the save() function **after** rendering is finished by passing a callback function to `render()`. Trying to save before rendering is finished will cause issues.
``` javascript
Caman = require('caman').Caman;
Caman("./path/to/file.jpg", function () {
this.brightness(40);
this.render(function () {
this.save("./output.png");
});
});
```
## Testing
Tests for CamanJS run both in NodeJS and the browser.
### NodeJS
The NodeJS tests use mocha as the test runner. The simplest way to run the test suite is by running `npm test`.
### Browser
The browser tests are run by Karma. It will start up Chrome, Firefox, and Safari (if running OSX) in the background. You can minimize each of these browsers if desired. It will automatically run tests after CamanJS is recompiled by the Cakefile as well.
You can run Karma by running `karma start`, or you can do a single run with the NodeJS tests by running `npm test`.
/*
* jQuery plugin adapter for CamanJS
*/
if (window.jQuery) {
window.jQuery.fn.caman = function (callback) {
return this.each(function () {
Caman(this, callback);
});
};
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='assets/codo.css' type='text/css'>
<script src='assets/codo.js'></script>
<script src='assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path=''></div>
<div id='header'>
<div id='menu'>
<a href='README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='class_index.html' title='Index'>Index</a>
&raquo;
<span class='title'>LICENSE</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='class_list.html'>Classes</a>
<a id='file_list_link' href='file_list.html'>Files</a>
<a id='method_list_link' href='method_list.html'>Methods</a>
<a id='extra_list_link' href='extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<nav class='toc'>
<p class='title'>
<a class='hide_toc' href='#'>
<strong>Table of Contents</strong>
</a>
<small>
(<a class='float_toc' href='#'>left</a>)
</small>
</p>
</nav>
<div id='filecontents'>
Copyright (c) 2010, Ryan LeFevre
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Ryan LeFevre nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='assets/codo.css' type='text/css'>
<script src='assets/codo.js'></script>
<script src='assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path=''></div>
<div id='header'>
<div id='menu'>
<a href='README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='class_index.html' title='Index'>Index</a>
&raquo;
<span class='title'>README.md</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='class_list.html'>Classes</a>
<a id='file_list_link' href='file_list.html'>Files</a>
<a id='method_list_link' href='method_list.html'>Methods</a>
<a id='extra_list_link' href='extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<nav class='toc'>
<p class='title'>
<a class='hide_toc' href='#'>
<strong>Table of Contents</strong>
</a>
<small>
(<a class='float_toc' href='#'>left</a>)
</small>
</p>
</nav>
<div id='filecontents'>
<h1>About the Project</h1><p><a href="http://travis-ci.org/meltingice/CamanJS"><img src="https://secure.travis-ci.org/meltingice/CamanJS.png" alt="Build Status"></a></p><p>The main focus of CamanJS is manipulating images using the HTML5 canvas and Javascript. It&#39;s a combination of a simple-to-use interface with advanced and efficient image/canvas editing techniques. It is also completely library independent and can be safely used next to jQuery, YUI, Scriptaculous, MooTools, etc.</p><p>CamanJS is very easy to extend with new filters and plugins, and it comes with a wide array of image editing functionality, which is only growing as the community makes more plugins. All features that are not a part of the core CamanJS library are in a <a href="https://github.com/meltingice/CamanJS-Plugins">separate plugins repository</a>.</p><p>For more information, I highly recommend taking a look at the <a href="http://camanjs.com">official website</a> where there is more comprehensive documentation and interactive demos. You can also <a href="https://github.com/meltingice/CamanJS/wiki">read the wiki</a> for some basic information about the project and how to use it.</p><p>CamanJS is written in <a href="http://coffeescript.org">Coffeescript</a> as of version 3.0. <strong>It works both in-browser and in NodeJS.</strong></p><h2>Usage</h2><p>Include one of the versions in the <code>dist/</code> folder, then you can run:</p><pre><code class="lang-js">Caman(&quot;#image-id&quot;, function () {
this.brightness(10);
this.contrast(20);
this.render(function () {
alert(&quot;Done!&quot;);
});
});</code></pre><p>Caman also supports modifying images via the <code>data-caman</code> HTML attribute. Simply separate each instruction with a space. Images with the <code>data-caman</code> attribute will automatically be modified at page load.</p><pre><code class="lang-html">&lt;img data-caman=&quot;saturation(-10) brightness(20) vignette(&#39;10%&#39;)&quot; src=&quot;path/to/image.jpg&quot;&gt;</code></pre>
<h3>HiDPI Support</h3><p>Version 4 introduces better support for HiDPI (Retina) displays. It allows you to specify a higher resolution replacement using HTML data attributes. Keep in mind, however, that higher resolution images take longer to render.</p><p><strong>HTML data attributes</strong></p><ul>
<li><code>data-caman-hidpi</code>: URL to the high resolution replacement image</li>
<li><code>data-caman-hidpi-disabled</code>: HiDPI support is enabled by default, so add this attribute if you wish to force disable it</li>
</ul>
<h2>Upgrading to Version 4</h2><p>There is only 1 breaking change that occured with the version 4 release. When you initialize CamanJS with a canvas and an image, the parameter order has changed. It is now:</p><pre><code class="lang-javascript">Caman(&quot;#canvas-id&quot;, &quot;/path/to/image.png&quot;, function() {});</code></pre><p>This is in order to be more consistent with initialization, such that the &quot;initialization object&quot; is always the first parameter. Update your code accordingly.</p><h2>Development</h2><p>If you are a developer who is contributing directly to the project, there are some tools to help you out.</p><h3>Building</h3><p>To install all dependencies required for development, run <code>npm install -d</code>.</p><p>Because all plugins are in a separate repository, make sure you run:</p><pre><code>git submodule init &amp;&amp; git submodule update</code></pre><p>To build, simply run <code>cake build</code>. The resulting files will be placed in the dist/ folder. Plugins will be automatically discovered and added to caman.full.js after the core library. You can also auto-compile when a file changes by using <code>cake watch</code>.</p><p>If you add any files to the core library, you will need to add them to the <code>coffeeFiles</code> array in the Cakefile. The point of this is so that order is preserved when generating the file JS file. Plugins do not need to be added to the Cakefile.</p><p>You will probably want to generate documentation if you make any changes. In addition to the normal requirements, you will also need the Python library Pygments.</p><p>To generate the documentation, run <code>cake docs</code>.</p><h2>CDN JS Hosting</h2><p>CamanJS is hosted on CDN JS if you&#39;re looking for a CDN hosting solution. It is the full and minified version of the library, which means all plugins are included. Simply load CamanJS directly from <a href="http://cdnjs.cloudflare.com/ajax/libs/camanjs/3.3.0/caman.full.min.js">this URL</a> for usage on your site.</p><h2>NodeJS Compatibility</h2><p>CamanJS is fully compatible with NodeJS. The easiest way to install it is:</p><pre><code>npm install caman</code></pre><p><strong>Saving from NodeJS</strong></p><p>To save your modified image in NodeJS, simply call the save() function <strong>after</strong> rendering is finished by passing a callback function to <code>render()</code>. Trying to save before rendering is finished will cause issues.</p><pre><code class="lang-javascript">Caman = require(&#39;caman&#39;).Caman;
Caman(&quot;./path/to/file.jpg&quot;, function () {
this.brightness(40);
this.render(function () {
this.save(&quot;./output.png&quot;);
});
});</code></pre>
<h2>Testing</h2><p>Tests for CamanJS run both in NodeJS and the browser.</p><h3>NodeJS</h3><p>The NodeJS tests use mocha as the test runner. The simplest way to run the test suite is by running <code>npm test</code>.</p><h3>Browser</h3><p>The browser tests are run by Karma. It will start up Chrome, Firefox, and Safari (if running OSX) in the background. You can minimize each of these browsers if desired. It will automatically run tests after CamanJS is recompiled by the Cakefile as well.</p><p>You can run Karma by running <code>karma start</code>, or you can do a single run with the NodeJS tests by running <code>npm test</code>.</p>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='assets/codo.css' type='text/css'>
<script src='assets/codo.js'></script>
<script src='assets/search_data.js'></script>
</head>
<body class='list'>
<div class='list tree' id='content'>
<h1 class='full_list_header'>Class List</h1>
<nav>
<a target='_self' href='class_list.html'>Classes</a>
<a target='_self' href='file_list.html'>Files</a>
<a target='_self' href='method_list.html'>Methods</a>
<a target='_self' href='extra_list.html'>Extras</a>
</nav>
<div id='search'>
Search:
<input type='text'>
</div>
<ul>
<li>
<span>
Caman
</span>
</li>
<ul>
<li>
<a href='classes/Caman/Analyze.html' target='main'>Analyze</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Blender.html' target='main'>Blender</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Calculate.html' target='main'>Calculate</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Convert.html' target='main'>Convert</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Event.html' target='main'>Event</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Filter.html' target='main'>Filter</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/IO.html' target='main'>IO</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Layer.html' target='main'>Layer</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Logger.html' target='main'>Logger</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Pixel.html' target='main'>Pixel</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Plugin.html' target='main'>Plugin</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Renderer.html' target='main'>Renderer</a>
<small class='namespace'>
Caman
</small>
</li>
<li>
<a href='classes/Caman/Store.html' target='main'>Store</a>
<small class='namespace'>
Caman
</small>
</li>
</ul>
<li>
<a href='classes/CamanParser.html' target='main'>CamanParser</a>
<small class='namespace'>
</small>
</li>
<li>
<a href='classes/Caman.html' target='main'>Caman</a>
<small class='parent'>
<
Module
</small>
<small class='namespace'>
</small>
</li>
<li>
<a href='classes/Module.html' target='main'>Module</a>
<small class='namespace'>
</small>
</li>
<li>
<a href='classes/Util.html' target='main'>Util</a>
<small class='namespace'>
</small>
</li>
</ul>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>Analyze</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.Analyze
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;analyze.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Various image analysis methods</p>
</div>
<div class='tags'>
</div>
<h2>Instance Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#constructor-instance'>
- (void) <strong>constructor</strong>(c)
</a>
</span>
<span class='constructor note title'>Constructor</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#calculateLevels-instance'>
- (Object) <strong>calculateLevels</strong>()
</a>
</span>
<span class='desc'>
Calculates the number of occurances of each color value throughout the image.
</span>
</li>
</ul>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-instance'>
- (void) <strong>constructor</strong>(c)
</p>
<div class='tags'>
</div>
</div>
</div>
<h2>Instance Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='calculateLevels-instance'>
- (Object) <strong>calculateLevels</strong>()
</p>
<div class='docstring'>
<p>Calculates the number of occurances of each color value throughout the image.</p>
</div>
<div class='tags'>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(<tt>Object</tt>)
&mdash;
<span class='desc'>Hash of RGB channels and the occurance of each value</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>Blender</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.Blender
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;blender.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Built-in layer blenders. Many of these mimic Photoshop blend modes.</p>
</div>
<div class='tags'>
</div>
<h2>Class Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#register-class'>
+ (void) <strong>register</strong>(name, func)
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#execute-class'>
+ (Object) <strong>execute</strong>(name, rgbaLayer, rgbaParent)
</a>
</span>
<span class='desc'>
</span>
</li>
</ul>
<h2>Class Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='register-class'>
+ (void) <strong>register</strong>(name, func)
</p>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>name</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>Name of the blender.</span>
</li>
<li>
<span class='name'>func</span>
<span class='type'>
(<tt>Function</tt>)
</span>
&mdash;
<span class='desc'>The blender function.</span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='execute-class'>
+ (Object) <strong>execute</strong>(name, rgbaLayer, rgbaParent)
</p>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>name</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>Name of the blending function to invoke.</span>
</li>
<li>
<span class='name'>rgbaLayer</span>
<span class='type'>
(<tt>Object</tt>)
</span>
&mdash;
<span class='desc'>RGBA object of the current pixel from the layer.</span>
</li>
<li>
<span class='name'>rgbaParent</span>
<span class='type'>
(<tt>Object</tt>)
</span>
&mdash;
<span class='desc'>RGBA object of the corresponding pixel in the parent layer.</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(<tt>Object</tt>)
&mdash;
<span class='desc'>RGBA object representing the blended pixel.</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>Event</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.Event
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;event.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Event system that can be used to register callbacks that get fired
during certain times in the render process.</p>
</div>
<div class='tags'>
</div>
<h2>Class Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#trigger-class'>
+ (void) <strong>trigger</strong>(target, type, data = null)
</a>
</span>
<span class='desc'>
Trigger an event.
</span>
</li>
<li>
<span class='signature'>
<a href='#listen-class'>
+ (void) <strong>listen</strong>(target, type, fn)
</a>
</span>
<span class='desc'>
Listen for an event.
</span>
</li>
</ul>
<h2>Class Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='trigger-class'>
+ (void) <strong>trigger</strong>(target, type, data = null)
</p>
<div class='docstring'>
<p>Trigger an event.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>target</span>
<span class='type'>
(<tt><a href='../../classes/Caman.html'>Caman</a></tt>)
</span>
&mdash;
<span class='desc'>Instance of Caman emitting the event.</span>
</li>
<li>
<span class='name'>type</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>The event type.</span>
</li>
<li>
<span class='name'>data</span>
<span class='type'>
(<tt>Object</tt>)
</span>
&mdash;
<span class='desc'>Extra data to send with the event.</span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='listen-class'>
+ (void) <strong>listen</strong>(target, type, fn)
<br>
+ (void) <strong>listen</strong>(type, fn)
<br>
</p>
<div class='docstring'>
<p>Listen for an event. Optionally bind the listen to a single instance
or all instances.</p>
</div>
<div class='tags'>
<div class='overloads'>
<h3>Overloads:</h3>
<div class='overload'>
<p class='signature'>
+ (void) <strong>listen</strong>(target, type, fn)
</p>
<div class='docstring'>
<p>Listen for events emitted from a particular Caman instance.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>target</span>
<span class='type'>
(<tt><a href='../../classes/Caman.html'>Caman</a></tt>)
</span>
&mdash;
<span class='desc'>The instance to listen to.</span>
</li>
<li>
<span class='name'>type</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>The type of event to listen for.</span>
</li>
<li>
<span class='name'>fn</span>
<span class='type'>
(<tt>Function</tt>)
</span>
&mdash;
<span class='desc'>The function to call when the event occurs.</span>
</li>
</ul>
</div>
</div>
<div class='overload'>
<p class='signature'>
+ (void) <strong>listen</strong>(type, fn)
</p>
<div class='docstring'>
<p>Listen for an event from all Caman instances.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>type</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>The type of event to listen for.</span>
</li>
<li>
<span class='name'>fn</span>
<span class='type'>
(<tt>Function</tt>)
</span>
&mdash;
<span class='desc'>The function to call when the event occurs.</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>Filter</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.Filter
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;filter.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Responsible for registering and storing all of the filters.</p>
</div>
<div class='tags'>
</div>
<h2>Class Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#register-class'>
+ (void) <strong>register</strong>(name, filterFunc)
</a>
</span>
<span class='desc'>
Registers a filter function.
</span>
</li>
</ul>
<h2>Class Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='register-class'>
+ (void) <strong>register</strong>(name, filterFunc)
</p>
<div class='docstring'>
<p>Registers a filter function.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>name</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>The name of the filter.</span>
</li>
<li>
<span class='name'>filterFunc</span>
<span class='type'>
(<tt>Function</tt>)
</span>
&mdash;
<span class='desc'>The filter function.</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>IO</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.IO
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;io.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Various I/O based operations</p>
</div>
<div class='tags'>
</div>
<h2>Class Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#isRemote-class'>
+ (Boolean) <strong>isRemote</strong>(img)
</a>
</span>
<span class='desc'>
Is the given URL remote? If a cross-origin setting is set, we assume you have CORS properly configured.
</span>
</li>
<li>
<span class='signature'>
<a href='#corsEnabled-class'>
+ (Boolean) <strong>corsEnabled</strong>(img)
</a>
</span>
<span class='desc'>
Given an image, we check to see if a CORS policy has been defined.
</span>
</li>
<li>
<span class='signature'>
<a href='#isURLRemote-class'>
+ (Boolean) <strong>isURLRemote</strong>(url)
</a>
</span>
<span class='desc'>
Does the given URL exist on a different domain than the current one? This is done by comparing the URL to <code>document.domain</code>.
</span>
</li>
<li>
<span class='signature'>
<a href='#remoteCheck-class'>
+ (String) <strong>remoteCheck</strong>(src)
</a>
</span>
<span class='desc'>
Checks to see if the URL is remote, and if there is a proxy defined, it
</span>
</li>
<li>
<span class='signature'>
<a href='#proxyUrl-class'>
+ (String) <strong>proxyUrl</strong>(src)
</a>
</span>
<span class='desc'>
Given a URL, get the proxy URL for it.
</span>
</li>
<li>
<span class='signature'>
<a href='#useProxy-class'>
+ (String) <strong>useProxy</strong>(lang)
</a>
</span>
<span class='desc'>
Shortcut for using one of the bundled proxies.
</span>
</li>
</ul>
<h2>Class Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='isRemote-class'>
+ (Boolean) <strong>isRemote</strong>(img)
</p>
<div class='docstring'>
<p>Is the given URL remote?
If a cross-origin setting is set, we assume you have CORS
properly configured.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>img</span>
<span class='type'>
(<tt>DOMObject</tt>)
</span>
&mdash;
<span class='desc'>The image to check.</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span><tt>Boolean</tt></li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='corsEnabled-class'>
+ (Boolean) <strong>corsEnabled</strong>(img)
</p>
<div class='docstring'>
<p>Given an image, we check to see if a CORS policy has been defined.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>img</span>
<span class='type'>
(<tt>DOMObject</tt>)
</span>
&mdash;
<span class='desc'>The image to check.</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span><tt>Boolean</tt></li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='isURLRemote-class'>
+ (Boolean) <strong>isURLRemote</strong>(url)
</p>
<div class='docstring'>
<p>Does the given URL exist on a different domain than the current one?
This is done by comparing the URL to <code>document.domain</code>.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>url</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>The URL to check.</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span><tt>Boolean</tt></li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='remoteCheck-class'>
+ (String) <strong>remoteCheck</strong>(src)
</p>
<div class='docstring'>
<p>Checks to see if the URL is remote, and if there is a proxy defined, it</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>src</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>The URL to check.</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(<tt>String</tt>)
&mdash;
<span class='desc'>The proxy URL if the image is remote. Nothing otherwise.</span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='proxyUrl-class'>
+ (String) <strong>proxyUrl</strong>(src)
</p>
<div class='docstring'>
<p>Given a URL, get the proxy URL for it.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>src</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>The URL to proxy.</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(<tt>String</tt>)
&mdash;
<span class='desc'>The proxy URL.</span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='useProxy-class'>
+ (String) <strong>useProxy</strong>(lang)
</p>
<div class='docstring'>
<p>Shortcut for using one of the bundled proxies.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>lang</span>
<span class='type'>
(<tt>String</tt>)
</span>
&mdash;
<span class='desc'>String identifier for the proxy script language.</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(<tt>String</tt>)
&mdash;
<span class='desc'>A proxy URL.</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>Layer</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.Layer
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;layer.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>The entire layering system for Caman resides in this file. Layers get their own canvasLayer
objectwhich is created when newLayer() is called. For extensive information regarding the
specifics of howthe layering system works, there is an in-depth blog post on this very topic.
Instead of copying the entirety of that post, I&#39;ll simply point you towards the
<a href="http://blog.meltingice.net/programming/implementing-layers-camanjs">blog link</a>.</p><p>However, the gist of the layering system is that, for each layer, it creates a new canvas
element and then either copies the parent layer&#39;s data or applies a solid color to the new
layer. After some (optional) effects are applied, the layer is blended back into the parent
canvas layer using one of many different blending algorithms.</p><p>You can also load an image (local or remote, with a proxy) into a canvas layer, which is useful
if you want to add textures to an image.</p>
</div>
<div class='tags'>
</div>
<h2>Instance Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#constructor-instance'>
- (void) <strong>constructor</strong>(c)
</a>
</span>
<span class='constructor note title'>Constructor</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#newLayer-instance'>
- (void) <strong>newLayer</strong>(cb)
</a>
</span>
<span class='desc'>
If you want to create nested layers
</span>
</li>
<li>
<span class='signature'>
<a href='#setBlendingMode-instance'>
- (void) <strong>setBlendingMode</strong>(mode)
</a>
</span>
<span class='desc'>
Sets the blending mode of this layer.
</span>
</li>
<li>
<span class='signature'>
<a href='#opacity-instance'>
- (void) <strong>opacity</strong>(opacity)
</a>
</span>
<span class='desc'>
Sets the opacity of this layer.
</span>
</li>
<li>
<span class='signature'>
<a href='#copyParent-instance'>
- (void) <strong>copyParent</strong>()
</a>
</span>
<span class='desc'>
Copies the contents of the parent layer to this layer
</span>
</li>
<li>
<span class='signature'>
<a href='#fillColor-instance'>
- (void) <strong>fillColor</strong>()
</a>
</span>
<span class='desc'>
Fills this layer with a single color
</span>
</li>
<li>
<span class='signature'>
<a href='#overlayImage-instance'>
- (void) <strong>overlayImage</strong>(image)
</a>
</span>
<span class='desc'>
Loads and overlays an image onto this layer
</span>
</li>
<li>
<span class='signature'>
<a href='#applyToParent-instance'>
- (void) <strong>applyToParent</strong>()
</a>
</span>
<span class='desc'>
Takes the contents of this layer and applies them to the parent layer at render time.
</span>
</li>
</ul>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-instance'>
- (void) <strong>constructor</strong>(c)
</p>
<div class='tags'>
</div>
</div>
</div>
<h2>Instance Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='newLayer-instance'>
- (void) <strong>newLayer</strong>(cb)
</p>
<div class='docstring'>
<p>If you want to create nested layers</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='setBlendingMode-instance'>
- (void) <strong>setBlendingMode</strong>(mode)
</p>
<div class='docstring'>
<p>Sets the blending mode of this layer. The mode is the name of a blender function.</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='opacity-instance'>
- (void) <strong>opacity</strong>(opacity)
</p>
<div class='docstring'>
<p>Sets the opacity of this layer. This affects how much of this layer is applied to the parent
layer at render time.</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='copyParent-instance'>
- (void) <strong>copyParent</strong>()
</p>
<div class='docstring'>
<p>Copies the contents of the parent layer to this layer</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='fillColor-instance'>
- (void) <strong>fillColor</strong>()
</p>
<div class='docstring'>
<p>Fills this layer with a single color</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='overlayImage-instance'>
- (void) <strong>overlayImage</strong>(image)
</p>
<div class='docstring'>
<p>Loads and overlays an image onto this layer</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='applyToParent-instance'>
- (void) <strong>applyToParent</strong>()
</p>
<div class='docstring'>
<p>Takes the contents of this layer and applies them to the parent layer at render time. This
should never be called explicitly by the user.</p>
</div>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>Logger</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.Logger
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;logger.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Simple console logger class that can be toggled on and off based on Caman.DEBUG</p>
</div>
<div class='tags'>
</div>
<h2>Instance Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#constructor-instance'>
- (void) <strong>constructor</strong>()
</a>
</span>
<span class='constructor note title'>Constructor</span>
<span class='desc'>
</span>
</li>
</ul>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-instance'>
- (void) <strong>constructor</strong>()
</p>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>Pixel</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.Pixel
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;pixel.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Represents a single Pixel in an image.</p>
</div>
<div class='tags'>
</div>
<h2>Class Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#coordinatesToLocation-class'>
+ (void) <strong>coordinatesToLocation</strong>(x, y, width)
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#locationToCoordinates-class'>
+ (void) <strong>locationToCoordinates</strong>(loc, width)
</a>
</span>
<span class='desc'>
</span>
</li>
</ul>
<h2>Instance Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#constructor-instance'>
- (void) <strong>constructor</strong>(r = 0, g = 0, b = 0, a = 255, c = null)
</a>
</span>
<span class='constructor note title'>Constructor</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#setContext-instance'>
- (void) <strong>setContext</strong>(c)
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#locationXY-instance'>
- (void) <strong>locationXY</strong>()
</a>
</span>
<span class='desc'>
Retrieves the X, Y location of the current pixel.
</span>
</li>
<li>
<span class='signature'>
<a href='#pixelAtLocation-instance'>
- (void) <strong>pixelAtLocation</strong>(loc)
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#getPixelRelative-instance'>
- (void) <strong>getPixelRelative</strong>(horiz, vert)
</a>
</span>
<span class='desc'>
Returns an RGBA object for a pixel whose location is specified in relation to the current pixel.
</span>
</li>
<li>
<span class='signature'>
<a href='#putPixelRelative-instance'>
- (void) <strong>putPixelRelative</strong>(horiz, vert, rgba)
</a>
</span>
<span class='desc'>
The counterpart to getPixelRelative, this updates the value of a pixel whose location is specified in relation to the current pixel.
</span>
</li>
<li>
<span class='signature'>
<a href='#getPixel-instance'>
- (void) <strong>getPixel</strong>(x, y)
</a>
</span>
<span class='desc'>
Gets an RGBA object for an arbitrary pixel in the canvas specified by absolute X, Y coordinates
</span>
</li>
<li>
<span class='signature'>
<a href='#putPixel-instance'>
- (void) <strong>putPixel</strong>(x, y, rgba)
</a>
</span>
<span class='desc'>
Updates the pixel at the given X, Y coordinate
</span>
</li>
<li>
<span class='signature'>
<a href='#toString-instance'>
- (void) <strong>toString</strong>()
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#toHex-instance'>
- (void) <strong>toHex</strong>(includeAlpha = false)
</a>
</span>
<span class='desc'>
</span>
</li>
</ul>
<h2>Class Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='coordinatesToLocation-class'>
+ (void) <strong>coordinatesToLocation</strong>(x, y, width)
</p>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='locationToCoordinates-class'>
+ (void) <strong>locationToCoordinates</strong>(loc, width)
</p>
<div class='tags'>
</div>
</div>
</div>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-instance'>
- (void) <strong>constructor</strong>(r = 0, g = 0, b = 0, a = 255, c = null)
</p>
<div class='tags'>
</div>
</div>
</div>
<h2>Instance Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='setContext-instance'>
- (void) <strong>setContext</strong>(c)
</p>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='locationXY-instance'>
- (void) <strong>locationXY</strong>()
</p>
<div class='docstring'>
<p>Retrieves the X, Y location of the current pixel. The origin is at the bottom left corner of
the image, like a normal coordinate system.</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='pixelAtLocation-instance'>
- (void) <strong>pixelAtLocation</strong>(loc)
</p>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getPixelRelative-instance'>
- (void) <strong>getPixelRelative</strong>(horiz, vert)
</p>
<div class='docstring'>
<p>Returns an RGBA object for a pixel whose location is specified in relation to the current
pixel.</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='putPixelRelative-instance'>
- (void) <strong>putPixelRelative</strong>(horiz, vert, rgba)
</p>
<div class='docstring'>
<p>The counterpart to getPixelRelative, this updates the value of a pixel whose location is
specified in relation to the current pixel.</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getPixel-instance'>
- (void) <strong>getPixel</strong>(x, y)
</p>
<div class='docstring'>
<p>Gets an RGBA object for an arbitrary pixel in the canvas specified by absolute X, Y coordinates</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='putPixel-instance'>
- (void) <strong>putPixel</strong>(x, y, rgba)
</p>
<div class='docstring'>
<p>Updates the pixel at the given X, Y coordinate</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='toString-instance'>
- (void) <strong>toString</strong>()
</p>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='toHex-instance'>
- (void) <strong>toHex</strong>(includeAlpha = false)
</p>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>Plugin</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.Plugin
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;plugin.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Stores and registers standalone plugins</p>
</div>
<div class='tags'>
</div>
<h2>Class Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#register-class'>
+ (void) <strong>register</strong>(name, plugin)
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#execute-class'>
+ (void) <strong>execute</strong>(context, name, args)
</a>
</span>
<span class='desc'>
</span>
</li>
</ul>
<h2>Class Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='register-class'>
+ (void) <strong>register</strong>(name, plugin)
</p>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='execute-class'>
+ (void) <strong>execute</strong>(context, name, args)
</p>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CamanJS Documentation</title>
<link rel='stylesheet' href='../../assets/codo.css' type='text/css'>
<script src='../../assets/codo.js'></script>
<script src='../../assets/search_data.js'></script>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../README.md.html' title='CamanJS'>CamanJS</a>
&raquo;
<a href='../../class_index.html' title='Index'>Index</a>
&raquo;
<a href='../../classes/Caman.html' title='Caman'>Caman</a>
&raquo;
<span class='title'>Store</span>
<nav>
<ul>
<li class='noframes'>
(<a class='noframes' href='#'>no frames</a>)
</li>
</ul>
</nav>
<div id='search'>
<a id='class_list_link' href='../../class_list.html'>Classes</a>
<a id='file_list_link' href='../../file_list.html'>Files</a>
<a id='method_list_link' href='../../method_list.html'>Methods</a>
<a id='extra_list_link' href='../../extra_list.html'>Extras</a>
</div>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>Ctrl-T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
In frame mode you can toggle the list naviation frame on the left side:
</p>
<ul>
<li>
<span>Ctrl-L</span>
Toggle list view
</li>
</ul>
<p>
You can focus a list in frame mode or toggle a tab in frameless mode:
</p>
<ul>
<li>
<span>Ctrl-C</span>
Class list
</li>
<li>
<span>Ctrl-I</span>
Mixin list
</li>
<li>
<span>Ctrl-F</span>
File list
</li>
<li>
<span>Ctrl-M</span>
Method list
</li>
<li>
<span>Ctrl-E</span>
Extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>Ctrl-S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
<p>
In frameless mode you can close the list tab:
</p>
<ul>
<li>
<span>Esc</span>
Close list tab
</li>
</ul>
</div>
</div>
<div id='content'>
<h1>
Class:
Caman.Store
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;core&#47;store.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Used for storing instances of CamanInstance objects such that, when Caman() is called on an
already initialized element, it returns that object instead of re-initializing.</p>
</div>
<div class='tags'>
</div>
<h2>Class Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#has-class'>
+ (void) <strong>has</strong>(search)
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#get-class'>
+ (void) <strong>get</strong>(search)
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#put-class'>
+ (void) <strong>put</strong>(name, obj)
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#execute-class'>
+ (void) <strong>execute</strong>(search, callback)
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#flush-class'>
+ (void) <strong>flush</strong>(name = false)
</a>
</span>
<span class='desc'>
</span>
</li>
</ul>
<h2>Class Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='has-class'>
+ (void) <strong>has</strong>(search)
</p>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='get-class'>
+ (void) <strong>get</strong>(search)
</p>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='put-class'>
+ (void) <strong>put</strong>(name, obj)
</p>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='execute-class'>
+ (void) <strong>execute</strong>(search, callback)
</p>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='flush-class'>
+ (void) <strong>flush</strong>(name = false)
</p>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
Generated on
Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
(Node.js v0.10.21).
&#10034;
Press Ctrl-h to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
&#10034;
<a href='https://mksoft.ch'>mksoft.ch</a>
</div>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment