diff --git a/404.php b/404.php new file mode 100755 index 0000000..318a7f8 --- /dev/null +++ b/404.php @@ -0,0 +1,47 @@ + + +
+
+ +
+
+

+
+ +
+

+ + + + + +
+

+
    + 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10 ) ); ?> +
+
+ + ' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'symbol' ), convert_smilies( ':)' ) ) . '

'; + the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=$archive_content" ); + ?> + + + +
+
+ +
+
+ + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100755 index 0000000..54e2dbd --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +Symbol Theme +=========== +[![image](https://i.cloudup.com/owMC2owNcs.png)](https://cloudup.com/cfgcHouElDv) + +Installation +------------ +1. Move the folder wp-content/themes/ or upload from your admin area (Plugins > Upload) +2. Enable the theme from the admin panel + +Licence +--------------- +[![Creative Commons License](http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png)](http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US) + +This work is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License](http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US). \ No newline at end of file diff --git a/archive.php b/archive.php new file mode 100755 index 0000000..6679b91 --- /dev/null +++ b/archive.php @@ -0,0 +1,96 @@ + + +
+
+ + + +
' ); + + } elseif ( is_tag() ) { + // show an optional tag description + $tag_description = tag_description(); + if ( ! empty( $tag_description ) ) + echo apply_filters( 'tag_archive_meta', '
' . $tag_description . '
' ); + } + ?> + + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/comments.php b/comments.php new file mode 100755 index 0000000..22fb5ad --- /dev/null +++ b/comments.php @@ -0,0 +1,73 @@ + + + + +
+ + + + +

+ +

+ + 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> + + + +
    + 'symbol_comment' ) ); + ?> +
+ + 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> + + + + + + +

+ + + + +
diff --git a/content.php b/content.php new file mode 100755 index 0000000..f18223d --- /dev/null +++ b/content.php @@ -0,0 +1,28 @@ + + +
> +
+
+ +

+ +
+ + +
+ +
+ +
+ →', 'symbol' ) ); ?> + '' ) ); ?> +
+ +
+ +
diff --git a/footer.php b/footer.php new file mode 100755 index 0000000..cd5f619 --- /dev/null +++ b/footer.php @@ -0,0 +1,27 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100755 index 0000000..a6439f2 --- /dev/null +++ b/functions.php @@ -0,0 +1,132 @@ + __( 'Primary Menu', 'symbol' ), + ) ); +} +endif; // symbol_setup +add_action( 'after_setup_theme', 'symbol_setup' ); + +/** + * Register widgetized area and update sidebar with default widgets + * + * @since Symbol 1.0 + */ +function symbol_widgets_init() { + register_sidebar( array( + 'name' => __( 'Sidebar', 'symbol' ), + 'id' => 'sidebar-1', + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); +} +add_action( 'widgets_init', 'symbol_widgets_init' ); + +/** + * Enqueue scripts and styles + */ +function symbol_scripts() { + + wp_enqueue_style( 'normalize', '//normalize-css.googlecode.com/svn/trunk/normalize.css'); + wp_enqueue_style( 'prettify', '//google-code-prettify.googlecode.com/svn/trunk/src/prettify.css'); + wp_enqueue_style( 'style', get_stylesheet_uri() ); + + wp_deregister_script( 'jquery' ); + wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'); + wp_enqueue_script( 'jquery' ); + wp_enqueue_script( 'snap-js', get_template_directory_uri() . '/js/snap.min.js', array('jquery'), '20130115', true ); + wp_enqueue_script( 'prettify', '//google-code-prettify.googlecode.com/svn/trunk/src/prettify.js', array( ), '20120206', true ); + wp_enqueue_script( 'site-js', get_template_directory_uri() . '/js/site.js', array( 'jquery', 'prettify', 'snap-js'), '20120206', true ); + + + + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } + + if ( is_singular() && wp_attachment_is_image() ) { + wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); + } +} +add_action( 'wp_enqueue_scripts', 'symbol_scripts' ); + + +add_action('admin_head', 'load_theme_scripts'); + + + +require( get_template_directory() . '/inc/plugins/nav-menu-images/nav-menu-images.php' ); + +if (get_option('licence_symbol')) { + + // Re-define the options-framework URL + define( 'OPTIONS_FRAMEWORK_URL', get_template_directory_uri() . '/inc/options-framework/' ); + + // Load the Options Framework Plugin + if ( !function_exists( 'optionsframework_init' ) ) { + define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory() . '/inc/options-framework/' ); + require_once OPTIONS_FRAMEWORK_DIRECTORY . 'options-framework.php'; + } + + require get_template_directory() . '/inc/Theme-Updater/updater.php'; + +}else{ + require_once 'inc/licence.php'; +} + + diff --git a/header.php b/header.php new file mode 100755 index 0000000..73b8592 --- /dev/null +++ b/header.php @@ -0,0 +1,88 @@ + section and everything up till
+ * + * @package Symbol + * @since Symbol 1.0 + */ +?> +> + + + +<?php wp_title( 'by', true, 'right' ); bloginfo( 'name' ); ?> + + + + + + + + + + + + + +> + + + + +
+ + + + + + + + + diff --git a/image.php b/image.php new file mode 100755 index 0000000..ee8063e --- /dev/null +++ b/image.php @@ -0,0 +1,111 @@ + + +
+
+ + + +
> +
+

+ + + + +
+ +
+ +
+
+ $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); + foreach ( $attachments as $k => $attachment ) { + if ( $attachment->ID == $post->ID ) + break; + } + $k++; + // If there is more than 1 attachment in a gallery + if ( count( $attachments ) > 1 ) { + if ( isset( $attachments[ $k ] ) ) + // get the URL of the next image attachment + $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); + else + // or get the URL of the first image attachment + $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); + } else { + // or, if there's only 1 image, get the URL of the image + $next_attachment_url = wp_get_attachment_url(); + } + ?> + + ID, $attachment_size ); + ?> +
+ + post_excerpt ) ) : ?> +
+ +
+ +
+ + + '' ) ); ?> + +
+ +
+ + Post a comment or leave a trackback: Trackback URL.', 'symbol' ), get_trackback_url() ); ?> + + Trackback URL.', 'symbol' ), get_trackback_url() ); ?> + + post a comment.', 'symbol' ); ?> + + + + ', '' ); ?> +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/images/.DS_Store b/images/.DS_Store new file mode 100755 index 0000000..5008ddf Binary files /dev/null and b/images/.DS_Store differ diff --git a/images/Untitled-2.png b/images/Untitled-2.png new file mode 100755 index 0000000..01ddd21 Binary files /dev/null and b/images/Untitled-2.png differ diff --git a/images/anchor.svg b/images/anchor.svg new file mode 100755 index 0000000..bc9d1b5 --- /dev/null +++ b/images/anchor.svg @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/images/favicon.ico b/images/favicon.ico new file mode 100755 index 0000000..c5310f6 Binary files /dev/null and b/images/favicon.ico differ diff --git a/images/icon-about.png b/images/icon-about.png new file mode 100755 index 0000000..34d0539 Binary files /dev/null and b/images/icon-about.png differ diff --git a/images/icon-email.png b/images/icon-email.png new file mode 100755 index 0000000..9df362a Binary files /dev/null and b/images/icon-email.png differ diff --git a/images/icon-github.png b/images/icon-github.png new file mode 100755 index 0000000..71a2a45 Binary files /dev/null and b/images/icon-github.png differ diff --git a/images/icon-instagram.png b/images/icon-instagram.png new file mode 100755 index 0000000..110ae82 Binary files /dev/null and b/images/icon-instagram.png differ diff --git a/images/icon-music.png b/images/icon-music.png new file mode 100755 index 0000000..d4e5917 Binary files /dev/null and b/images/icon-music.png differ diff --git a/images/icon-page.png b/images/icon-page.png new file mode 100755 index 0000000..8a71d82 Binary files /dev/null and b/images/icon-page.png differ diff --git a/images/icon-rss.png b/images/icon-rss.png new file mode 100755 index 0000000..6c2e8a3 Binary files /dev/null and b/images/icon-rss.png differ diff --git a/images/icon-twitter.png b/images/icon-twitter.png new file mode 100755 index 0000000..aa0c68c Binary files /dev/null and b/images/icon-twitter.png differ diff --git a/images/icons/acting_large.png b/images/icons/acting_large.png new file mode 100755 index 0000000..de826cf Binary files /dev/null and b/images/icons/acting_large.png differ diff --git a/images/icons/atom_large.png b/images/icons/atom_large.png new file mode 100755 index 0000000..abbf774 Binary files /dev/null and b/images/icons/atom_large.png differ diff --git a/images/icons/automobile_large.png b/images/icons/automobile_large.png new file mode 100755 index 0000000..2756682 Binary files /dev/null and b/images/icons/automobile_large.png differ diff --git a/images/icons/bear_large.png b/images/icons/bear_large.png new file mode 100755 index 0000000..aa73078 Binary files /dev/null and b/images/icons/bear_large.png differ diff --git a/images/icons/beer_large.png b/images/icons/beer_large.png new file mode 100755 index 0000000..41541b5 Binary files /dev/null and b/images/icons/beer_large.png differ diff --git a/images/icons/bolt_large.png b/images/icons/bolt_large.png new file mode 100755 index 0000000..6f73725 Binary files /dev/null and b/images/icons/bolt_large.png differ diff --git a/images/icons/bullhorn_large.png b/images/icons/bullhorn_large.png new file mode 100755 index 0000000..a395de3 Binary files /dev/null and b/images/icons/bullhorn_large.png differ diff --git a/images/icons/business_man_large.png b/images/icons/business_man_large.png new file mode 100755 index 0000000..ef13a7a Binary files /dev/null and b/images/icons/business_man_large.png differ diff --git a/images/icons/cassette_large.png b/images/icons/cassette_large.png new file mode 100755 index 0000000..b41d5ce Binary files /dev/null and b/images/icons/cassette_large.png differ diff --git a/images/icons/cell_phone_large.png b/images/icons/cell_phone_large.png new file mode 100755 index 0000000..76b928c Binary files /dev/null and b/images/icons/cell_phone_large.png differ diff --git a/images/icons/chain_link_large.png b/images/icons/chain_link_large.png new file mode 100755 index 0000000..fdf8ec6 Binary files /dev/null and b/images/icons/chain_link_large.png differ diff --git a/images/icons/cloudrain_large.png b/images/icons/cloudrain_large.png new file mode 100755 index 0000000..7ad92a6 Binary files /dev/null and b/images/icons/cloudrain_large.png differ diff --git a/images/icons/coffee_large.png b/images/icons/coffee_large.png new file mode 100755 index 0000000..cb92838 Binary files /dev/null and b/images/icons/coffee_large.png differ diff --git a/images/icons/cog_head_large.png b/images/icons/cog_head_large.png new file mode 100755 index 0000000..dbc249d Binary files /dev/null and b/images/icons/cog_head_large.png differ diff --git a/images/icons/crab_large.png b/images/icons/crab_large.png new file mode 100755 index 0000000..89cc6a5 Binary files /dev/null and b/images/icons/crab_large.png differ diff --git a/images/icons/day_night_large.png b/images/icons/day_night_large.png new file mode 100755 index 0000000..68c7505 Binary files /dev/null and b/images/icons/day_night_large.png differ diff --git a/images/icons/disapprove_large.png b/images/icons/disapprove_large.png new file mode 100755 index 0000000..6f09a4b Binary files /dev/null and b/images/icons/disapprove_large.png differ diff --git a/images/icons/dog_large.png b/images/icons/dog_large.png new file mode 100755 index 0000000..761266d Binary files /dev/null and b/images/icons/dog_large.png differ diff --git a/images/icons/eye_large.png b/images/icons/eye_large.png new file mode 100755 index 0000000..8e29e56 Binary files /dev/null and b/images/icons/eye_large.png differ diff --git a/images/icons/film_large.png b/images/icons/film_large.png new file mode 100755 index 0000000..e9fb62f Binary files /dev/null and b/images/icons/film_large.png differ diff --git a/images/icons/flask_large.png b/images/icons/flask_large.png new file mode 100755 index 0000000..e28479f Binary files /dev/null and b/images/icons/flask_large.png differ diff --git a/images/icons/ghost_large.png b/images/icons/ghost_large.png new file mode 100755 index 0000000..1e45906 Binary files /dev/null and b/images/icons/ghost_large.png differ diff --git a/images/icons/glasses_large.png b/images/icons/glasses_large.png new file mode 100755 index 0000000..f8fbd4c Binary files /dev/null and b/images/icons/glasses_large.png differ diff --git a/images/icons/glider_large.png b/images/icons/glider_large.png new file mode 100755 index 0000000..da3aa65 Binary files /dev/null and b/images/icons/glider_large.png differ diff --git a/images/icons/guitar_large.png b/images/icons/guitar_large.png new file mode 100755 index 0000000..2403813 Binary files /dev/null and b/images/icons/guitar_large.png differ diff --git a/images/icons/hand_large.png b/images/icons/hand_large.png new file mode 100755 index 0000000..5b0ac2d Binary files /dev/null and b/images/icons/hand_large.png differ diff --git a/images/icons/hat_large.png b/images/icons/hat_large.png new file mode 100755 index 0000000..eac4dab Binary files /dev/null and b/images/icons/hat_large.png differ diff --git a/images/icons/heart_large.png b/images/icons/heart_large.png new file mode 100755 index 0000000..998f27d Binary files /dev/null and b/images/icons/heart_large.png differ diff --git a/images/icons/infection_large.png b/images/icons/infection_large.png new file mode 100755 index 0000000..340a523 Binary files /dev/null and b/images/icons/infection_large.png differ diff --git a/images/icons/infinity_large.png b/images/icons/infinity_large.png new file mode 100755 index 0000000..41c3b60 Binary files /dev/null and b/images/icons/infinity_large.png differ diff --git a/images/icons/iphone_large.png b/images/icons/iphone_large.png new file mode 100755 index 0000000..e809565 Binary files /dev/null and b/images/icons/iphone_large.png differ diff --git a/images/icons/lemon_large.png b/images/icons/lemon_large.png new file mode 100755 index 0000000..3a53e79 Binary files /dev/null and b/images/icons/lemon_large.png differ diff --git a/images/icons/like_large.png b/images/icons/like_large.png new file mode 100755 index 0000000..5d543b5 Binary files /dev/null and b/images/icons/like_large.png differ diff --git a/images/icons/lotus_large.png b/images/icons/lotus_large.png new file mode 100755 index 0000000..a1c7e59 Binary files /dev/null and b/images/icons/lotus_large.png differ diff --git a/images/icons/man_stairs_large.png b/images/icons/man_stairs_large.png new file mode 100755 index 0000000..ae30d5a Binary files /dev/null and b/images/icons/man_stairs_large.png differ diff --git a/images/icons/mine_cross_large.png b/images/icons/mine_cross_large.png new file mode 100755 index 0000000..e2c48a3 Binary files /dev/null and b/images/icons/mine_cross_large.png differ diff --git a/images/icons/money_large.png b/images/icons/money_large.png new file mode 100755 index 0000000..75f1228 Binary files /dev/null and b/images/icons/money_large.png differ diff --git a/images/icons/motorcycle_large.png b/images/icons/motorcycle_large.png new file mode 100755 index 0000000..80bebd4 Binary files /dev/null and b/images/icons/motorcycle_large.png differ diff --git a/images/icons/mustache_large.png b/images/icons/mustache_large.png new file mode 100755 index 0000000..439790c Binary files /dev/null and b/images/icons/mustache_large.png differ diff --git a/images/icons/no_smoking_large.png b/images/icons/no_smoking_large.png new file mode 100755 index 0000000..cda8f50 Binary files /dev/null and b/images/icons/no_smoking_large.png differ diff --git a/images/icons/pan_ui_large.png b/images/icons/pan_ui_large.png new file mode 100755 index 0000000..1d25e16 Binary files /dev/null and b/images/icons/pan_ui_large.png differ diff --git a/images/icons/paperplane_large.png b/images/icons/paperplane_large.png new file mode 100755 index 0000000..269b037 Binary files /dev/null and b/images/icons/paperplane_large.png differ diff --git a/images/icons/quotes_large.png b/images/icons/quotes_large.png new file mode 100755 index 0000000..3633bac Binary files /dev/null and b/images/icons/quotes_large.png differ diff --git a/images/icons/radio_large.png b/images/icons/radio_large.png new file mode 100755 index 0000000..6fd2d26 Binary files /dev/null and b/images/icons/radio_large.png differ diff --git a/images/icons/rain_large.png b/images/icons/rain_large.png new file mode 100755 index 0000000..4c69dec Binary files /dev/null and b/images/icons/rain_large.png differ diff --git a/images/icons/robot_square_large.png b/images/icons/robot_square_large.png new file mode 100755 index 0000000..3f36820 Binary files /dev/null and b/images/icons/robot_square_large.png differ diff --git a/images/icons/scenic_viewpoint_large.png b/images/icons/scenic_viewpoint_large.png new file mode 100755 index 0000000..5f50f92 Binary files /dev/null and b/images/icons/scenic_viewpoint_large.png differ diff --git a/images/icons/soccer_shoe_large.png b/images/icons/soccer_shoe_large.png new file mode 100755 index 0000000..11862a7 Binary files /dev/null and b/images/icons/soccer_shoe_large.png differ diff --git a/images/icons/star_large.png b/images/icons/star_large.png new file mode 100755 index 0000000..01f6c6a Binary files /dev/null and b/images/icons/star_large.png differ diff --git a/images/icons/stress_large.png b/images/icons/stress_large.png new file mode 100755 index 0000000..577be72 Binary files /dev/null and b/images/icons/stress_large.png differ diff --git a/images/icons/sunrise_large.png b/images/icons/sunrise_large.png new file mode 100755 index 0000000..26e7efc Binary files /dev/null and b/images/icons/sunrise_large.png differ diff --git a/images/icons/thumbs/acting.png b/images/icons/thumbs/acting.png new file mode 100755 index 0000000..cc430f5 Binary files /dev/null and b/images/icons/thumbs/acting.png differ diff --git a/images/icons/thumbs/atom.png b/images/icons/thumbs/atom.png new file mode 100755 index 0000000..258b08b Binary files /dev/null and b/images/icons/thumbs/atom.png differ diff --git a/images/icons/thumbs/automobile.png b/images/icons/thumbs/automobile.png new file mode 100755 index 0000000..c89d62c Binary files /dev/null and b/images/icons/thumbs/automobile.png differ diff --git a/images/icons/thumbs/bear.png b/images/icons/thumbs/bear.png new file mode 100755 index 0000000..ebb49e6 Binary files /dev/null and b/images/icons/thumbs/bear.png differ diff --git a/images/icons/thumbs/beer.png b/images/icons/thumbs/beer.png new file mode 100755 index 0000000..1831586 Binary files /dev/null and b/images/icons/thumbs/beer.png differ diff --git a/images/icons/thumbs/bolt.png b/images/icons/thumbs/bolt.png new file mode 100755 index 0000000..d4d8c8e Binary files /dev/null and b/images/icons/thumbs/bolt.png differ diff --git a/images/icons/thumbs/bullhorn.png b/images/icons/thumbs/bullhorn.png new file mode 100755 index 0000000..a067101 Binary files /dev/null and b/images/icons/thumbs/bullhorn.png differ diff --git a/images/icons/thumbs/business_man.png b/images/icons/thumbs/business_man.png new file mode 100755 index 0000000..c6e7b2c Binary files /dev/null and b/images/icons/thumbs/business_man.png differ diff --git a/images/icons/thumbs/cassette.png b/images/icons/thumbs/cassette.png new file mode 100755 index 0000000..d22651e Binary files /dev/null and b/images/icons/thumbs/cassette.png differ diff --git a/images/icons/thumbs/cell_phone.png b/images/icons/thumbs/cell_phone.png new file mode 100755 index 0000000..57baebe Binary files /dev/null and b/images/icons/thumbs/cell_phone.png differ diff --git a/images/icons/thumbs/chain_link.png b/images/icons/thumbs/chain_link.png new file mode 100755 index 0000000..5b4d83d Binary files /dev/null and b/images/icons/thumbs/chain_link.png differ diff --git a/images/icons/thumbs/cloudrain.png b/images/icons/thumbs/cloudrain.png new file mode 100755 index 0000000..3391e6a Binary files /dev/null and b/images/icons/thumbs/cloudrain.png differ diff --git a/images/icons/thumbs/coffee.png b/images/icons/thumbs/coffee.png new file mode 100755 index 0000000..d42dc19 Binary files /dev/null and b/images/icons/thumbs/coffee.png differ diff --git a/images/icons/thumbs/cog_head.png b/images/icons/thumbs/cog_head.png new file mode 100755 index 0000000..58a57ad Binary files /dev/null and b/images/icons/thumbs/cog_head.png differ diff --git a/images/icons/thumbs/crab.png b/images/icons/thumbs/crab.png new file mode 100755 index 0000000..9ca6ed0 Binary files /dev/null and b/images/icons/thumbs/crab.png differ diff --git a/images/icons/thumbs/day_night.png b/images/icons/thumbs/day_night.png new file mode 100755 index 0000000..e646695 Binary files /dev/null and b/images/icons/thumbs/day_night.png differ diff --git a/images/icons/thumbs/disapprove.png b/images/icons/thumbs/disapprove.png new file mode 100755 index 0000000..fa70ff4 Binary files /dev/null and b/images/icons/thumbs/disapprove.png differ diff --git a/images/icons/thumbs/dog.png b/images/icons/thumbs/dog.png new file mode 100755 index 0000000..1bd779e Binary files /dev/null and b/images/icons/thumbs/dog.png differ diff --git a/images/icons/thumbs/eye.png b/images/icons/thumbs/eye.png new file mode 100755 index 0000000..10334c4 Binary files /dev/null and b/images/icons/thumbs/eye.png differ diff --git a/images/icons/thumbs/film.png b/images/icons/thumbs/film.png new file mode 100755 index 0000000..f622001 Binary files /dev/null and b/images/icons/thumbs/film.png differ diff --git a/images/icons/thumbs/flask.png b/images/icons/thumbs/flask.png new file mode 100755 index 0000000..16aafb8 Binary files /dev/null and b/images/icons/thumbs/flask.png differ diff --git a/images/icons/thumbs/ghost.png b/images/icons/thumbs/ghost.png new file mode 100755 index 0000000..abc2e5a Binary files /dev/null and b/images/icons/thumbs/ghost.png differ diff --git a/images/icons/thumbs/glasses.png b/images/icons/thumbs/glasses.png new file mode 100755 index 0000000..0e58dd1 Binary files /dev/null and b/images/icons/thumbs/glasses.png differ diff --git a/images/icons/thumbs/glider.png b/images/icons/thumbs/glider.png new file mode 100755 index 0000000..4ca3c0b Binary files /dev/null and b/images/icons/thumbs/glider.png differ diff --git a/images/icons/thumbs/guitar.png b/images/icons/thumbs/guitar.png new file mode 100755 index 0000000..712b645 Binary files /dev/null and b/images/icons/thumbs/guitar.png differ diff --git a/images/icons/thumbs/hand.png b/images/icons/thumbs/hand.png new file mode 100755 index 0000000..95c995d Binary files /dev/null and b/images/icons/thumbs/hand.png differ diff --git a/images/icons/thumbs/hat.png b/images/icons/thumbs/hat.png new file mode 100755 index 0000000..f694f6f Binary files /dev/null and b/images/icons/thumbs/hat.png differ diff --git a/images/icons/thumbs/heart.png b/images/icons/thumbs/heart.png new file mode 100755 index 0000000..f2ef084 Binary files /dev/null and b/images/icons/thumbs/heart.png differ diff --git a/images/icons/thumbs/infection.png b/images/icons/thumbs/infection.png new file mode 100755 index 0000000..569740d Binary files /dev/null and b/images/icons/thumbs/infection.png differ diff --git a/images/icons/thumbs/infinity.png b/images/icons/thumbs/infinity.png new file mode 100755 index 0000000..a4eda11 Binary files /dev/null and b/images/icons/thumbs/infinity.png differ diff --git a/images/icons/thumbs/iphone.png b/images/icons/thumbs/iphone.png new file mode 100755 index 0000000..d3272e0 Binary files /dev/null and b/images/icons/thumbs/iphone.png differ diff --git a/images/icons/thumbs/lemon.png b/images/icons/thumbs/lemon.png new file mode 100755 index 0000000..450f919 Binary files /dev/null and b/images/icons/thumbs/lemon.png differ diff --git a/images/icons/thumbs/like.png b/images/icons/thumbs/like.png new file mode 100755 index 0000000..7f3e6e4 Binary files /dev/null and b/images/icons/thumbs/like.png differ diff --git a/images/icons/thumbs/lotus.png b/images/icons/thumbs/lotus.png new file mode 100755 index 0000000..dd5ef0f Binary files /dev/null and b/images/icons/thumbs/lotus.png differ diff --git a/images/icons/thumbs/man_stairs.png b/images/icons/thumbs/man_stairs.png new file mode 100755 index 0000000..5ad8e79 Binary files /dev/null and b/images/icons/thumbs/man_stairs.png differ diff --git a/images/icons/thumbs/mine_cross.png b/images/icons/thumbs/mine_cross.png new file mode 100755 index 0000000..de20dc9 Binary files /dev/null and b/images/icons/thumbs/mine_cross.png differ diff --git a/images/icons/thumbs/money.png b/images/icons/thumbs/money.png new file mode 100755 index 0000000..079eba7 Binary files /dev/null and b/images/icons/thumbs/money.png differ diff --git a/images/icons/thumbs/motorcycle.png b/images/icons/thumbs/motorcycle.png new file mode 100755 index 0000000..5349c2d Binary files /dev/null and b/images/icons/thumbs/motorcycle.png differ diff --git a/images/icons/thumbs/mustache.png b/images/icons/thumbs/mustache.png new file mode 100755 index 0000000..6c4768c Binary files /dev/null and b/images/icons/thumbs/mustache.png differ diff --git a/images/icons/thumbs/no_smoking.png b/images/icons/thumbs/no_smoking.png new file mode 100755 index 0000000..676aa3c Binary files /dev/null and b/images/icons/thumbs/no_smoking.png differ diff --git a/images/icons/thumbs/pan_ui.png b/images/icons/thumbs/pan_ui.png new file mode 100755 index 0000000..3f4e4ee Binary files /dev/null and b/images/icons/thumbs/pan_ui.png differ diff --git a/images/icons/thumbs/paperplane.png b/images/icons/thumbs/paperplane.png new file mode 100755 index 0000000..93d78cb Binary files /dev/null and b/images/icons/thumbs/paperplane.png differ diff --git a/images/icons/thumbs/quotes.png b/images/icons/thumbs/quotes.png new file mode 100755 index 0000000..0eb7fd4 Binary files /dev/null and b/images/icons/thumbs/quotes.png differ diff --git a/images/icons/thumbs/radio.png b/images/icons/thumbs/radio.png new file mode 100755 index 0000000..8a51b62 Binary files /dev/null and b/images/icons/thumbs/radio.png differ diff --git a/images/icons/thumbs/rain.png b/images/icons/thumbs/rain.png new file mode 100755 index 0000000..d3398b8 Binary files /dev/null and b/images/icons/thumbs/rain.png differ diff --git a/images/icons/thumbs/robot_square.png b/images/icons/thumbs/robot_square.png new file mode 100755 index 0000000..d845f54 Binary files /dev/null and b/images/icons/thumbs/robot_square.png differ diff --git a/images/icons/thumbs/scenic_viewpoint.png b/images/icons/thumbs/scenic_viewpoint.png new file mode 100755 index 0000000..501e612 Binary files /dev/null and b/images/icons/thumbs/scenic_viewpoint.png differ diff --git a/images/icons/thumbs/soccer_shoe.png b/images/icons/thumbs/soccer_shoe.png new file mode 100755 index 0000000..950938b Binary files /dev/null and b/images/icons/thumbs/soccer_shoe.png differ diff --git a/images/icons/thumbs/star.png b/images/icons/thumbs/star.png new file mode 100755 index 0000000..66b1baa Binary files /dev/null and b/images/icons/thumbs/star.png differ diff --git a/images/icons/thumbs/stress.png b/images/icons/thumbs/stress.png new file mode 100755 index 0000000..367d71a Binary files /dev/null and b/images/icons/thumbs/stress.png differ diff --git a/images/icons/thumbs/sunrise.png b/images/icons/thumbs/sunrise.png new file mode 100755 index 0000000..3ba99c8 Binary files /dev/null and b/images/icons/thumbs/sunrise.png differ diff --git a/images/icons/thumbs/whale.png b/images/icons/thumbs/whale.png new file mode 100755 index 0000000..e8e40b5 Binary files /dev/null and b/images/icons/thumbs/whale.png differ diff --git a/images/icons/thumbs/wrench.png b/images/icons/thumbs/wrench.png new file mode 100755 index 0000000..9ba1f9f Binary files /dev/null and b/images/icons/thumbs/wrench.png differ diff --git a/images/icons/whale_large.png b/images/icons/whale_large.png new file mode 100755 index 0000000..ead7b37 Binary files /dev/null and b/images/icons/whale_large.png differ diff --git a/images/icons/wrench_large.png b/images/icons/wrench_large.png new file mode 100755 index 0000000..8afbce7 Binary files /dev/null and b/images/icons/wrench_large.png differ diff --git a/images/logo.png b/images/logo.png new file mode 100755 index 0000000..0260d01 Binary files /dev/null and b/images/logo.png differ diff --git a/images/open.png b/images/open.png new file mode 100755 index 0000000..e160613 Binary files /dev/null and b/images/open.png differ diff --git a/inc/Theme-Updater/.gitignore b/inc/Theme-Updater/.gitignore new file mode 100755 index 0000000..264946d --- /dev/null +++ b/inc/Theme-Updater/.gitignore @@ -0,0 +1,7 @@ +.svn +CVS +======= +*~ +._* +.DS_Store +Thumbs.db \ No newline at end of file diff --git a/inc/Theme-Updater/admin-style.css b/inc/Theme-Updater/admin-style.css new file mode 100755 index 0000000..dae75b0 --- /dev/null +++ b/inc/Theme-Updater/admin-style.css @@ -0,0 +1,47 @@ +/* Github Theme Updater */ +.plugin-update-tr .update-message-gtu { + font-weight:bold; + margin:5px; + padding:3px 5px; + border-width:1px; + border-style:solid; + -moz-border-radius:5px; + -khtml-border-radius:5px; + -webkit-border-radius:5px; + border-radius:5px; + + background:#fffbe4; + background:-moz-linear-gradient(bottom, #FFEFDC, #FFFCEC); + background:-webkit-gradient(linear, left bottom, left top, from(#FFEFDC), to(#FFFCEC)); + border-color:#D7CBBB; +} + +.plugin-update-tr .update-error { + border-color:#B89FA0; + background: #D7C3C4; + background:-moz-linear-gradient(bottom, #D7C3C4, #FFEAEA); + background:-webkit-gradient(linear, left bottom, left top, from(#D7C3C4), to(#FFEAEA)); + color:#650000; +} + +.plugin-update-tr .update-error a { + color: #650000; + text-decoration:underline; +} + +.plugin-update-tr .update-error .error { + color:#BC0B0B; +} + + +.plugin-update-tr .update-ok { + font-weight:normal; + border-color:#B0C5B3; + background: #CBD8CC; + background:-moz-linear-gradient(bottom, #CBD6CC, #F5FFF6); + background:-webkit-gradient(linear, left bottom, left top, from(#CBD6CC), to(#F5FFF6)); +} + +.plugin-update-tr .update-ok a { + font-weight:bold; +} \ No newline at end of file diff --git a/inc/Theme-Updater/assets.php b/inc/Theme-Updater/assets.php new file mode 100755 index 0000000..19a3896 --- /dev/null +++ b/inc/Theme-Updater/assets.php @@ -0,0 +1,296 @@ +response[ $theme_key ] ) and + !isset( $current->up_to_date[ $theme_key ] ) + ) + return false; + + $wp_list_table = _get_list_table('WP_MS_Themes_List_Table'); + + + // custom additions + if(isset($current->up_to_date[$theme_key])){ + $rollback = $current->up_to_date[$theme_key]['rollback']; + echo '
'; + echo 'Theme is up-to-date! '; + if (current_user_can('update_themes') ){ + if(count($rollback) > 0){ + echo "Rollback to: "; + // display last three tags + for($i=0; $i<3 ; $i++){ + $tag = array_pop($rollback); + if(empty($tag)) break; + if($i>0) echo ", "; + printf('%s', + wp_nonce_url( self_admin_url('update.php?action=upgrade-github-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key), + '&rollback=' . urlencode($tag), + $tag); + } + } else { + echo "No previous tags to rollback to."; + } + } + } else { + $r = $current->response[ $theme_key ]; + if( isset($r['error']) ){ + echo '
'; + printf('Error with Github Theme Updater. %1$s', $r['error']); + } else { + $themes_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); + $theme_name = wp_kses( $theme['Name'], $themes_allowedtags ); + $github_url = esc_url($r['url']); + $diff_url = esc_url($r['url'] . '/compare/' . $theme['Version'] . '...' . $r['new_version']); + + echo '
'; + printf('Github has as a new version of %s. ', $github_url, $theme_name); + printf('View version diff with %s. ', $diff_url, $r['new_version']); + if (current_user_can('update_themes')){ + if(empty($r['package'])){ + echo 'Automatic update is unavailable for this plugin.'; + } else { + printf('Update automatically.', wp_nonce_url( self_admin_url('update.php?action=upgrade-github-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key)); + } + } + } + do_action( "in_theme_update_message-$theme_key", $theme, $r ); + } + echo '
'; +} + +// http://codex.wordpress.org/Function_Reference/wp_enqueue_style +add_action( 'admin_init', 'theme_upgrader_stylesheet' ); +function theme_upgrader_stylesheet() { + $style_url = WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)) . '/admin-style.css'; + wp_register_style('theme_updater_style', $style_url); + wp_enqueue_style( 'theme_updater_style'); +} + + + +/******************************************************************************\ + Most of this code is pulled directly from the WP source + modifications are noted. +\******************************************************************************/ +include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; +class Github_Theme_Upgrader extends Theme_Upgrader { + function download_url( $url ) { + /* + http://core.trac.wordpress.org/browser/trunk/wp-admin/includes/file.php?rev=17928#L467 + changes: + - wanted a timeout < 5 min + - SSL fails when trying to access github + */ + if ( ! $url ) + return new WP_Error('http_no_url', __('Invalid URL Provided.')); + + $tmpfname = wp_tempnam($url); + if ( ! $tmpfname ) + return new WP_Error('http_no_file', __('Could not create Temporary file.')); + + $handle = @fopen($tmpfname, 'wb'); + if ( ! $handle ) + return new WP_Error('http_no_file', __('Could not create Temporary file.')); + + // This! is the one line I wanted to get at + $response = wp_remote_get($url , array('sslverify' => false, 'timeout' => 30)); + + if ( is_wp_error($response) ) { + fclose($handle); + unlink($tmpfname); + return $response; + } + + if ( $response['response']['code'] != '200' ){ + fclose($handle); + unlink($tmpfname); + return new WP_Error('http_404', trim($response['response']['message'])); + } + + fwrite($handle, $response['body']); + fclose($handle); + + return $tmpfname; + } + + function download_package($package) { + /* + http://core.trac.wordpress.org/browser/trunk/wp-admin/includes/class-wp-upgrader.php?rev=17771#L108 + changes: + - use customized download_url + */ + if ( ! preg_match('!^(http|https|ftp)://!i', $package) && file_exists($package) ) //Local file or remote? + return $package; //must be a local file.. + + if ( empty($package) ) + return new WP_Error('no_package', $this->strings['no_package']); + + $this->skin->feedback('downloading_package', $package); + + // This! is the one line I wanted to get at + $download_file = $this->download_url($package); + + if ( is_wp_error($download_file) ) + return new WP_Error('download_failed', $this->strings['download_failed'], $download_file->get_error_message()); + + return $download_file; + } + + function install_package($args = array()) { + /* + This funciton can go away once my patch has been applied: + http://core.trac.wordpress.org/ticket/17680 + */ + + global $wp_filesystem; + $defaults = array( 'source' => '', 'destination' => '', //Please always pass these + 'clear_destination' => false, 'clear_working' => false, + 'hook_extra' => array()); + + $args = wp_parse_args($args, $defaults); + extract($args); + + @set_time_limit( 300 ); + + if ( empty($source) || empty($destination) ) + return new WP_Error('bad_request', $this->strings['bad_request']); + + $this->skin->feedback('installing_package'); + + $res = apply_filters('upgrader_pre_install', true, $hook_extra); + if ( is_wp_error($res) ) + return $res; + + //Retain the Original source and destinations + $remote_source = $source; + $local_destination = $destination; + + $source_files = array_keys( $wp_filesystem->dirlist($remote_source) ); + $remote_destination = $wp_filesystem->find_folder($local_destination); + + //Locate which directory to copy to the new folder, This is based on the actual folder holding the files. + if ( 1 == count($source_files) && $wp_filesystem->is_dir( trailingslashit($source) . $source_files[0] . '/') ) //Only one folder? Then we want its contents. + $source = trailingslashit($source) . trailingslashit($source_files[0]); + elseif ( count($source_files) == 0 ) + return new WP_Error('bad_package', $this->strings['bad_package']); //There are no files? + //else //Its only a single file, The upgrader will use the foldername of this file as the destination folder. foldername is based on zip filename. + + //Hook ability to change the source file location.. + $source = apply_filters('upgrader_source_selection', $source, $remote_source, $this); + if ( is_wp_error($source) ) + return $source; + + //Has the source location changed? If so, we need a new source_files list. + if ( $source !== $remote_source ) + $source_files = array_keys( $wp_filesystem->dirlist($source) ); + + //Protection against deleting files in any important base directories. + if ( in_array( $destination, array(ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes') ) ) { + $remote_destination = trailingslashit($remote_destination) . trailingslashit(basename($source)); + $destination = trailingslashit($destination) . trailingslashit(basename($source)); + } + + $tempdir = untrailingslashit($remote_destination) . ".tmp-" . time() . "/"; + if ( $wp_filesystem->exists($remote_destination) ) { + if ( $clear_destination ) { + + //Try to rename original theme (also works as a backup) + $moved = @rename($remote_destination, $tempdir); + if ( ! $moved ) + return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']); + + //We're going to clear the destination if theres something there + $this->skin->feedback('remove_old'); + $removed = $wp_filesystem->delete($remote_destination, true); + $removed = apply_filters('upgrader_clear_destination', $removed, $local_destination, $remote_destination, $hook_extra); + + if ( is_wp_error($removed) ) + return $removed; + else if ( ! $removed ) + return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']); + } else { + //If we're not clearing the destination folder and something exists there allready, Bail. + //But first check to see if there are actually any files in the folder. + $_files = $wp_filesystem->dirlist($remote_destination); + if ( ! empty($_files) ) { + $wp_filesystem->delete($remote_source, true); //Clear out the source files. + return new WP_Error('folder_exists', $this->strings['folder_exists'], $remote_destination ); + } + } + } + + //Create destination if needed + if ( !$wp_filesystem->exists($remote_destination) ) + if ( !$wp_filesystem->mkdir($remote_destination, FS_CHMOD_DIR) ) + return new WP_Error('mkdir_failed', $this->strings['mkdir_failed'], $remote_destination); + + // Copy new version of item into place. + $result = copy_dir($source, $remote_destination); + if ( is_wp_error($result) ) { + if ( $clear_working ) + $wp_filesystem->delete($remote_source, true); + return $result; + } + + //Clear the Working folder? + if ( $clear_working ) + $wp_filesystem->delete($remote_source, true); + + $destination_name = basename( str_replace($local_destination, '', $destination) ); + if ( '.' == $destination_name ) + $destination_name = ''; + + $this->result = compact('local_source', 'source', 'source_name', 'source_files', 'destination', 'destination_name', 'local_destination', 'remote_destination', 'clear_destination', 'delete_source_dir'); + + $res = apply_filters('upgrader_post_install', true, $hook_extra, $this->result); + if ( is_wp_error($res) ) { + $this->result = $res; + return $res; + } + + // Remove temporary backup + $removed = $wp_filesystem->delete($tempdir, true); + if( !$removed ) $this->skin->feedback("Could not remove the temporary theme directory."); + + //Bombard the calling function will all the info which we've just used. + return $this->result; + } + +} + +add_action('update-custom_upgrade-github-theme', 'github_theme_updater', 10, 2); +function github_theme_updater(){ + /* + http://core.trac.wordpress.org/browser/trunk/wp-admin/update.php?rev=17632#L145 + changes: + - use customized theme upgrader + */ + if ( ! current_user_can('update_themes') ) + wp_die(__('You do not have sufficient permissions to update themes for this site.')); + + $theme = isset($_REQUEST['theme']) ? urldecode($_REQUEST['theme']) : ''; + check_admin_referer('upgrade-theme_' . $theme); + + add_thickbox(); + wp_enqueue_script('theme-preview'); + $title = __('Update Theme'); + $parent_file = 'themes.php'; + $submenu_file = 'themes.php'; + require_once(ABSPATH . 'wp-admin/admin-header.php'); + + $nonce = 'upgrade-theme_' . $theme; + $url = 'update.php?action=upgrade-theme&theme=' . $theme; + + $upgrader = new Github_Theme_Upgrader( new Theme_Upgrader_Skin( compact('title', 'nonce', 'url', 'theme') ) ); + $upgrader->upgrade($theme); + + include(ABSPATH . 'wp-admin/admin-footer.php'); +} \ No newline at end of file diff --git a/inc/Theme-Updater/readme.markdown b/inc/Theme-Updater/readme.markdown new file mode 100755 index 0000000..e4efc03 --- /dev/null +++ b/inc/Theme-Updater/readme.markdown @@ -0,0 +1,132 @@ +# Wordpress plugin: a theme updater for GitHub-hosted Wordpress themes + +Do you wish that you could somehow get update notifications within WordPress for _custom_ themes that you use for your site? Perhaps a custom theme that you had developed specifically for your site? Or a theme you developed for a client site? And do you wish you could do "automatic updates" to those custom themes just like you can for _public_ themes available from WordPress.org? + +This WordPress plugin lets you host a custom theme in a Github _public_ repository (private repos are not supported) and then notify sites when a new version of the theme is available. Those sites can then perform an auto-update just as with publicly available themes. The plugin also allows you to roll back to a previous version of the theme. + +This plugin works with WordPress in both a standalone and MultiSite mode and has been tested up to WordPress 3.3.x. It can be found in the WordPress plugin directory at: + +* http://wordpress.org/extend/plugins/theme-updater/ + +Bugs, feature requests or other suggestions should be filed as [issues at the plugin's Github repository](https://github.com/UCF/Theme-Updater/issues) + +## Screenshots + +![Screenshot One](https://github.com/UCF/Theme-Updater/raw/master/screenshot-1.png) + +--- + +![Screenshot Two](https://github.com/UCF/Theme-Updater/raw/master/screenshot-2.png) + +--- + +![Screenshot Three](https://github.com/UCF/Theme-Updater/raw/master/screenshot-3.png) + +--- + +## Installation + +[Here](https://github.com/UCF/Theme-Updater-Demo) is a sample theme. [Download (.zip)](https://github.com/UCF/Theme-Updater-Demo/zipball/v1.1.0) + +### 1 - Publish your theme to a public GitHub Repository + +### 2 - Update Your theme's `style.css` + +Add `Github Theme URI` to your `style.css` header, this will be where the plugin looks for updates. I also recommend using [semantic versioning](http://semver.org/) for the version number. (Note that the version number does _not_ need to start with "v" as shown in the examples below. You can simply use a number such as "1.2.0". You just need to be consistent with how you create version numbers.) + +Example header: + + Theme Name: Example + Theme URI: http://example.com/ + Github Theme URI: https://github.com/username/repo + Description: My Example Theme + Author: person + Version: v1.0.0 + +Push these changes back to the project. + +### 3 - Create a new tag and push the change back to the repo + + $ git tag v1.0.0 + $ git push origin v1.0.0 + +Note, your tag numbers and theme version numbers should match. If you want to increment the version number, be sure to update and commit your `style.css` prior to creating the new git tag. + +### 4 - Upload your modified theme to your WordPress site + +Before the plugin can work, your theme with the `Github Theme URI` addition needs to be uploaded to our WordPress site. + +* Create a ZIP file of your theme on your local computer. +* Inside your WordPress admin menu (standalone) or network admin menu (MultiSite) go to the Install Themes panel and click on "Upload". +* Choose your ZIP file and press "Install Now". + +Your theme will now be installed inside of WordPress and can be activated for your site. From this point forward all updates will be installed automatically once the plugin is activated. + +### 5 - Download and install the plugin + +Inside your WordPress admin menu (standalone) or network admin menu (MultiSite) choose "Add New" under the Plugins menu. Search for "Theme Updater" and this will bring you to [the plugin's WordPress page](http://wordpress.org/extend/plugins/theme-updater/) where you can install the plugin directly into your WordPress installation. (Alternatively you can visit that page, download the plugin as a zip file and upload it to your WordPress install, but why go through all that work?) + +With the plugin installed and activated (it must be network activated on multisite installs) on your site and the theme uploaded, the next time you push a new tag to your Github repository, it will be recognized by the plugin and an update notice will appear in your admin menu. + +This is no configuration or settings panel for this plugin. + +--- + +## Updating The Theme + +The process of updating your theme and generating auto-update notifications is now simply this: + +### 1 - Make your changes to the theme and commit those changes to your local git repository. + +### 2 - **IMPORTANT** - Update your `style.css` file with a new version number and commit that change to your local repository. + +### 3 - Push your changes to the Github repository + + $ git push origin master + +### 4 - Create a new tag and push the change back to the repo + + $ git tag v1.1.0 + $ git push origin v1.1.0 + +Note, you should use the **identical** number for the tag that you did for a version number in `style.css` in step #2. + +That's it. Now any sites with your theme installed will receive an update notification the next time their WordPress installation checks for updates. + +--- + +## Code Comments + +The flow of the plugin is: + +### 1 - Get the Theme's Update URI + +Code is a mashup of Wordpress source. I'm looking at: + +* [`get_themes()`](http://core.trac.wordpress.org/browser/trunk/wp-includes/theme.php?rev=17978#L249) +* [`get_theme_data()`](http://core.trac.wordpress.org/browser/trunk/wp-includes/theme.php?rev=17978#L163) + + +### 2 - Get the github tags + +Pull the tags trough the [Repository Refs API](http://develop.github.com/p/repo.html). + +### 3 - Notify Worpress of the Update + +Publish the update details to the `response` array in the `update_themes` transient, similar to how [Wordpress updates themes](http://core.trac.wordpress.org/browser/trunk/wp-includes/update.php?rev=17978#L188). + +## Changelog + +*** v1.3.7 - July 23, 2012 +* URLencode repo and user names +* Handle Github API errors appropriately + +*** v1.3.6 - July 23, 2012 +* Fixed [Incorrect Github Project URL Error](https://github.com/UCF/Theme-Updater/issues/22) + +### v1.3.5 - July 23, 2012 +* [Compabitilty with new Github API](https://github.com/UCF/Theme-Updater/issues/18) +* Updated README to address the following issues: [Installation for MultiSite should mention "Network Activate"](https://github.com/UCF/Theme-Updater/issues/13) and [Docs should mention that there is no configuration or settings panel](https://github.com/UCF/Theme-Updater/issues/15) + +### v1.3.4 - February 8, 2012 +* Fix to [SSL issue](https://github.com/UCF/Theme-Updater/issues/3). Code by Github user bainternet. Added by Github user danyork. diff --git a/inc/Theme-Updater/screenshot-1.png b/inc/Theme-Updater/screenshot-1.png new file mode 100755 index 0000000..8ed560c Binary files /dev/null and b/inc/Theme-Updater/screenshot-1.png differ diff --git a/inc/Theme-Updater/screenshot-2.png b/inc/Theme-Updater/screenshot-2.png new file mode 100755 index 0000000..1f72407 Binary files /dev/null and b/inc/Theme-Updater/screenshot-2.png differ diff --git a/inc/Theme-Updater/screenshot-3.png b/inc/Theme-Updater/screenshot-3.png new file mode 100755 index 0000000..95b5782 Binary files /dev/null and b/inc/Theme-Updater/screenshot-3.png differ diff --git a/inc/Theme-Updater/updater.php b/inc/Theme-Updater/updater.php new file mode 100755 index 0000000..c4f6eb8 --- /dev/null +++ b/inc/Theme-Updater/updater.php @@ -0,0 +1,167 @@ +plugin documentation. +Author: Douglas Beck +Author: UCF Web Communications +Version: 1.3.7 +*/ + +require_once('assets.php'); + +// register the custom stylesheet header +add_action( 'extra_theme_headers', 'github_extra_theme_headers' ); +function github_extra_theme_headers( $headers ) { + $headers['Github Theme URI'] = 'Github Theme URI'; + return $headers; +} + +add_filter('site_transient_update_themes', 'transient_update_themes_filter'); +function transient_update_themes_filter($data){ + global $wp_version; + + $wp_34 = version_compare($wp_version, '3.4', '>='); + + $installed_themes = $wp_34 ? wp_get_themes() : get_themes(); + foreach ( (array) $installed_themes as $theme_title => $_theme ) { + // the WP_Theme object is very different now... + // This whole function should be refactored to not directly + // rely on the $theme variable the way it does + if($wp_34) { + if(!$_theme->get('Github Theme URI')) { + continue; + } else { + $theme = array( + 'Github Theme URI' => $_theme->get('Github Theme URI'), + 'Stylesheet' => $_theme->stylesheet, + 'Version' => $_theme->version + ); + } + } else { + // get the Github URI header, skip if not set + $theme = $_theme; + if(isset($theme['Stylesheet Files'][0]) && is_readable($theme['Stylesheet Files'][0])){ + $stylesheet = $theme['Stylesheet Dir'] . '/style.css'; + + $theme_data = get_theme_data($stylesheet); + if(empty($theme_data['Github Theme URI'])){ + continue; + } else { + $theme['Github Theme URI'] = $theme_data['Github Theme URI']; + } + }; + } + + $theme_key = $theme['Stylesheet']; + + // Add Github Theme Updater to return $data and hook into admin + remove_action( "after_theme_row_" . $theme['Stylesheet'], 'wp_theme_update_row'); + add_action( "after_theme_row_" . $theme['Stylesheet'], 'github_theme_update_row', 11, 2 ); + + // Grab Github Tags + preg_match( + '/http(s)?:\/\/github.com\/(?[\w-]+)\/(?[\w-]+)$/', + $theme['Github Theme URI'], + $matches); + if(!isset($matches['username']) or !isset($matches['repo'])){ + $data->response[$theme_key]['error'] = 'Incorrect github project url. Format should be (no trailing slash): https://github.com/<username>/<repo>'; + continue; + } + $url = sprintf('https://api.github.com/repos/%s/%s/tags', urlencode($matches['username']), urlencode($matches['repo'])); + + $response = get_transient(md5($url)); // Note: WP transients fail if key is long than 45 characters + if(empty($response)){ + $raw_response = wp_remote_get($url, array('sslverify' => false, 'timeout' => 10)); + if ( is_wp_error( $raw_response ) ){ + $data->response[$theme_key]['error'] = "Error response from " . $url; + continue; + } + $response = json_decode($raw_response['body']); + + if(isset($response->message)){ + if(is_array($response->message)){ + $errors = ''; + foreach ( $response->message as $error) { + $errors .= ' ' . $error; + } + } else { + $errors = print_r($response->message, true); + } + $data->response[$theme_key]['error'] = sprintf('While fetching tags api error: %s', $url, $errors); + continue; + } + + if(count($response) == 0){ + $data->response[$theme_key]['error'] = "Github theme does not have any tags"; + continue; + } + + //set cache, just 60 seconds + set_transient(md5($url), $response, 30); + } + + // Sort and get latest tag + $tags = array_map(create_function('$t', 'return $t->name;'), $response); + usort($tags, "version_compare"); + + + // check for rollback + if(isset($_GET['rollback'])){ + $data->response[$theme_key]['package'] = + $theme['Github Theme URI'] . '/zipball/' . urlencode($_GET['rollback']); + continue; + } + + + // check and generate download link + $newest_tag = array_pop($tags); + if(version_compare($theme['Version'], $newest_tag, '>=')){ + // up-to-date! + $data->up_to_date[$theme_key]['rollback'] = $tags; + continue; + } + + + // new update available, add to $data + $download_link = $theme['Github Theme URI'] . '/zipball/' . $newest_tag; + $update = array(); + $update['new_version'] = $newest_tag; + $update['url'] = $theme['Github Theme URI']; + $update['package'] = $download_link; + $data->response[$theme_key] = $update; + + } + + return $data; +} + + +add_filter('upgrader_source_selection', 'upgrader_source_selection_filter', 10, 3); +function upgrader_source_selection_filter($source, $remote_source=NULL, $upgrader=NULL){ + /* + Github delivers zip files as --.zip + must rename this zip file to the accurate theme folder + */ + if(isset($source, $remote_source, $upgrader->skin->theme)){ + $corrected_source = $remote_source . '/' . $upgrader->skin->theme . '/'; + if(@rename($source, $corrected_source)){ + return $corrected_source; + } else { + $upgrader->skin->feedback("Unable to rename downloaded theme."); + return new WP_Error(); + } + } + return $source; +} + +/* + Function to address the issue that users in a standalone WordPress installation + were receiving SSL errors and were unable to install themes. + https://github.com/UCF/Theme-Updater/issues/3 +*/ +add_action('http_request_args', 'no_ssl_http_request_args', 10, 2); +function no_ssl_http_request_args($args, $url) { + $args['sslverify'] = false; + return $args; +} diff --git a/inc/licence.php b/inc/licence.php new file mode 100644 index 0000000..d685517 --- /dev/null +++ b/inc/licence.php @@ -0,0 +1,118 @@ + $_POST['licence-email'], + 'licence-name' => $_POST['licence-name'], + 'licence-key' => $_POST['licence-key'] + ); + + //url-ify the data for the POST + foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } + rtrim($fields_string, '&'); + + //open connection + $ch = curl_init(); + + //set the url, number of POST vars, POST data + curl_setopt($ch,CURLOPT_URL, $url); + curl_setopt($ch,CURLOPT_POST, count($fields)); + curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); + + + //execute post + + $result = json_decode(curl_exec($ch)); + + if ($result->status == 1) { + add_option('licence_' . $themename, 1); + } + + wp_redirect(admin_url('/themes.php?page=options-framework', 'http'), 301); + + + //close connection + curl_close($ch); + + } + + }else{ + $enter_licence = false; + } + + ?> + +
+ + + + + + + + + + +
+ + +

+ + + + + + + + + + + + + + +
+ +
+ +
+ +

+ +

+ +
+ + +
+ \ No newline at end of file diff --git a/inc/options-framework/css/color-picker.min.css b/inc/options-framework/css/color-picker.min.css new file mode 100755 index 0000000..337f2ed --- /dev/null +++ b/inc/options-framework/css/color-picker.min.css @@ -0,0 +1 @@ +.wp-color-picker{width:80px}.wp-picker-container .hidden{display:none}.wp-color-result{background-color:#f9f9f9;border:1px solid #bbb;border-radius:2px;cursor:pointer;display:inline-block;height:22px;margin:0 6px 6px 0;position:relative;top:1px;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;vertical-align:bottom;display:inline-block;padding-left:30px}.wp-color-result:after{background:#f3f3f3;background-image:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));background-image:-webkit-linear-gradient(top,#fefefe,#f4f4f4);background-image:-moz-linear-gradient(top,#fefefe,#f4f4f4);background-image:-o-linear-gradient(top,#fefefe,#f4f4f4);background-image:linear-gradient(to bottom,#fefefe,#f4f4f4);color:#333;text-shadow:0 1px 0 #fff;border-radius:0 1px 1px 0;border-left:1px solid #bbb;content:attr(title);display:block;font-size:11px;line-height:22px;padding:0 6px;position:relative;right:0;text-align:center;top:0}.wp-color-result:hover{border-color:#aaa;box-shadow:0 1px 1px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,0.1);-ms-box-shadow:0 1px 1px rgba(0,0,0,0.1);-o-box-shadow:0 1px 1px rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.1)}.wp-color-result:hover:after{color:#222;border-color:#aaa;border-left:1px solid #999}.wp-color-result.wp-picker-open{top:0}.wp-color-result.wp-picker-open:after{content:attr(data-current)}.wp-picker-container,.wp-picker-container:active{display:inline-block;outline:0}.wp-color-result:focus{border-color:#888;-moz-box-shadow:0 1px 2px rgba(0,0,0,0.2);-ms-box-shadow:0 1px 2px rgba(0,0,0,0.2);-o-box-shadow:0 1px 2px rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.2);box-shadow:0 1px 2px rgba(0,0,0,0.2)}.wp-color-result:focus:after{border-color:#888}.wp-picker-open+.wp-picker-input-wrap{display:inline-block;vertical-align:top}.wp-picker-container .button{margin-left:6px}.wp-picker-container .iris-square-slider .ui-slider-handle:focus{background-color:#555}.wp-picker-container .iris-picker{border-color:#dfdfdf;margin-top:6px}input[type="text"].iris-error{background-color:#ffebe8;border-color:#c00;color:#000} \ No newline at end of file diff --git a/inc/options-framework/css/optionsframework.css b/inc/options-framework/css/optionsframework.css new file mode 100755 index 0000000..38fa723 --- /dev/null +++ b/inc/options-framework/css/optionsframework.css @@ -0,0 +1,239 @@ +/* Options Framework Admin Styles */ + +.updated { + max-width:764px; + margin-bottom:0px !important; +} +#optionsframework { + position:relative; + z-index: 0; + max-width:780px; + background:#fff; +} +#optionsframework h3 { + cursor: default; +} +#optionsframework p { + margin-bottom:0; + padding-bottom:10px; + line-height: 1.4em; +} +#optionsframework .section { + padding:10px 10px 0; +} +#optionsframework .group { + padding-bottom:40px; +} +#optionsframework .section .heading { + padding:10px 0px; + margin:0 0 15px; + border-bottom: 1px solid #dfdfdf; +} +#optionsframework .section .controls { + float: left; + min-width:350px; + width: 54%; + padding-right:2%; +} +#optionsframework .section .explain { + max-width:38%; + float: left; + font-size: 12px; + line-height:16px; + color: #777; +} +#optionsframework .section-checkbox .controls { + width: 98%; +} +#optionsframework .section-checkbox .explain { + max-width:94%; +} +#optionsframework .of-input { + width:100%; +} +#optionsframework .controls select, #optionsframework .controls textarea { + margin-bottom:10px; + width:100%; +} +#optionsframework .section-radio label, #optionsframework .section-multicheck label { + float:left; + max-width:90%; + line-height: 16px; + margin-bottom: 5px; +} +#optionsframework input.checkbox, #optionsframework input.of-radio { + width: 30px; + margin-top:2px; + float:left; + clear:both; +} +#optionsframework .section-typography .controls { + float:none; + width:auto; +} +#optionsframework .section-typography .explain { + float:none; + width:auto; +} +#optionsframework .controls .of-typography-size { + width:80px; + float:left +} +#optionsframework .controls .of-typography-unit { + width:50px; + margin-left:5px; + float:left +} +#optionsframework .controls .of-typography-face { + width:100px; + margin-left:5px; + float:left +} +#optionsframework .controls .of-typography-style { + width:80px; + margin-left:5px; + margin-right:5px; + float:left +} +#optionsframework .of-background-properties { + clear:both; + margin-top: 18px; +} +#optionsframework .controls .of-background-repeat { + width:125px; + margin-right:5px; + float:left +} +#optionsframework .controls .of-background-position { + width:125px; + margin-right:5px; + float:left +} +#optionsframework .controls .of-background-attachment { + width:125px; + margin-right:5px; + float:left +} +#optionsframework .section-background .wp-picker-container { + margin-bottom:10px; +} +#optionsframework .controls .of-radio-img-img { + border:3px solid #f9f9f9; + margin:0 5px 10px 0; + display:none; + cursor:pointer; + float:left; +} +#optionsframework .controls .of-radio-img-selected { + border:3px solid #ccc +} +#optionsframework .controls .of-radio-img-img:hover { + opacity:.8; +} +#optionsframework .controls .of-border-width { + width:80px; + float:left +} +#optionsframework .controls .of-border-style { + width:120px; + float:left +} +#optionsframework .hide { + display:none; +} +#optionsframework .of-option-image { + max-width:340px; + margin:3px 0 18px 0; +} +#optionsframework .mini .controls select, #optionsframework .section .mini .controls { + width: 140px; +} +#optionsframework .mini .controls input, #optionsframework .mini .controls { + min-width:140px; + width: 140px; +} +#optionsframework .mini .explain { + max-width:74%; +} + +/* Editor */ + +#optionsframework .section-editor .explain { + max-width: 98%; + float:none; + margin-bottom:5px; +} + +/* Image Uploader */ + +#optionsframework .controls input.upload { + width:80%; +} +#optionsframework .controls input.upload_button { + float:right; + border-color:#BBBBBB; + cursor:pointer; +} +#optionsframework .controls input.upload_button:hover { + border-color:#666666; + color:#000; +} +#optionsframework .screenshot { + float:left; + margin-left:1px; + position:relative; + width:344px; + margin-top:3px; +} +#optionsframework .screenshot img { + background:#FAFAFA; + border-color:#ccc #eee #eee #ccc; + border-style:solid; + border-width:1px; + float:left; + max-width:334px; + padding:4px; + margin-bottom:10px; +} +#optionsframework .screenshot .remove-image { + background:url("../images/ico-delete.png") no-repeat; + border:medium none; + bottom:4px; + display:block; + float:left; + height:16px; + padding:0; + position:absolute; + left:-4px; + text-indent:-9999px; + width:16px; +} +#optionsframework .screenshot .no_image .file_link { + margin-left: 20px; +} +#optionsframework .screenshot .no_image .remove-button { + bottom: 0px; +} +#optionsframework .reset-button { + float:left; + cursor:pointer; +} + +/* Bottom Section */ + +#optionsframework-submit { + padding: 7px 10px; + border-top: 1px solid #ECECEC; + background-color: #F1F1F1; + background-image: -moz-linear-gradient(center top , #F9F9F9, #ECECEC); +} +#optionsframework .button-primary { + float:right; +} +#optionsframework .section:after { + content: ""; + display: table; +} +#optionsframework .section:after { + clear: both; +} \ No newline at end of file diff --git a/inc/options-framework/images/ico-delete.png b/inc/options-framework/images/ico-delete.png new file mode 100755 index 0000000..08f2493 Binary files /dev/null and b/inc/options-framework/images/ico-delete.png differ diff --git a/inc/options-framework/js/color-picker.min.js b/inc/options-framework/js/color-picker.min.js new file mode 100755 index 0000000..75b6ede --- /dev/null +++ b/inc/options-framework/js/color-picker.min.js @@ -0,0 +1 @@ +(function(f,e){var a='',c='
',b='
',g='';var d={options:{defaultColor:false,change:false,clear:false,hide:true,palettes:true},_create:function(){if(f.browser.msie&&parseInt(f.browser.version,10)<8){return}var h=this;var i=h.element;f.extend(h.options,i.data());h.initialValue=i.val();i.addClass("wp-color-picker").hide().wrap(b);h.wrap=i.parent();h.toggler=f(a).insertBefore(i).css({backgroundColor:h.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current);h.pickerContainer=f(c).insertAfter(i);h.button=f(g);if(h.options.defaultColor){h.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString)}else{h.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear)}i.wrap('').after(h.button);i.iris({target:h.pickerContainer,hide:true,width:255,mode:"hsv",palettes:h.options.palettes,change:function(j,k){h.toggler.css({backgroundColor:k.color.toString()});if(f.isFunction(h.options.change)){h.options.change.call(this,j,k)}}});i.val(h.initialValue);h._addListeners();if(!h.options.hide){h.toggler.click()}},_addListeners:function(){var h=this;h.toggler.click(function(i){i.stopPropagation();h.element.toggle().iris("toggle");h.button.toggleClass("hidden");h.toggler.toggleClass("wp-picker-open");if(h.toggler.hasClass("wp-picker-open")){f("body").on("click",{wrap:h.wrap,toggler:h.toggler},h._bodyListener)}else{f("body").off("click",h._bodyListener)}});h.element.change(function(j){var i=f(this),k=i.val();if(k===""||k==="#"){h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}});h.toggler.on("keyup",function(i){if(i.keyCode===13||i.keyCode===32){i.preventDefault();h.toggler.trigger("click").next().focus()}});h.button.click(function(j){var i=f(this);if(i.hasClass("wp-picker-clear")){h.element.val("");h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}else{if(i.hasClass("wp-picker-default")){h.element.val(h.options.defaultColor).change()}}})},_bodyListener:function(h){if(!h.data.wrap.find(h.target).length){h.data.toggler.click()}},color:function(h){if(h===e){return this.element.iris("option","color")}this.element.iris("option","color",h)},defaultColor:function(h){if(h===e){return this.options.defaultColor}this.options.defaultColor=h}};f.widget("wp.wpColorPicker",d)}(jQuery)); \ No newline at end of file diff --git a/inc/options-framework/js/iris.min.js b/inc/options-framework/js/iris.min.js new file mode 100755 index 0000000..a8043b5 --- /dev/null +++ b/inc/options-framework/js/iris.min.js @@ -0,0 +1,4 @@ +/*! Iris - v0.9.14 - 2012-11-20 +* https://github.com/Automattic/Iris +* Copyright (c) 2012 Matt Wiebe; Licensed GPL */ +(function(e,t){function u(){if(r)i="filter";else{var t=e('
'),n="linear-gradient(top,#fff,#000)";e.each(s,function(e,r){t.css("backgroundImage",r+n);if(t.css("backgroundImage").match("gradient"))return i=e,!1}),e.browser.webkit&&i===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css("backgroundImage").match("gradient")&&(i="webkit")),t.remove()}}function a(t,n){return t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1),i==="webkit"?l(t,n):s[i]+"linear-gradient("+t+", "+n.join(", ")+")"}function f(t,n){t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1);var r=t==="top"?0:1,i=e(this),s=n.length-1,o=parseInt(e.browser.version,10)>=8?"-ms-filter":"filter";o="filter";var u=r===1?"left":"top",a=r===1?"right":"bottom",f=r===1?"height":"width",l='
',h="";i.css("position")==="static"&&i.css({position:"relative"}),n=c(n),e.each(n,function(e,t){if(e===s)return!1;var i=n[e+1];if(t.stop===i.stop)return;var o=100-parseFloat(i.stop)+"%";t.octoHex=(new Color(t.color)).toIEOctoHex(),i.octoHex=(new Color(i.color)).toIEOctoHex();var u="progid:DXImageTransform.Microsoft.Gradient(GradientType="+r+", StartColorStr='"+t.octoHex+"', EndColorStr='"+i.octoHex+"')";h+=l.replace("%start%",t.stop).replace("%end%",o).replace("%filter%",u)}),i.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(i)}function l(t,n){var r=[];return t=t==="top"?"0% 0%,0% 100%,":"0% 100%,100% 100%,",n=c(n),e.each(n,function(e,t){r.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+r.join(",")+")"}function c(t){var n=[],r=[],i=[],s=t.length-1;return e.each(t,function(e,t){var i=t,s=!1,o=t.match(/1?[0-9]{1,2}%$/);o&&(i=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=o.shift()),n.push(i),r.push(s)}),r[0]===!1&&(r[0]="0%"),r[s]===!1&&(r[s]="100%"),r=h(r),e.each(r,function(e){i[e]={color:n[e],stop:r[e]}}),i}function h(t){var n=0,r=t.length-1,i=0,s=!1,o,u,a,f;if(t.length<=2||e.inArray(!1,t)<0)return t;while(i"),n=e("
"),r=e.isArray(this.options.palettes)?this.options.palettes:this._palettes;e.each(r,function(e,r){n.clone().data("color",r).css("backgroundColor",r).appendTo(t).height(10).width(10)}),this.picker.append(t)},_paint:function(){var e=this;e._paintDimension("top","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var n=this,r=n.color,i=n.options.mode,s=n._getHSpaceColor(),o=n.controls[t],u=n.options.controls,a;if(t===n.active||n.active==="square"&&t!=="strip")return;switch(u[t]){case"h":if(i==="hsv"){s=r.clone();switch(t){case"horiz":s[u.vert](100);break;case"vert":s[u.horiz](100);break;case"strip":s.setHSpace("hsl")}a=s.toHsl()}else t==="strip"?a={s:s.s,l:s.l}:a={s:100,l:s.l};o.raninbowGradient(e,a);break;case"s":i==="hsv"?t==="vert"?a=[r.clone().a(0).s(0).toCSS("rgba"),r.clone().a(1).s(0).toCSS("rgba")]:t==="strip"?a=[r.clone().s(100).toCSS("hsl"),r.clone().s(0).toCSS("hsl")]:t==="horiz"&&(a=["#fff","hsl("+s.h+",100%,50%)"]):t==="vert"&&n.options.controls.horiz==="h"?a=["hsla(0, 0%, "+s.l+"%, 0)","hsla(0, 0%, "+s.l+"%, 1)"]:a=["hsl("+s.h+",0%,50%)","hsl("+s.h+",100%,50%)"],o.gradient(e,a);break;case"l":t==="strip"?a=["hsl("+s.h+",100%,100%)","hsl("+s.h+", "+s.s+"%,50%)","hsl("+s.h+",100%,0%)"]:a=["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],o.gradient(e,a);break;case"v":t==="strip"?a=[r.clone().v(100).toCSS(),r.clone().v(0).toCSS()]:a=["rgba(0,0,0,0)","#000"],o.gradient(e,a);break;default:}},_getHSpaceColor:function(){return this.options.mode==="hsv"?this.color.toHsv():this.color.toHsl()},_dimensions:function(t){var n=this,r=n.options,i=n.picker.find(".iris-picker-inner"),s=n.controls,o=s.square,u=n.picker.find(".iris-strip"),a="77.5%",f="12%",l=20,c=r.border?r.width-l:r.width,h,p=e.isArray(r.palettes)?r.palettes.length:n._palettes.length,d,v,m;t&&(o.css("width",""),u.css("width",""),n.picker.removeAttr("style")),a=c*(parseFloat(a)/100),f=c*(parseFloat(f)/100),h=r.border?a+l:a,o.width(a).height(a),u.height(a).width(f),n.picker.css({width:r.width,height:h});if(!r.palettes)return;d=a*2/100,m=a-(p-1)*d,v=m/p,n.picker.find(".iris-palette").each(function(t,n){var r=t===0?0:d;e(this).css({width:v,height:v,marginLeft:r})}),n.picker.css("paddingBottom",v+d),u.height(v+d+a)},_addInputListeners:function(e){var t=this,n=100,r=function(n){var r=new Color(e.val()),i=e.val().replace(/^#/,"");e.removeClass("iris-error"),r.error?i!==""&&e.addClass("iris-error"):r.toString()!==t.color.toString()&&(n.type!=="keyup"||!i.match(/^[0-9a-fA-F]{3}$/))&&t._setOption("color",r.toString())};e.on("change",r).on("keyup",t._debounce(r,n))},_initControls:function(){var t=this,n=t.controls,r=n.square,i=t.options.controls,s=t._scale[i.strip];n.stripSlider.slider({orientation:"vertical",max:s,slide:function(e,n){t.active="strip",i.strip==="h"&&(n.value=s-n.value),t.color[i.strip](n.value),t._change.apply(t,arguments)}}),n.squareDrag.draggable({containment:"parent",zIndex:1e3,cursor:"move",drag:function(e,n){t._squareDrag(e,n)},start:function(){r.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){r.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(n){n.preventDefault();var r="ui-state-focus";n.type==="mousedown"?(t.picker.find("."+r).removeClass(r).blur(),e(this).addClass(r).focus()):e(this).removeClass(r)}).on("keydown",function(e){var r=n.square,i=n.squareDrag,s=i.position(),o=t.options.width/100;e.altKey&&(o*=10);switch(e.keyCode){case 37:s.left-=o;break;case 38:s.top-=o;break;case 39:s.left+=o;break;case 40:s.top+=o;break;default:return!0}s.left=Math.max(0,Math.min(s.left,r.width())),s.top=Math.max(0,Math.min(s.top,r.height())),i.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),r.mousedown(function(n){if(n.which!==1)return;if(!e(n.target).is("div"))return;var r=t.controls.square.offset(),i={top:n.pageY-r.top,left:n.pageX-r.left};n.preventDefault(),t._squareDrag(n,{position:i}),n.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(i).trigger(n)}),t.options.palettes&&t.picker.find(".iris-palette-container").on("click",".iris-palette",function(n){t.color.fromCSS(e(this).data("color")),t.active="external",t._change()}).on("keydown",".iris-palette",function(t){if(t.keyCode!==13&&t.keyCode!==32)return!0;t.stopPropagation(),e(this).click()})},_squareDrag:function(e,t){var n=this,r=n.options.controls,i=n._squareDimensions(),s=Math.round((i.h-t.position.top)/i.h*n._scale[r.vert]),o=n._scale[r.horiz]-Math.round((i.w-t.position.left)/i.w*n._scale[r.horiz]);n.color[r.horiz](o)[r.vert](s),n.active="square",n._change.apply(n,arguments)},_setOption:function(e,t){var n=this.options[e];if(e==="color"){t=""+t;var r=t.replace(/^#/,""),i=(new Color(t)).setHSpace(this.options.mode);i.error||(this.color=i,this.options.color=this.options[e]=this.color.toString(),this.active="external",this._change())}},_squareDimensions:function(e){var n=this.controls.square,r,i;return e!==t&&n.data("dimensions")?n.data("dimensions"):(i=this.controls.squareDrag,r={w:n.width(),h:n.height()},n.data("dimensions",r),r)},_isNonHueControl:function(e,t){return e==="square"&&this.options.controls.strip==="h"?!0:t==="external"||t==="h"&&e==="strip"?!1:!0},_change:function(t,n){var r=this,i=r.controls,s=r._getHSpaceColor(),o=r.color.toString(),u=["square","strip"],a=r.options.controls,f=a[r.active]||"external",l=r.hue;r.active==="strip"?u=[]:r.active!=="external"&&u.pop(),e.each(u,function(e,t){var n;if(t!==r.active)switch(t){case"strip":n=a.strip==="h"?r._scale[a.strip]-s[a.strip]:s[a.strip],i.stripSlider.slider("value",n);break;case"square":var o=r._squareDimensions(),u={left:s[a.horiz]/r._scale[a.horiz]*o.w,top:o.h-s[a.vert]/r._scale[a.vert]*o.h};r.controls.squareDrag.css(u)}}),s.h!==l&&r._isNonHueControl(r.active,f)&&r.color.h(l),r.hue=r.color.h(),r.options.color=r.color.toString(),r._inited&&r._trigger("change",{type:r.active},{color:r.color}),r.element.is(":input")&&!r.color.error&&(r.element.removeClass("iris-error"),r.element.val()!==r.color.toString()&&r.element.val(r.color.toString())),r._paint(),r._inited=!0,r.active=!1},_debounce:function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},show:function(){this.picker.show()},hide:function(){this.picker.hide()},toggle:function(){this.picker.toggle()}};e.widget("a8c.iris",p),e('").appendTo("head")})(jQuery),function(e,t){var n=function(e,t){return this instanceof n?this._init(e,t):new n(e,t)};n.fn=n.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var n="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),n=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":n,this[n](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){var e=new n(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"];for(var r=t.length-1;r>=0;r--)e[t[r]]=this[t[r]];return e},setHSpace:function(e){return this._hSpace=e==="hsv"?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,n,r=/^(rgb|hs(l|v))a?\(/;this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,"");if(e.match(r)&&e.match(/\)$/)){n=e.replace(/(\s|%)/g,"").replace(r,"").replace(/,?\);?$/,"").split(",");if(n.length<3)return this._error();if(n.length===4){this.a(parseFloat(n.pop()));if(this.error)return this}for(var i=n.length-1;i>=0;i--){n[i]=parseInt(n[i],10);if(isNaN(n[i]))return this._error()}return e.match(/^rgb/)?this.fromRgb({r:n[0],g:n[1],b:n[2]}):e.match(/^hsv/)?this.fromHsv({h:n[0],s:n[1],v:n[2]}):this.fromHsl({h:n[0],s:n[1],l:n[2]})}return this.fromHex(e)},fromRgb:function(e,n){return typeof e!="object"||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),n))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var n,r,i,s,o,u,a,f;return typeof e!="object"||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",u=e.h/360,a=e.s/100,f=e.l/100,a===0?n=r=i=f:(s=f<.5?f*(1+a):f+a-f*a,o=2*f-s,n=this.hue2rgb(o,s,u+1/3),r=this.hue2rgb(o,s,u),i=this.hue2rgb(o,s,u-1/3)),this.fromRgb({r:n*255,g:r*255,b:i*255},!0))},fromHsv:function(e){var n,r,i,s,o,u,a,f,l,c,h;if(typeof e!="object"||e.h===t||e.s===t||e.v===t)return this._error();this._hsv=e,this._hSpace="hsv",n=e.h/360,r=e.s/100,i=e.v/100,a=Math.floor(n*6),f=n*6-a,l=i*(1-r),c=i*(1-f*r),h=i*(1-(1-f)*r);switch(a%6){case 0:s=i,o=h,u=l;break;case 1:s=c,o=i,u=l;break;case 2:s=l,o=i,u=h;break;case 3:s=l,o=c,u=i;break;case 4:s=h,o=l,u=i;break;case 5:s=i,o=l,u=c}return this.fromRgb({r:s*255,g:o*255,b:u*255},!0)},fromInt:function(e,n){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),n===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},toString:function(){var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e},toCSS:function(e,t){e=e||"hex",t=parseFloat(t||this._alpha);switch(e){case"rgb":case"rgba":var n=this.toRgb();return t<1?"rgba( "+n.r+", "+n.g+", "+n.b+", "+t+" )":"rgb( "+n.r+", "+n.g+", "+n.b+" )";case"hsl":case"hsla":var r=this.toHsl();return t<1?"hsla( "+r.h+", "+r.s+"%, "+r.l+"%, "+t+" )":"hsl( "+r.h+", "+r.s+"%, "+r.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),s=Math.min(t,n,r),o,u,a=(i+s)/2;if(i===s)o=u=0;else{var f=i-s;u=a>.5?f/(2-i-s):f/(i+s);switch(i){case t:o=(n-r)/f+(nr?(t+.05)/(r+.05):(r+.05)/(t+.05)}throw"getDistanceLuminosityFrom requires a Color object"},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new n(t)},getGrayscaleContrastingColor:function(e){if(!e)return this.getMaxContrastColor();var t=e<5?5:e,n=this.getMaxContrastColor();e=n.getDistanceLuminosityFrom(this);if(e<=t)return n;var r=0===n.toInt()?1:-1;while(e>t)n=n.incrementLightness(r),e=n.getDistanceLuminosityFrom(this);return n},getReadableContrastingColor:function(e,r){if(!e instanceof n)return this;var i=r===t?5:r,s=e.getDistanceLuminosityFrom(this),o=e.getMaxContrastColor(),u=o.getDistanceLuminosityFrom(e);if(u<=i)return o;if(s>=i)return this;var a=0===o.toInt()?-1:1;while(sn.range[1]?n.range[1]:r),s[e]=r,this._spaceFunc("from",n.space,s))}},_spaceFunc:function(e,t,n){var r=t||this._hSpace,i=e+r.charAt(0).toUpperCase()+r.substr(1);return this[i](n)}};var r={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var i in r)r.hasOwnProperty(i)&&(n.fn[i]=n.fn._partial(i));e.Color=n}(typeof exports=="object"&&exports||this); \ No newline at end of file diff --git a/inc/options-framework/js/media-uploader.js b/inc/options-framework/js/media-uploader.js new file mode 100755 index 0000000..3112d27 --- /dev/null +++ b/inc/options-framework/js/media-uploader.js @@ -0,0 +1,79 @@ +jQuery(document).ready(function($){ + + var optionsframework_upload; + var optionsframework_selector; + + function optionsframework_add_file(event, selector) { + + var upload = $(".uploaded-file"), frame; + var $el = $(this); + optionsframework_selector = selector; + + event.preventDefault(); + + // If the media frame already exists, reopen it. + if ( optionsframework_upload ) { + optionsframework_upload.open(); + } else { + // Create the media frame. + optionsframework_upload = wp.media.frames.optionsframework_upload = wp.media({ + // Set the title of the modal. + title: $el.data('choose'), + + // Customize the submit button. + button: { + // Set the text of the button. + text: $el.data('update'), + // Tell the button not to close the modal, since we're + // going to refresh the page when the image is selected. + close: false + } + }); + + // When an image is selected, run a callback. + optionsframework_upload.on( 'select', function() { + // Grab the selected attachment. + var attachment = optionsframework_upload.state().get('selection').first(); + optionsframework_upload.close(); + optionsframework_selector.find('.upload').val(attachment.attributes.url); + if ( attachment.attributes.type == 'image' ) { + optionsframework_selector.find('.screenshot').empty().hide().append('Remove').slideDown('fast'); + } + optionsframework_selector.find('.upload-button').unbind().addClass('remove-file').removeClass('upload-button').val(optionsframework_l10n.remove); + optionsframework_selector.find('.of-background-properties').slideDown(); + optionsframework_selector.find('.remove-image, .remove-file').on('click', function() { + optionsframework_remove_file( $(this).parents('.section') ); + }); + }); + + } + + // Finally, open the modal. + optionsframework_upload.open(); + } + + function optionsframework_remove_file(selector) { + selector.find('.remove-image').hide(); + selector.find('.upload').val(''); + selector.find('.of-background-properties').hide(); + selector.find('.screenshot').slideUp(); + selector.find('.remove-file').unbind().addClass('upload-button').removeClass('remove-file').val(optionsframework_l10n.upload); + // We don't display the upload button if .upload-notice is present + // This means the user doesn't have the WordPress 3.5 Media Library Support + if ( $('.section-upload .upload-notice').length > 0 ) { + $('.upload-button').remove(); + } + selector.find('.upload-button').on('click', function(event) { + optionsframework_add_file(event, $(this).parents('.section')); + }); + } + + $('.remove-image, .remove-file').on('click', function() { + optionsframework_remove_file( $(this).parents('.section') ); + }); + + $('.upload-button').click( function( event ) { + optionsframework_add_file(event, $(this).parents('.section')); + }); + +}); \ No newline at end of file diff --git a/inc/options-framework/js/options-custom.js b/inc/options-framework/js/options-custom.js new file mode 100755 index 0000000..1a8f6c7 --- /dev/null +++ b/inc/options-framework/js/options-custom.js @@ -0,0 +1,91 @@ +/** + * Prints out the inline javascript needed for the colorpicker and choosing + * the tabs in the panel. + */ + +jQuery(document).ready(function($) { + + // Fade out the save message + $('.fade').delay(1000).fadeOut(1000); + + $('.of-color').wpColorPicker(); + + // Switches option sections + $('.group').hide(); + var active_tab = ''; + if (typeof(localStorage) != 'undefined' ) { + active_tab = localStorage.getItem("active_tab"); + } + if (active_tab != '' && $(active_tab).length ) { + $(active_tab).fadeIn(); + } else { + $('.group:first').fadeIn(); + } + $('.group .collapsed').each(function(){ + $(this).find('input:checked').parent().parent().parent().nextAll().each( + function(){ + if ($(this).hasClass('last')) { + $(this).removeClass('hidden'); + return false; + } + $(this).filter('.hidden').removeClass('hidden'); + }); + }); + if (active_tab != '' && $(active_tab + '-tab').length ) { + $(active_tab + '-tab').addClass('nav-tab-active'); + } + else { + $('.nav-tab-wrapper a:first').addClass('nav-tab-active'); + } + + $('.nav-tab-wrapper a').click(function(evt) { + $('.nav-tab-wrapper a').removeClass('nav-tab-active'); + $(this).addClass('nav-tab-active').blur(); + var clicked_group = $(this).attr('href'); + if (typeof(localStorage) != 'undefined' ) { + localStorage.setItem("active_tab", $(this).attr('href')); + } + $('.group').hide(); + $(clicked_group).fadeIn(); + evt.preventDefault(); + + // Editor Height (needs improvement) + $('.wp-editor-wrap').each(function() { + var editor_iframe = $(this).find('iframe'); + if ( editor_iframe.height() < 30 ) { + editor_iframe.css({'height':'auto'}); + } + }); + + }); + + $('.group .collapsed input:checkbox').click(unhideHidden); + + function unhideHidden(){ + if ($(this).attr('checked')) { + $(this).parent().parent().parent().nextAll().removeClass('hidden'); + } + else { + $(this).parent().parent().parent().nextAll().each( + function(){ + if ($(this).filter('.last').length) { + $(this).addClass('hidden'); + return false; + } + $(this).addClass('hidden'); + }); + + } + } + + // Image Options + $('.of-radio-img-img').click(function(){ + $(this).parent().parent().find('.of-radio-img-img').removeClass('of-radio-img-selected'); + $(this).addClass('of-radio-img-selected'); + }); + + $('.of-radio-img-label').hide(); + $('.of-radio-img-img').show(); + $('.of-radio-img-radio').hide(); + +}); \ No newline at end of file diff --git a/inc/options-framework/lang/options-framework-hu_HU.po b/inc/options-framework/lang/options-framework-hu_HU.po new file mode 100755 index 0000000..0924e10 --- /dev/null +++ b/inc/options-framework/lang/options-framework-hu_HU.po @@ -0,0 +1,135 @@ +# Translation of Options Framework in Hungarian +# This file is distributed under the same license as the Options Framework package. +msgid "" +msgstr "" +"PO-Revision-Date: 2012-06-17 03:04:08+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/0.1\n" +"Project-Id-Version: Options Framework\n" + +#: options-sanitize.php:233 +msgid "Repeat Horizontally" +msgstr "Vízszintes ismétlődés" + +#: options-sanitize.php:234 +msgid "Repeat Vertically" +msgstr "Függőleges ismétlődés" + +#: options-sanitize.php:235 +msgid "Repeat All" +msgstr "Mindegyik ismétlődjön" + +#: options-sanitize.php:248 +msgid "Top Left" +msgstr "Bal felső" + +#: options-sanitize.php:249 +msgid "Top Center" +msgstr "Középen fent" + +#: options-sanitize.php:250 +msgid "Top Right" +msgstr "Jobb felső" + +#: options-sanitize.php:251 +msgid "Middle Left" +msgstr "Közép bal" + +#: options-sanitize.php:252 +msgid "Middle Center" +msgstr "Közép középen" + +#: options-sanitize.php:253 +msgid "Middle Right" +msgstr "Közép jobb" + +#: options-sanitize.php:254 +msgid "Bottom Left" +msgstr "Bal alsó" + +#: options-sanitize.php:255 +msgid "Bottom Center" +msgstr "Középen alul" + +#: options-sanitize.php:256 +msgid "Bottom Right" +msgstr "Jobb alsó" + +#: options-sanitize.php:269 +msgid "Scroll Normally" +msgstr "Normál lapozás" + +#: options-sanitize.php:270 +msgid "Fixed in Place" +msgstr "Hely javítása" + +#: options-sanitize.php:344 +msgid "Normal" +msgstr "Normál" + +#: options-sanitize.php:345 +msgid "Italic" +msgstr "Dőlt" + +#: options-sanitize.php:346 +msgid "Bold" +msgstr "Félkövér" + +#: options-sanitize.php:347 +msgid "Bold Italic" +msgstr "Félkövér dőlt" + +#: options-framework.php:71 +msgid "Your current theme does not have support for the Options Framework plugin. Learn More | Hide Notice" +msgstr "A jelenlegi sablon nem támogatja az Options Framework bővítményt. Bővebben | Elrejtés" + +#: options-framework.php:254 options-framework.php:456 +msgid "Theme Options" +msgstr "Sablon beállítások" + +#: options-framework.php:323 +msgid "Save Options" +msgstr "Beállítások mentése" + +#: options-framework.php:324 +msgid "Restore Defaults" +msgstr "Alapértékek visszaállítása" + +#: options-framework.php:324 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "Kattintsunk az OK gombra az alapértékek visszaállításához. Minden jelenlegi beállítás elvész!" + +#: options-framework.php:358 +msgid "Default options restored." +msgstr "Alapértékek visszaállítása." + +#: options-framework.php:400 +msgid "Options saved." +msgstr "Sikeres mentés." + +#: options-medialibrary-uploader.php:26 +msgid "Options Framework Internal Container" +msgstr "Options Framework belső tároló" + +#: options-medialibrary-uploader.php:128 +msgid "Upload" +msgstr "Feltőltés" + +#: options-medialibrary-uploader.php:151 +msgid "View File" +msgstr "Fájl megtekintése" + +#: options-medialibrary-uploader.php:288 +msgid "Gallery" +msgstr "Galéria" + +#: options-medialibrary-uploader.php:288 +msgid "Previously Uploaded" +msgstr "Elöző feltőltés" + +#: options-sanitize.php:232 +msgid "No Repeat" +msgstr "Ne ismétlődjön" \ No newline at end of file diff --git a/inc/options-framework/lang/options-framework.pot b/inc/options-framework/lang/options-framework.pot new file mode 100755 index 0000000..bd88298 --- /dev/null +++ b/inc/options-framework/lang/options-framework.pot @@ -0,0 +1,370 @@ +# Copyright (C) 2013 +# This file is distributed under the same license as the package. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/options-framework-plugin\n" +"POT-Creation-Date: 2013-06-05 21:22:45+00:00\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" + +#: options-check/options.php:32 +msgid "One" +msgstr "" + +#: options-check/options.php:33 +msgid "Two" +msgstr "" + +#: options-check/options.php:34 +msgid "Three" +msgstr "" + +#: options-check/options.php:35 +msgid "Four" +msgstr "" + +#: options-check/options.php:36 +msgid "Five" +msgstr "" + +#: options-check/options.php:41 +msgid "French Toast" +msgstr "" + +#: options-check/options.php:42 +msgid "Pancake" +msgstr "" + +#: options-check/options.php:43 +msgid "Omelette" +msgstr "" + +#: options-check/options.php:44 +msgid "Crepe" +msgstr "" + +#: options-check/options.php:45 +msgid "Waffle" +msgstr "" + +#: options-check/options.php:105 +msgid "Basic Settings" +msgstr "" + +#: options-check/options.php:109 +msgid "Input Text Mini" +msgstr "" + +#: options-check/options.php:110 +msgid "A mini text input field." +msgstr "" + +#: options-check/options.php:117 +msgid "Input Text" +msgstr "" + +#: options-check/options.php:118 +msgid "A text input field." +msgstr "" + +#: options-check/options.php:124 +msgid "Textarea" +msgstr "" + +#: options-check/options.php:125 +msgid "Textarea description." +msgstr "" + +#: options-check/options.php:131 +msgid "Input Select Small" +msgstr "" + +#: options-check/options.php:132 +msgid "Small Select Box." +msgstr "" + +#: options-check/options.php:140 +msgid "Input Select Wide" +msgstr "" + +#: options-check/options.php:141 +msgid "A wider select box." +msgstr "" + +#: options-check/options.php:148 +msgid "Select a Category" +msgstr "" + +#: options-check/options.php:149 +msgid "Passed an array of categories with cat_ID and cat_name" +msgstr "" + +#: options-check/options.php:155 +msgid "Select a Tag" +msgstr "" + +#: options-check/options.php:156 +msgid "Passed an array of tags with term_id and term_name" +msgstr "" + +#: options-check/options.php:162 +msgid "Select a Page" +msgstr "" + +#: options-check/options.php:163 +msgid "Passed an pages with ID and post_title" +msgstr "" + +#: options-check/options.php:169 +msgid "Input Radio (one)" +msgstr "" + +#: options-check/options.php:170 +msgid "Radio select with default options \"one\"." +msgstr "" + +#: options-check/options.php:177 +msgid "Example Info" +msgstr "" + +#: options-check/options.php:178 +msgid "This is just some example information you can put in the panel." +msgstr "" + +#: options-check/options.php:182 +msgid "Input Checkbox" +msgstr "" + +#: options-check/options.php:183 +msgid "Example checkbox, defaults to true." +msgstr "" + +#: options-check/options.php:189 +msgid "Advanced Settings" +msgstr "" + +#: options-check/options.php:193 +msgid "Check to Show a Hidden Text Input" +msgstr "" + +#: options-check/options.php:194 +msgid "Click here and see what happens." +msgstr "" + +#: options-check/options.php:199 +msgid "Hidden Text Input" +msgstr "" + +#: options-check/options.php:200 +msgid "This option is hidden unless activated by a checkbox click." +msgstr "" + +#: options-check/options.php:207 +msgid "Uploader Test" +msgstr "" + +#: options-check/options.php:208 +msgid "This creates a full size uploader that previews the image." +msgstr "" + +#: options-check/options.php:225 +msgid "Example Background" +msgstr "" + +#: options-check/options.php:226 +msgid "Change the background CSS." +msgstr "" + +#: options-check/options.php:232 +msgid "Multicheck" +msgstr "" + +#: options-check/options.php:233 +msgid "Multicheck description." +msgstr "" + +#: options-check/options.php:240 +msgid "Colorpicker" +msgstr "" + +#: options-check/options.php:241 +msgid "No color selected by default." +msgstr "" + +#: options-check/options.php:246 +msgid "Typography" +msgstr "" + +#: options-check/options.php:247 +msgid "Example typography." +msgstr "" + +#: options-check/options.php:253 +msgid "Custom Typography" +msgstr "" + +#: options-check/options.php:254 +msgid "Custom typography options." +msgstr "" + +#: options-check/options.php:261 +msgid "Text Editor" +msgstr "" + +#: options-check/options.php:279 +msgid "Default Text Editor" +msgstr "" + +#: options-check/options.php:280 +msgid "You can also pass settings to the editor. Read more about wp_editor in the WordPress codex" +msgstr "" + +#: options-framework.php:70 +msgid "Your current theme does not have support for the Options Framework plugin. Learn More | Hide Notice" +msgstr "" + +#: options-framework.php:259 options-framework.php:260 +#: options-framework.php:489 +msgid "Theme Options" +msgstr "" + +#: options-framework.php:305 +msgid "Clear" +msgstr "" + +#: options-framework.php:306 +msgid "Default" +msgstr "" + +#: options-framework.php:307 +msgid "Select Color" +msgstr "" + +#: options-framework.php:352 +msgid "Save Options" +msgstr "" + +#: options-framework.php:353 +msgid "Restore Defaults" +msgstr "" + +#: options-framework.php:353 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "" + +#: options-framework.php:385 +msgid "Default options restored." +msgstr "" + +#: options-framework.php:439 +msgid "Options saved." +msgstr "" + +#: options-media-uploader.php:46 +msgid "No file chosen" +msgstr "" + +#: options-media-uploader.php:49 options-media-uploader.php:106 +msgid "Upload" +msgstr "" + +#: options-media-uploader.php:51 options-media-uploader.php:107 +msgid "Remove" +msgstr "" + +#: options-media-uploader.php:54 +msgid "Upgrade your version of WordPress for full media support." +msgstr "" + +#: options-media-uploader.php:78 +msgid "View File" +msgstr "" + +#: options-sanitize.php:236 +msgid "No Repeat" +msgstr "" + +#: options-sanitize.php:237 +msgid "Repeat Horizontally" +msgstr "" + +#: options-sanitize.php:238 +msgid "Repeat Vertically" +msgstr "" + +#: options-sanitize.php:239 +msgid "Repeat All" +msgstr "" + +#: options-sanitize.php:252 +msgid "Top Left" +msgstr "" + +#: options-sanitize.php:253 +msgid "Top Center" +msgstr "" + +#: options-sanitize.php:254 +msgid "Top Right" +msgstr "" + +#: options-sanitize.php:255 +msgid "Middle Left" +msgstr "" + +#: options-sanitize.php:256 +msgid "Middle Center" +msgstr "" + +#: options-sanitize.php:257 +msgid "Middle Right" +msgstr "" + +#: options-sanitize.php:258 +msgid "Bottom Left" +msgstr "" + +#: options-sanitize.php:259 +msgid "Bottom Center" +msgstr "" + +#: options-sanitize.php:260 +msgid "Bottom Right" +msgstr "" + +#: options-sanitize.php:273 +msgid "Scroll Normally" +msgstr "" + +#: options-sanitize.php:274 +msgid "Fixed in Place" +msgstr "" + +#: options-sanitize.php:348 +msgid "Normal" +msgstr "" + +#: options-sanitize.php:349 +msgid "Italic" +msgstr "" + +#: options-sanitize.php:350 +msgid "Bold" +msgstr "" + +#: options-sanitize.php:351 +msgid "Bold Italic" +msgstr "" + +#: options-theme-customizer/options.php:101 +msgid "Basic" +msgstr "" + +#: options-theme-customizer/options.php:158 +msgid "Extended" +msgstr "" \ No newline at end of file diff --git a/inc/options-framework/lang/optionsframework-es_ES.mo b/inc/options-framework/lang/optionsframework-es_ES.mo new file mode 100755 index 0000000..d2a668a Binary files /dev/null and b/inc/options-framework/lang/optionsframework-es_ES.mo differ diff --git a/inc/options-framework/lang/optionsframework-es_ES.po b/inc/options-framework/lang/optionsframework-es_ES.po new file mode 100755 index 0000000..a58befe --- /dev/null +++ b/inc/options-framework/lang/optionsframework-es_ES.po @@ -0,0 +1,142 @@ +msgid "" +msgstr "" +"Project-Id-Version: Options Framework Plugin\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-04-22 19:13-0300\n" +"PO-Revision-Date: 2012-04-22 19:17-0300\n" +"Last-Translator: Matt Varone \n" +"Language-Team: Matt Varone \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;_x;__;esc_attr_e\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-Language: Spanish\n" +"X-Poedit-SearchPath-0: .\n" + +#: options-framework.php:71 +#, php-format +msgid "Your current theme does not have support for the Options Framework plugin. Learn More | Hide Notice" +msgstr "Su tema actual no tiene suporte para el Options Framework Plugin. Mas informacion | Esconder" + +#: options-framework.php:254 +#: options-framework.php:456 +msgid "Theme Options" +msgstr "Opciones del Tema" + +#: options-framework.php:323 +msgid "Save Options" +msgstr "Guardar Opciones" + +#: options-framework.php:324 +msgid "Restore Defaults" +msgstr "Restaurar Ajustes" + +#: options-framework.php:324 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "Click OK para restablecer los ajustes iniciales. Se perderán los ajustes realizados!" + +#: options-framework.php:358 +msgid "Default options restored." +msgstr "Opciones predeterminadas restauradas." + +#: options-framework.php:400 +msgid "Options saved." +msgstr "Opciones Guardadas." + +#: options-medialibrary-uploader.php:26 +msgid "Options Framework Internal Container" +msgstr "Contenedor Interno de Options Framework" + +#: options-medialibrary-uploader.php:128 +msgid "Upload" +msgstr "Cargar" + +#: options-medialibrary-uploader.php:151 +msgid "View File" +msgstr "Ver Archivo" + +#: options-medialibrary-uploader.php:288 +msgid "Gallery" +msgstr "Galería" + +#: options-medialibrary-uploader.php:288 +msgid "Previously Uploaded" +msgstr "Cargado Previamente" + +#: options-sanitize.php:232 +msgid "No Repeat" +msgstr "No Repetir" + +#: options-sanitize.php:233 +msgid "Repeat Horizontally" +msgstr "Repetir Horizontalmente" + +#: options-sanitize.php:234 +msgid "Repeat Vertically" +msgstr "Repetir Verticalmente" + +#: options-sanitize.php:235 +msgid "Repeat All" +msgstr "Repetir Todos" + +#: options-sanitize.php:248 +msgid "Top Left" +msgstr "Arriba a la Izquierda" + +#: options-sanitize.php:249 +msgid "Top Center" +msgstr "Arriba al Centro" + +#: options-sanitize.php:250 +msgid "Top Right" +msgstr "Arriba a la Derecha" + +#: options-sanitize.php:251 +msgid "Middle Left" +msgstr "Medio a la Izquierda" + +#: options-sanitize.php:252 +msgid "Middle Center" +msgstr "Medio al Centro" + +#: options-sanitize.php:253 +msgid "Middle Right" +msgstr "Medio a la Derecha" + +#: options-sanitize.php:254 +msgid "Bottom Left" +msgstr "Abajo a la Izquierda" + +#: options-sanitize.php:255 +msgid "Bottom Center" +msgstr "Abajo al Centro" + +#: options-sanitize.php:256 +msgid "Bottom Right" +msgstr "Abajo a la Derecha" + +#: options-sanitize.php:269 +msgid "Scroll Normally" +msgstr "Desplazar Normalmente" + +#: options-sanitize.php:270 +msgid "Fixed in Place" +msgstr "Fijo en el Lugar" + +#: options-sanitize.php:344 +msgid "Normal" +msgstr "Normal" + +#: options-sanitize.php:345 +msgid "Italic" +msgstr "Cursiva" + +#: options-sanitize.php:346 +msgid "Bold" +msgstr "Negrita" + +#: options-sanitize.php:347 +msgid "Bold Italic" +msgstr "Negrita Cursiva" + diff --git a/inc/options-framework/lang/optionsframework-fa_IR.mo b/inc/options-framework/lang/optionsframework-fa_IR.mo new file mode 100755 index 0000000..5bb7112 Binary files /dev/null and b/inc/options-framework/lang/optionsframework-fa_IR.mo differ diff --git a/inc/options-framework/lang/optionsframework-fa_IR.po b/inc/options-framework/lang/optionsframework-fa_IR.po new file mode 100755 index 0000000..c8d6f1e --- /dev/null +++ b/inc/options-framework/lang/optionsframework-fa_IR.po @@ -0,0 +1,141 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-04-22 15:51-0300\n" +"PO-Revision-Date: 2012-09-10 07:03+0330\n" +"Last-Translator: va \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e\n" +"X-Poedit-Basepath: /Users/weslly/Desktop/options-framework-plugin\n" +"X-Poedit-SearchPath-0: .\n" + +#: options-framework.php:71 +#, php-format +msgid "Your current theme does not have support for the Options Framework plugin. Learn More | Hide Notice" +msgstr "قالب فعلی شما با پلاگین فریم ورک قالب سازگار نیست. بیشتر یاد بگیرید | مخفی کردن این نکته" + +#: options-framework.php:254 +#: options-framework.php:456 +msgid "Theme Options" +msgstr "تنظیمات قالب" + +#: options-framework.php:323 +msgid "Save Options" +msgstr "ذخیره تنظیمات" + +#: options-framework.php:324 +msgid "Restore Defaults" +msgstr "بازگرداندن به پیش‌فرض" + +#: options-framework.php:324 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "" + +#: options-framework.php:358 +msgid "Default options restored." +msgstr "" + +#: options-framework.php:400 +msgid "Options saved." +msgstr "تنظیمات ذخیره شدند." + +#: options-medialibrary-uploader.php:26 +msgid "Options Framework Internal Container" +msgstr "" + +#: options-medialibrary-uploader.php:128 +msgid "Upload" +msgstr "آپلود" + +#: options-medialibrary-uploader.php:151 +msgid "View File" +msgstr "مشاهده فایل" + +#: options-medialibrary-uploader.php:288 +msgid "Gallery" +msgstr "گالری" + +#: options-medialibrary-uploader.php:288 +msgid "Previously Uploaded" +msgstr "" + +#: options-sanitize.php:232 +msgid "No Repeat" +msgstr "" + +#: options-sanitize.php:233 +msgid "Repeat Horizontally" +msgstr "" + +#: options-sanitize.php:234 +msgid "Repeat Vertically" +msgstr "" + +#: options-sanitize.php:235 +msgid "Repeat All" +msgstr "" + +#: options-sanitize.php:248 +msgid "Top Left" +msgstr "بالا چپ" + +#: options-sanitize.php:249 +msgid "Top Center" +msgstr "بالا وسط" + +#: options-sanitize.php:250 +msgid "Top Right" +msgstr "بالا راست" + +#: options-sanitize.php:251 +msgid "Middle Left" +msgstr "وسط چپ" + +#: options-sanitize.php:252 +msgid "Middle Center" +msgstr "وسط وسط" + +#: options-sanitize.php:253 +msgid "Middle Right" +msgstr "وسط راست" + +#: options-sanitize.php:254 +msgid "Bottom Left" +msgstr "پایین چپ " + +#: options-sanitize.php:255 +msgid "Bottom Center" +msgstr "پایین وسط" + +#: options-sanitize.php:256 +msgid "Bottom Right" +msgstr "پایین راست" + +#: options-sanitize.php:269 +msgid "Scroll Normally" +msgstr "" + +#: options-sanitize.php:270 +msgid "Fixed in Place" +msgstr "" + +#: options-sanitize.php:344 +msgid "Normal" +msgstr "عادی" + +#: options-sanitize.php:345 +msgid "Italic" +msgstr "" + +#: options-sanitize.php:346 +msgid "Bold" +msgstr "" + +#: options-sanitize.php:347 +msgid "Bold Italic" +msgstr "" + diff --git a/inc/options-framework/lang/optionsframework-fr_FR.mo b/inc/options-framework/lang/optionsframework-fr_FR.mo new file mode 100755 index 0000000..dea737d Binary files /dev/null and b/inc/options-framework/lang/optionsframework-fr_FR.mo differ diff --git a/inc/options-framework/lang/optionsframework-fr_FR.po b/inc/options-framework/lang/optionsframework-fr_FR.po new file mode 100755 index 0000000..4993cff --- /dev/null +++ b/inc/options-framework/lang/optionsframework-fr_FR.po @@ -0,0 +1,149 @@ +msgid "" +msgstr "" +"Project-Id-Version: Options Framework Plugin\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-04-22 19:13-0300\n" +"PO-Revision-Date: 2013-03-28 13:13+0100\n" +"Last-Translator: MBA Multimedia \n" +"Language-Team: Julien LE THUAUT \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;_x;__;esc_attr_e\n" +"X-Poedit-Basepath: ../\n" +"Language: fr\n" +"X-Generator: Poedit 1.5.5\n" +"X-Poedit-SearchPath-0: .\n" + +#: options-framework.php:71 +#, php-format +msgid "" +"Your current theme does not have support for the Options Framework plugin. " +"Learn More | Hide " +"Notice" +msgstr "" +"Votre thème actuel ne permet pas l'utilisation du plugin Options Framework. " +"En savoir plus | Masquer cette note" + +#: options-framework.php:254 options-framework.php:456 +msgid "Theme Options" +msgstr "Options du thème" + +#: options-framework.php:323 +msgid "Save Options" +msgstr "Sauvegarder options" + +#: options-framework.php:324 +msgid "Restore Defaults" +msgstr "Restaurer les valeurs par défaut" + +#: options-framework.php:324 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "" +"Cliquer sur OK pour faire une remise à zero. Toutes les options du thèmes " +"seront perdues !" + +#: options-framework.php:358 +msgid "Default options restored." +msgstr "Options par défaut restaurées." + +#: options-framework.php:400 +msgid "Options saved." +msgstr "Options sauvegardées" + +#: options-medialibrary-uploader.php:26 +msgid "Options Framework Internal Container" +msgstr "Conteneur interne de l'Options Framework" + +#: options-medialibrary-uploader.php:128 +msgid "Upload" +msgstr "Upload" + +#: options-medialibrary-uploader.php:151 +msgid "View File" +msgstr "Voir fichier" + +#: options-medialibrary-uploader.php:288 +msgid "Gallery" +msgstr "Galerie" + +#: options-medialibrary-uploader.php:288 +msgid "Previously Uploaded" +msgstr "Uploadé précédemment" + +#: options-sanitize.php:232 +msgid "No Repeat" +msgstr "Ne pas répéter" + +#: options-sanitize.php:233 +msgid "Repeat Horizontally" +msgstr "Répéter horizontalement" + +#: options-sanitize.php:234 +msgid "Repeat Vertically" +msgstr "Répéter verticalement" + +#: options-sanitize.php:235 +msgid "Repeat All" +msgstr "Répéter" + +#: options-sanitize.php:248 +msgid "Top Left" +msgstr "Haut Gauche" + +#: options-sanitize.php:249 +msgid "Top Center" +msgstr "Haut Centre" + +#: options-sanitize.php:250 +msgid "Top Right" +msgstr "Haut Droite" + +#: options-sanitize.php:251 +msgid "Middle Left" +msgstr "Milieu Gauche" + +#: options-sanitize.php:252 +msgid "Middle Center" +msgstr "Milieu Centre" + +#: options-sanitize.php:253 +msgid "Middle Right" +msgstr "Milieu Droite" + +#: options-sanitize.php:254 +msgid "Bottom Left" +msgstr "Bas Gauche" + +#: options-sanitize.php:255 +msgid "Bottom Center" +msgstr "Bas Centre" + +#: options-sanitize.php:256 +msgid "Bottom Right" +msgstr "Bas Droite" + +#: options-sanitize.php:269 +msgid "Scroll Normally" +msgstr "Scroll normal" + +#: options-sanitize.php:270 +msgid "Fixed in Place" +msgstr "Position fixe" + +#: options-sanitize.php:344 +msgid "Normal" +msgstr "Normal" + +#: options-sanitize.php:345 +msgid "Italic" +msgstr "Italique" + +#: options-sanitize.php:346 +msgid "Bold" +msgstr "Gras" + +#: options-sanitize.php:347 +msgid "Bold Italic" +msgstr "Gras italique" diff --git a/inc/options-framework/lang/optionsframework-it_IT.mo b/inc/options-framework/lang/optionsframework-it_IT.mo new file mode 100755 index 0000000..bf53c08 Binary files /dev/null and b/inc/options-framework/lang/optionsframework-it_IT.mo differ diff --git a/inc/options-framework/lang/optionsframework-it_IT.po b/inc/options-framework/lang/optionsframework-it_IT.po new file mode 100755 index 0000000..57892d6 --- /dev/null +++ b/inc/options-framework/lang/optionsframework-it_IT.po @@ -0,0 +1,142 @@ +msgid "" +msgstr "" +"Project-Id-Version: Options Framework Plugin\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-04-22 19:13-0300\n" +"PO-Revision-Date: 2012-12-08 17:55+0100\n" +"Last-Translator: Andrea Bersi\n" +"Language-Team: Matt Varone \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;_x;__;esc_attr_e\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-Language: Spanish\n" +"X-Poedit-SearchPath-0: .\n" + +#: options-framework.php:71 +#, php-format +msgid "Your current theme does not have support for the Options Framework plugin. Learn More | Hide Notice" +msgstr "SIl tema corrente non supporta Options Framework. Leggi info | Nascondi avviso" + +#: options-framework.php:254 +#: options-framework.php:456 +msgid "Theme Options" +msgstr "Opzioni tema" + +#: options-framework.php:323 +msgid "Save Options" +msgstr "Salva Opzioni" + +#: options-framework.php:324 +msgid "Restore Defaults" +msgstr "Ripristina default" + +#: options-framework.php:324 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "Clicca su OK. Tutte le impostazioni verranno perse!" + +#: options-framework.php:358 +msgid "Default options restored." +msgstr "Impostazioni default ripristinate." + +#: options-framework.php:400 +msgid "Options saved." +msgstr "Opzioni salvate." + +#: options-medialibrary-uploader.php:26 +msgid "Options Framework Internal Container" +msgstr "Options Framework contenitore interno" + +#: options-medialibrary-uploader.php:128 +msgid "Upload" +msgstr "Upload" + +#: options-medialibrary-uploader.php:151 +msgid "View File" +msgstr "Vedi file" + +#: options-medialibrary-uploader.php:288 +msgid "Gallery" +msgstr "Galleria" + +#: options-medialibrary-uploader.php:288 +msgid "Previously Uploaded" +msgstr "caricato in precedenza" + +#: options-sanitize.php:232 +msgid "No Repeat" +msgstr "Non ripetere" + +#: options-sanitize.php:233 +msgid "Repeat Horizontally" +msgstr "Ripeti orizzontalmente" + +#: options-sanitize.php:234 +msgid "Repeat Vertically" +msgstr "Ripeti verticalmente" + +#: options-sanitize.php:235 +msgid "Repeat All" +msgstr "Ripeti tutto" + +#: options-sanitize.php:248 +msgid "Top Left" +msgstr "Alto sinistra" + +#: options-sanitize.php:249 +msgid "Top Center" +msgstr "Alto centro" + +#: options-sanitize.php:250 +msgid "Top Right" +msgstr "Alto destra" + +#: options-sanitize.php:251 +msgid "Middle Left" +msgstr "Centro sinistra" + +#: options-sanitize.php:252 +msgid "Middle Center" +msgstr "Allineato al centro" + +#: options-sanitize.php:253 +msgid "Middle Right" +msgstr "Centro destra" + +#: options-sanitize.php:254 +msgid "Bottom Left" +msgstr "Basso sinistra" + +#: options-sanitize.php:255 +msgid "Bottom Center" +msgstr "Basso centro" + +#: options-sanitize.php:256 +msgid "Bottom Right" +msgstr "Basso destra" + +#: options-sanitize.php:269 +msgid "Scroll Normally" +msgstr "Scrolla normalmente" + +#: options-sanitize.php:270 +msgid "Fixed in Place" +msgstr "Blocca nella posizione" + +#: options-sanitize.php:344 +msgid "Normal" +msgstr "Normalw" + +#: options-sanitize.php:345 +msgid "Italic" +msgstr "Italico" + +#: options-sanitize.php:346 +msgid "Bold" +msgstr "Grassetto" + +#: options-sanitize.php:347 +msgid "Bold Italic" +msgstr "Grassetto italico" + diff --git a/inc/options-framework/lang/optionsframework-pt_BR.mo b/inc/options-framework/lang/optionsframework-pt_BR.mo new file mode 100755 index 0000000..0e67a21 Binary files /dev/null and b/inc/options-framework/lang/optionsframework-pt_BR.mo differ diff --git a/inc/options-framework/lang/optionsframework-pt_BR.po b/inc/options-framework/lang/optionsframework-pt_BR.po new file mode 100755 index 0000000..8f60b82 --- /dev/null +++ b/inc/options-framework/lang/optionsframework-pt_BR.po @@ -0,0 +1,142 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-04-22 15:51-0300\n" +"PO-Revision-Date: 2012-04-22 16:04-0300\n" +"Last-Translator: Weslly Honorato \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e\n" +"X-Poedit-Language: Portuguese\n" +"X-Poedit-Country: BRAZIL\n" +"X-Poedit-SearchPath-0: .\n" + +#: options-framework.php:71 +#, php-format +msgid "Your current theme does not have support for the Options Framework plugin. Learn More | Hide Notice" +msgstr "Seu tema atual não suporta o plugin Options Framework. Saiba Mais | Esconder Alerta" + +#: options-framework.php:254 +#: options-framework.php:456 +msgid "Theme Options" +msgstr "Opções do Tema" + +#: options-framework.php:323 +msgid "Save Options" +msgstr "Salvar Opções" + +#: options-framework.php:324 +msgid "Restore Defaults" +msgstr "Restaurar Padrões" + +#: options-framework.php:324 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "Clique em OK para restaurar. As configurações feitas anteriormente serão perdidas!" + +#: options-framework.php:358 +msgid "Default options restored." +msgstr "Opções padrão restauradas." + +#: options-framework.php:400 +msgid "Options saved." +msgstr "Opções salvas." + +#: options-medialibrary-uploader.php:26 +msgid "Options Framework Internal Container" +msgstr "Container Interno do Options Framework" + +#: options-medialibrary-uploader.php:128 +msgid "Upload" +msgstr "Upload" + +#: options-medialibrary-uploader.php:151 +msgid "View File" +msgstr "Visualizar Arquivo" + +#: options-medialibrary-uploader.php:288 +msgid "Gallery" +msgstr "Galeria" + +#: options-medialibrary-uploader.php:288 +msgid "Previously Uploaded" +msgstr "Enviado Anteriormente" + +#: options-sanitize.php:232 +msgid "No Repeat" +msgstr "Sem Repetição" + +#: options-sanitize.php:233 +msgid "Repeat Horizontally" +msgstr "Repetir Horizontalmente" + +#: options-sanitize.php:234 +msgid "Repeat Vertically" +msgstr "Repetir Verticalmente" + +#: options-sanitize.php:235 +msgid "Repeat All" +msgstr "Repetir" + +#: options-sanitize.php:248 +msgid "Top Left" +msgstr "Superior Esquerda" + +#: options-sanitize.php:249 +msgid "Top Center" +msgstr "Superior Centro" + +#: options-sanitize.php:250 +msgid "Top Right" +msgstr "Superior Direita" + +#: options-sanitize.php:251 +msgid "Middle Left" +msgstr "Meio Esquerda" + +#: options-sanitize.php:252 +msgid "Middle Center" +msgstr "Meio Centro" + +#: options-sanitize.php:253 +msgid "Middle Right" +msgstr "Meio Direita" + +#: options-sanitize.php:254 +msgid "Bottom Left" +msgstr "Inferior Esquerda" + +#: options-sanitize.php:255 +msgid "Bottom Center" +msgstr "Inferior Centro" + +#: options-sanitize.php:256 +msgid "Bottom Right" +msgstr "Inferior Direita" + +#: options-sanitize.php:269 +msgid "Scroll Normally" +msgstr "Rolar Normalmente" + +#: options-sanitize.php:270 +msgid "Fixed in Place" +msgstr "Fixado no Local" + +#: options-sanitize.php:344 +msgid "Normal" +msgstr "Normal" + +#: options-sanitize.php:345 +msgid "Italic" +msgstr "Itálico" + +#: options-sanitize.php:346 +msgid "Bold" +msgstr "Negrito" + +#: options-sanitize.php:347 +msgid "Bold Italic" +msgstr "Negrito e Itálico" + diff --git a/inc/options-framework/lang/optionsframework-ru_RU.mo b/inc/options-framework/lang/optionsframework-ru_RU.mo new file mode 100755 index 0000000..4e5129e Binary files /dev/null and b/inc/options-framework/lang/optionsframework-ru_RU.mo differ diff --git a/inc/options-framework/lang/optionsframework-ru_RU.po b/inc/options-framework/lang/optionsframework-ru_RU.po new file mode 100755 index 0000000..36cf3ec --- /dev/null +++ b/inc/options-framework/lang/optionsframework-ru_RU.po @@ -0,0 +1,143 @@ +msgid "" +msgstr "" +"Project-Id-Version: Options Framework\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-04-22 15:51-0300\n" +"PO-Revision-Date: 2012-12-07 21:40+0400\n" +"Last-Translator: evgeny \n" +"Language-Team: Evgeny Vlasov \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e\n" +"X-Poedit-Basepath: /Users/weslly/Desktop/options-framework-plugin\n" +"X-Poedit-Language: Russian\n" +"X-Poedit-Country: RUSSIAN FEDERATION\n" +"X-Poedit-SearchPath-0: .\n" + +#: options-framework.php:71 +#, php-format +msgid "Your current theme does not have support for the Options Framework plugin. Learn More | Hide Notice" +msgstr "Ваша текущая тема не поддерживает плагин Options Framework. Подробности | Скрыть уведомление" + +#: options-framework.php:254 +#: options-framework.php:456 +msgid "Theme Options" +msgstr "Настройки темы" + +#: options-framework.php:323 +msgid "Save Options" +msgstr "Сохранить настройки" + +#: options-framework.php:324 +msgid "Restore Defaults" +msgstr "Восстановить значения по умолчанию" + +#: options-framework.php:324 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "Нажмите ОК для сброса настроек. Произведнные ранее настройки темы будут удалены." + +#: options-framework.php:358 +msgid "Default options restored." +msgstr "Значения по умолчанию восстановлены." + +#: options-framework.php:400 +msgid "Options saved." +msgstr "Настройки сохранены." + +#: options-medialibrary-uploader.php:26 +msgid "Options Framework Internal Container" +msgstr "Внутренний контейнер Options Framework" + +#: options-medialibrary-uploader.php:128 +msgid "Upload" +msgstr "Обзор" + +#: options-medialibrary-uploader.php:151 +msgid "View File" +msgstr "Просмотреть файл" + +#: options-medialibrary-uploader.php:288 +msgid "Gallery" +msgstr "Галерея" + +#: options-medialibrary-uploader.php:288 +msgid "Previously Uploaded" +msgstr "Ранее загруженный" + +#: options-sanitize.php:232 +msgid "No Repeat" +msgstr "Без повтора" + +#: options-sanitize.php:233 +msgid "Repeat Horizontally" +msgstr "Повторить по горизонтали" + +#: options-sanitize.php:234 +msgid "Repeat Vertically" +msgstr "Повторить по вертикали" + +#: options-sanitize.php:235 +msgid "Repeat All" +msgstr "Повторить во всех направлениях" + +#: options-sanitize.php:248 +msgid "Top Left" +msgstr "Сверху слева" + +#: options-sanitize.php:249 +msgid "Top Center" +msgstr "Сверху по центру" + +#: options-sanitize.php:250 +msgid "Top Right" +msgstr "Сверху справа" + +#: options-sanitize.php:251 +msgid "Middle Left" +msgstr "По центру слева" + +#: options-sanitize.php:252 +msgid "Middle Center" +msgstr "Центровать по горизонтали и вертикали" + +#: options-sanitize.php:253 +msgid "Middle Right" +msgstr "По центру справа" + +#: options-sanitize.php:254 +msgid "Bottom Left" +msgstr "Снизу слева" + +#: options-sanitize.php:255 +msgid "Bottom Center" +msgstr "Снизу по центру" + +#: options-sanitize.php:256 +msgid "Bottom Right" +msgstr "Снизу справа" + +#: options-sanitize.php:269 +msgid "Scroll Normally" +msgstr "Обычное поведение" + +#: options-sanitize.php:270 +msgid "Fixed in Place" +msgstr "Фиксировать фон" + +#: options-sanitize.php:344 +msgid "Normal" +msgstr "Нормальный" + +#: options-sanitize.php:345 +msgid "Italic" +msgstr "Курсив" + +#: options-sanitize.php:346 +msgid "Bold" +msgstr "Полужирный" + +#: options-sanitize.php:347 +msgid "Bold Italic" +msgstr "Полужирный курсив" + diff --git a/inc/options-framework/lang/optionsframework-sv_SE.mo b/inc/options-framework/lang/optionsframework-sv_SE.mo new file mode 100755 index 0000000..654e32e Binary files /dev/null and b/inc/options-framework/lang/optionsframework-sv_SE.mo differ diff --git a/inc/options-framework/lang/optionsframework-sv_SE.po b/inc/options-framework/lang/optionsframework-sv_SE.po new file mode 100755 index 0000000..5e4bd4f --- /dev/null +++ b/inc/options-framework/lang/optionsframework-sv_SE.po @@ -0,0 +1,146 @@ +msgid "" +msgstr "" +"Project-Id-Version: Options Framework 1.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-04-22 15:51-0300\n" +"PO-Revision-Date: 2012-12-20 08:33+0100\n" +"Last-Translator: Kjeell.se \n" +"Language-Team: Kjeell.se \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.4\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop\n" +"X-Poedit-Basepath: .\n" +"Language: sv_SE\n" + +#: options-framework.php:71 +#, php-format +msgid "" +"Your current theme does not have support for the Options Framework plugin. " +"Learn More | Hide " +"Notice" +msgstr "" +"Ditt nuvarande tema stödjer inte Options Framework Plugin. Mer information | Dölj meddelande" + +#: options-framework.php:254 options-framework.php:456 +msgid "Theme Options" +msgstr "Tema inställningar" + +#: options-framework.php:323 +msgid "Save Options" +msgstr "Spara Inställningar" + +#: options-framework.php:324 +msgid "Restore Defaults" +msgstr "Återställ standardinställningar" + +#: options-framework.php:324 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "" +"Klicka OK för att återställa. Alla temainställningar kommer att gå förlorade!" + +#: options-framework.php:358 +msgid "Default options restored." +msgstr "Standardinställningar återställda." + +#: options-framework.php:400 +msgid "Options saved." +msgstr "Inställningar sparade." + +#: options-medialibrary-uploader.php:26 +msgid "Options Framework Internal Container" +msgstr "Options Framework internt" + +#: options-medialibrary-uploader.php:128 +msgid "Upload" +msgstr "Ladda upp" + +#: options-medialibrary-uploader.php:151 +msgid "View File" +msgstr "Visa fil" + +#: options-medialibrary-uploader.php:288 +msgid "Gallery" +msgstr "Galleri" + +#: options-medialibrary-uploader.php:288 +msgid "Previously Uploaded" +msgstr "Tidigare uppladdad" + +#: options-sanitize.php:232 +msgid "No Repeat" +msgstr "Upprepa inte" + +#: options-sanitize.php:233 +msgid "Repeat Horizontally" +msgstr "Upprepa horizontalt" + +#: options-sanitize.php:234 +msgid "Repeat Vertically" +msgstr "Upprepa vertikalt" + +#: options-sanitize.php:235 +msgid "Repeat All" +msgstr "Upprepa alla" + +#: options-sanitize.php:248 +msgid "Top Left" +msgstr "Vänster topp" + +#: options-sanitize.php:249 +msgid "Top Center" +msgstr "Centrerat topp" + +#: options-sanitize.php:250 +msgid "Top Right" +msgstr "Höger topp" + +#: options-sanitize.php:251 +msgid "Middle Left" +msgstr "Vänster Mitt" + +#: options-sanitize.php:252 +msgid "Middle Center" +msgstr "Centrerat Mitt" + +#: options-sanitize.php:253 +msgid "Middle Right" +msgstr "Höger Mitt" + +#: options-sanitize.php:254 +msgid "Bottom Left" +msgstr "Vänster nederkant" + +#: options-sanitize.php:255 +msgid "Bottom Center" +msgstr "Centrerad nederkant" + +#: options-sanitize.php:256 +msgid "Bottom Right" +msgstr "Höger nederkant" + +#: options-sanitize.php:269 +msgid "Scroll Normally" +msgstr "Scrolla normalt" + +#: options-sanitize.php:270 +msgid "Fixed in Place" +msgstr "Fixerad placering" + +#: options-sanitize.php:344 +msgid "Normal" +msgstr "Normal" + +#: options-sanitize.php:345 +msgid "Italic" +msgstr "Kursiv" + +#: options-sanitize.php:346 +msgid "Bold" +msgstr "Fet" + +#: options-sanitize.php:347 +msgid "Bold Italic" +msgstr "Fet Kursiv" diff --git a/inc/options-framework/lang/optionsframework-zh_CN.mo b/inc/options-framework/lang/optionsframework-zh_CN.mo new file mode 100755 index 0000000..cf167ab Binary files /dev/null and b/inc/options-framework/lang/optionsframework-zh_CN.mo differ diff --git a/inc/options-framework/lang/optionsframework-zh_CN.po b/inc/options-framework/lang/optionsframework-zh_CN.po new file mode 100755 index 0000000..2ccef07 --- /dev/null +++ b/inc/options-framework/lang/optionsframework-zh_CN.po @@ -0,0 +1,145 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-04-22 15:51-0300\n" +"PO-Revision-Date: 2013-05-11 21:40+0800\n" +"Last-Translator: Amos Lee <470266798@qq.com>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e\n" +"X-Poedit-Basepath: /Users/weslly/Desktop/options-framework-plugin\n" +"X-Generator: Poedit 1.5.5\n" +"X-Poedit-SearchPath-0: .\n" + +#: options-framework.php:71 +#, php-format +msgid "" +"Your current theme does not have support for the Options Framework plugin. " +"Learn More | Hide " +"Notice" +msgstr "" +"您当前的主题不支持选项框架插件。 了解更多" +" | 隐藏通知" + +#: options-framework.php:254 options-framework.php:456 +msgid "Theme Options" +msgstr "主题选项" + +#: options-framework.php:323 +msgid "Save Options" +msgstr "保存选项" + +#: options-framework.php:324 +msgid "Restore Defaults" +msgstr "重置选项" + +#: options-framework.php:324 +msgid "Click OK to reset. Any theme settings will be lost!" +msgstr "点击OK重置,所有主题设置将丢失!" + +#: options-framework.php:358 +msgid "Default options restored." +msgstr "默认选项已恢复。" + +#: options-framework.php:400 +msgid "Options saved." +msgstr "选项已保存。" + +#: options-medialibrary-uploader.php:26 +msgid "Options Framework Internal Container" +msgstr "选项框架内部包装" + +#: options-medialibrary-uploader.php:128 +msgid "Upload" +msgstr "上传" + +#: options-medialibrary-uploader.php:151 +msgid "View File" +msgstr "查看文件" + +#: options-medialibrary-uploader.php:288 +msgid "Gallery" +msgstr "相册" + +#: options-medialibrary-uploader.php:288 +msgid "Previously Uploaded" +msgstr "先前上传" + +#: options-sanitize.php:232 +msgid "No Repeat" +msgstr "不重复" + +#: options-sanitize.php:233 +msgid "Repeat Horizontally" +msgstr "垂直重复" + +#: options-sanitize.php:234 +msgid "Repeat Vertically" +msgstr "水平重复" + +#: options-sanitize.php:235 +msgid "Repeat All" +msgstr "全部重复" + +#: options-sanitize.php:248 +msgid "Top Left" +msgstr "上左" + +#: options-sanitize.php:249 +msgid "Top Center" +msgstr "上中" + +#: options-sanitize.php:250 +msgid "Top Right" +msgstr "上右" + +#: options-sanitize.php:251 +msgid "Middle Left" +msgstr "中左" + +#: options-sanitize.php:252 +msgid "Middle Center" +msgstr "中中" + +#: options-sanitize.php:253 +msgid "Middle Right" +msgstr "中右" + +#: options-sanitize.php:254 +msgid "Bottom Left" +msgstr "下左" + +#: options-sanitize.php:255 +msgid "Bottom Center" +msgstr "下中" + +#: options-sanitize.php:256 +msgid "Bottom Right" +msgstr "下右" + +#: options-sanitize.php:269 +msgid "Scroll Normally" +msgstr "普通滚动" + +#: options-sanitize.php:270 +msgid "Fixed in Place" +msgstr "固定位置" + +#: options-sanitize.php:344 +msgid "Normal" +msgstr "普通" + +#: options-sanitize.php:345 +msgid "Italic" +msgstr "斜体" + +#: options-sanitize.php:346 +msgid "Bold" +msgstr "加粗" + +#: options-sanitize.php:347 +msgid "Bold Italic" +msgstr "加粗斜体" diff --git a/inc/options-framework/options-check/footer.php b/inc/options-framework/options-check/footer.php new file mode 100755 index 0000000..2e13271 --- /dev/null +++ b/inc/options-framework/options-check/footer.php @@ -0,0 +1,24 @@ + + +
+ + + * tag of your theme, or you will break many plugins, which + * generally use this hook to reference JavaScript files. + */ + + wp_footer(); +?> + + diff --git a/inc/options-framework/options-check/functions.php b/inc/options-framework/options-check/functions.php new file mode 100755 index 0000000..0afada0 --- /dev/null +++ b/inc/options-framework/options-check/functions.php @@ -0,0 +1,108 @@ + + + + + +> + + +Options Check + + + + +> + +
\ No newline at end of file diff --git a/inc/options-framework/options-check/images/1col.png b/inc/options-framework/options-check/images/1col.png new file mode 100755 index 0000000..32bddc1 Binary files /dev/null and b/inc/options-framework/options-check/images/1col.png differ diff --git a/inc/options-framework/options-check/images/2cl.png b/inc/options-framework/options-check/images/2cl.png new file mode 100755 index 0000000..def0bcd Binary files /dev/null and b/inc/options-framework/options-check/images/2cl.png differ diff --git a/inc/options-framework/options-check/images/2cr.png b/inc/options-framework/options-check/images/2cr.png new file mode 100755 index 0000000..2aed4f9 Binary files /dev/null and b/inc/options-framework/options-check/images/2cr.png differ diff --git a/inc/options-framework/options-check/index.php b/inc/options-framework/options-check/index.php new file mode 100755 index 0000000..9d8dcda --- /dev/null +++ b/inc/options-framework/options-check/index.php @@ -0,0 +1,202 @@ + + +
+ +
+

Options Check

+

Use of_get_option($id,$default) to return option values.

+
+ +
+ +

Basic Options

+ +
+
type: text (mini)
+
of_get_option('example_text_mini'):
+
+ +
+
type: text
+
of_get_option('example_text'):
+
+ +
+
type: textarea
+
of_get_option('example_textarea'):
+
+ +
+
type: select (mini)
+
of_get_option('example_select'):
+
+ +
+
type: select2 (wide)
+
of_get_option('example_select_wide'):
+
+ +
+
type: select
+
of_get_option('example_select_categories'): category id =
+
+ +
+
type: select
+
of_get_option('example_select_tags'): term id =
+
+ +
+
type: select
+
of_get_option('example_select_pages'): page id =
+
+ +
+
type: radio
+
of_get_option('example_radio'):
+
+ +
+
type: checkbox
+
of_get_option('example_checkbox'):
+
+ +
+ +

Advanced Options

+ +
+
type: uploader
+
of_get_option('example_uploader'):
+ + + +
+ +
+
type: image
+
of_get_option('images'):
+
+ +
+
type: multicheck
+
of_get_option('multicheck'): + + +
+
+ +

The array sent in the options panel was defined as:
+ "French Toast","two" => "Pancake","three" => "Omelette","four" => "Crepe","five" => "Waffle"); + print_r($test_array_jr); + ?> +

+ +

You can get the value of all items in the checkbox array:

+
    + $value) { + // If you need the option's name rather than the key you can get that + $name = $test_array_jr[$key]; + // Prints out each of the values + echo '
  • ' . $key . ' (' . $name . ') = ' . $value . '
  • '; + } + } + else { + echo '
  • There are no saved values yet.
  • '; + } + ?> +
+ +

You can also get an individual checkbox value if you know what you are looking for. In this example, I'll check for the key "one", which is an item I sent in the array for checkboxes:

+ +

The value of the multicheck box "one" of example_multicheck is: + + + +

+ +
+
type: background
+
of_get_option('background'): + '; + echo '
    '; + foreach ($background as $i=>$param){ + echo '
  • '.$i . ' = ' . $param.'
  • '; + } + echo '
'; + } else { + echo ''; + echo '
    '; + echo '
  • '.$background['color'].'
  • '; + echo '
'; + } + } else { + echo "no entry"; + }; ?> + +
+
+ +
+
type: colorpicker
+
of_get_option('colorpicker'): + + + +
+
+ +
+
type: typography
+
of_get_option('typography'): + '; + foreach ($typography as $i=>$param) { + echo '
  • '.$i . ' = ' . $param.'
  • '; + } + echo ''; + echo 'Some sample text in your style'; + } else { + echo "no entry"; + } ?> +
    +
    + +
    + +

    Editor

    + +
    +
    type: editor
    +
    of_get_option('example_editor'):
    + +
    +
    + +
    +
    + + \ No newline at end of file diff --git a/inc/options-framework/options-check/options.php b/inc/options-framework/options-check/options.php new file mode 100755 index 0000000..e647d3d --- /dev/null +++ b/inc/options-framework/options-check/options.php @@ -0,0 +1,286 @@ + __('One', 'options_check'), + 'two' => __('Two', 'options_check'), + 'three' => __('Three', 'options_check'), + 'four' => __('Four', 'options_check'), + 'five' => __('Five', 'options_check') + ); + + // Multicheck Array + $multicheck_array = array( + 'one' => __('French Toast', 'options_check'), + 'two' => __('Pancake', 'options_check'), + 'three' => __('Omelette', 'options_check'), + 'four' => __('Crepe', 'options_check'), + 'five' => __('Waffle', 'options_check') + ); + + // Multicheck Defaults + $multicheck_defaults = array( + 'one' => '1', + 'five' => '1' + ); + + // Background Defaults + $background_defaults = array( + 'color' => '', + 'image' => '', + 'repeat' => 'repeat', + 'position' => 'top center', + 'attachment'=>'scroll' ); + + // Typography Defaults + $typography_defaults = array( + 'size' => '15px', + 'face' => 'georgia', + 'style' => 'bold', + 'color' => '#bada55' ); + + // Typography Options + $typography_options = array( + 'sizes' => array( '6','12','14','16','20' ), + 'faces' => array( 'Helvetica Neue' => 'Helvetica Neue','Arial' => 'Arial' ), + 'styles' => array( 'normal' => 'Normal','bold' => 'Bold' ), + 'color' => false + ); + + // Pull all the categories into an array + $options_categories = array(); + $options_categories_obj = get_categories(); + foreach ($options_categories_obj as $category) { + $options_categories[$category->cat_ID] = $category->cat_name; + } + + // Pull all tags into an array + $options_tags = array(); + $options_tags_obj = get_tags(); + foreach ( $options_tags_obj as $tag ) { + $options_tags[$tag->term_id] = $tag->name; + } + + // Pull all the pages into an array + $options_pages = array(); + $options_pages_obj = get_pages('sort_column=post_parent,menu_order'); + $options_pages[''] = 'Select a page:'; + foreach ($options_pages_obj as $page) { + $options_pages[$page->ID] = $page->post_title; + } + + // If using image radio buttons, define a directory path + $imagepath = get_template_directory_uri() . '/images/'; + + $options = array(); + + $options[] = array( + 'name' => __('Basic Settings', 'options_check'), + 'type' => 'heading'); + + $options[] = array( + 'name' => __('Input Text Mini', 'options_check'), + 'desc' => __('A mini text input field.', 'options_check'), + 'id' => 'example_text_mini', + 'std' => 'Default', + 'class' => 'mini', + 'type' => 'text'); + + $options[] = array( + 'name' => __('Input Text', 'options_check'), + 'desc' => __('A text input field.', 'options_check'), + 'id' => 'example_text', + 'std' => 'Default Value', + 'type' => 'text'); + + $options[] = array( + 'name' => __('Textarea', 'options_check'), + 'desc' => __('Textarea description.', 'options_check'), + 'id' => 'example_textarea', + 'std' => 'Default Text', + 'type' => 'textarea'); + + $options[] = array( + 'name' => __('Input Select Small', 'options_check'), + 'desc' => __('Small Select Box.', 'options_check'), + 'id' => 'example_select', + 'std' => 'three', + 'type' => 'select', + 'class' => 'mini', //mini, tiny, small + 'options' => $test_array); + + $options[] = array( + 'name' => __('Input Select Wide', 'options_check'), + 'desc' => __('A wider select box.', 'options_check'), + 'id' => 'example_select_wide', + 'std' => 'two', + 'type' => 'select', + 'options' => $test_array); + + $options[] = array( + 'name' => __('Select a Category', 'options_check'), + 'desc' => __('Passed an array of categories with cat_ID and cat_name', 'options_check'), + 'id' => 'example_select_categories', + 'type' => 'select', + 'options' => $options_categories); + + $options[] = array( + 'name' => __('Select a Tag', 'options_check'), + 'desc' => __('Passed an array of tags with term_id and term_name', 'options_check'), + 'id' => 'example_select_tags', + 'type' => 'select', + 'options' => $options_tags); + + $options[] = array( + 'name' => __('Select a Page', 'options_check'), + 'desc' => __('Passed an pages with ID and post_title', 'options_check'), + 'id' => 'example_select_pages', + 'type' => 'select', + 'options' => $options_pages); + + $options[] = array( + 'name' => __('Input Radio (one)', 'options_check'), + 'desc' => __('Radio select with default options "one".', 'options_check'), + 'id' => 'example_radio', + 'std' => 'one', + 'type' => 'radio', + 'options' => $test_array); + + $options[] = array( + 'name' => __('Example Info', 'options_check'), + 'desc' => __('This is just some example information you can put in the panel.', 'options_check'), + 'type' => 'info'); + + $options[] = array( + 'name' => __('Input Checkbox', 'options_check'), + 'desc' => __('Example checkbox, defaults to true.', 'options_check'), + 'id' => 'example_checkbox', + 'std' => '1', + 'type' => 'checkbox'); + + $options[] = array( + 'name' => __('Advanced Settings', 'options_check'), + 'type' => 'heading'); + + $options[] = array( + 'name' => __('Check to Show a Hidden Text Input', 'options_check'), + 'desc' => __('Click here and see what happens.', 'options_check'), + 'id' => 'example_showhidden', + 'type' => 'checkbox'); + + $options[] = array( + 'name' => __('Hidden Text Input', 'options_check'), + 'desc' => __('This option is hidden unless activated by a checkbox click.', 'options_check'), + 'id' => 'example_text_hidden', + 'std' => 'Hello', + 'class' => 'hidden', + 'type' => 'text'); + + $options[] = array( + 'name' => __('Uploader Test', 'options_check'), + 'desc' => __('This creates a full size uploader that previews the image.', 'options_check'), + 'id' => 'example_uploader', + 'type' => 'upload'); + + $options[] = array( + 'name' => "Example Image Selector", + 'desc' => "Images for layout.", + 'id' => "example_images", + 'std' => "2c-l-fixed", + 'type' => "images", + 'options' => array( + '1col-fixed' => $imagepath . '1col.png', + '2c-l-fixed' => $imagepath . '2cl.png', + '2c-r-fixed' => $imagepath . '2cr.png') + ); + + $options[] = array( + 'name' => __('Example Background', 'options_check'), + 'desc' => __('Change the background CSS.', 'options_check'), + 'id' => 'example_background', + 'std' => $background_defaults, + 'type' => 'background' ); + + $options[] = array( + 'name' => __('Multicheck', 'options_check'), + 'desc' => __('Multicheck description.', 'options_check'), + 'id' => 'example_multicheck', + 'std' => $multicheck_defaults, // These items get checked by default + 'type' => 'multicheck', + 'options' => $multicheck_array); + + $options[] = array( + 'name' => __('Colorpicker', 'options_check'), + 'desc' => __('No color selected by default.', 'options_check'), + 'id' => 'example_colorpicker', + 'std' => '', + 'type' => 'color' ); + + $options[] = array( 'name' => __('Typography', 'options_check'), + 'desc' => __('Example typography.', 'options_check'), + 'id' => "example_typography", + 'std' => $typography_defaults, + 'type' => 'typography' ); + + $options[] = array( + 'name' => __('Custom Typography', 'options_check'), + 'desc' => __('Custom typography options.', 'options_check'), + 'id' => "custom_typography", + 'std' => $typography_defaults, + 'type' => 'typography', + 'options' => $typography_options ); + + $options[] = array( + 'name' => __('Text Editor', 'options_check'), + 'type' => 'heading' ); + + /** + * For $settings options see: + * http://codex.wordpress.org/Function_Reference/wp_editor + * + * 'media_buttons' are not supported as there is no post to attach items to + * 'textarea_name' is set by the 'id' you choose + */ + + $wp_editor_settings = array( + 'wpautop' => true, // Default + 'textarea_rows' => 5, + 'tinymce' => array( 'plugins' => 'wordpress' ) + ); + + $options[] = array( + 'name' => __('Default Text Editor', 'options_check'), + 'desc' => sprintf( __( 'You can also pass settings to the editor. Read more about wp_editor in the WordPress codex', 'options_check' ), 'http://codex.wordpress.org/Function_Reference/wp_editor' ), + 'id' => 'example_editor', + 'type' => 'editor', + 'settings' => $wp_editor_settings ); + + return $options; +} \ No newline at end of file diff --git a/inc/options-framework/options-check/screenshot.png b/inc/options-framework/options-check/screenshot.png new file mode 100755 index 0000000..5f12989 Binary files /dev/null and b/inc/options-framework/options-check/screenshot.png differ diff --git a/inc/options-framework/options-check/style.css b/inc/options-framework/options-check/style.css new file mode 100755 index 0000000..6381a3f --- /dev/null +++ b/inc/options-framework/options-check/style.css @@ -0,0 +1,44 @@ +/* +Theme Name: Options Check +Theme URI: http://wptheming.com +Description: A example/test theme to make sure all the options work in the Options Framework plugin. +Author: Devin Price +Author URI: http://wptheming.com +Version: 1.6 +*/ + +body { + background:#eee; +} + +body, input, textarea { + color: #373737; + font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 300; + line-height: 1.625; +} + +p { + margin:0 0 10px 0; +} + +h1, h2, h3 { + margin:0 0 10px 0; +} + +#page { + background:#fff; + min-width:440px; + max-width:740px; + width:60%; + margin:20px auto; +} + +header { + background:#dedede; + padding:30px 40px; +} + +.entry-content { + padding:20px 40px; +} \ No newline at end of file diff --git a/inc/options-framework/options-framework.php b/inc/options-framework/options-framework.php new file mode 100755 index 0000000..bc3f3e8 --- /dev/null +++ b/inc/options-framework/options-framework.php @@ -0,0 +1,573 @@ +ID; + if ( ! get_user_meta($user_id, 'optionsframework_ignore_notice') ) { + echo '

    '; + printf( __('Your current theme does not have support for the Options Framework plugin. Learn More | Hide Notice', 'optionsframework'), 'http://wptheming.com/options-framework-plugin', '?optionsframework_nag_ignore=0'); + echo "

    "; + } + } +} + +function optionsframework_nag_ignore() { + global $current_user; + $user_id = $current_user->ID; + if ( isset( $_GET['optionsframework_nag_ignore'] ) && '0' == $_GET['optionsframework_nag_ignore'] ) { + add_user_meta( $user_id, 'optionsframework_ignore_notice', 'true', true ); + } +} + +/* Register plugin activation hooks */ + +register_activation_hook( __FILE__,'optionsframework_activation_hook' ); + +function optionsframework_activation_hook() { + register_uninstall_hook( __FILE__, 'optionsframework_delete_options' ); +} + +/* When uninstalled, deletes options */ + +register_uninstall_hook( __FILE__, 'optionsframework_delete_options' ); + +function optionsframework_delete_options() { + + $optionsframework_settings = get_option( 'optionsframework' ); + + // Each theme saves its data in a seperate option, which all gets deleted + $knownoptions = $optionsframework_settings['knownoptions']; + if ( $knownoptions ) { + foreach ( $knownoptions as $key ) { + delete_option( $key ); + } + } + delete_option( 'optionsframework' ); + delete_user_meta( $user_id, 'optionsframework_ignore_notice', 'true' ); +} + +/* Loads the file for option sanitization */ + +add_action( 'init', 'optionsframework_load_sanitization' ); + +function optionsframework_load_sanitization() { + require_once dirname( __FILE__ ) . '/options-sanitize.php'; +} + +/* + * The optionsframework_init loads all the required files and registers the settings. + * + * Read more about the Settings API in the WordPress codex: + * http://codex.wordpress.org/Settings_API + * + * The theme options are saved using a unique option id in the database. Developers + * traditionally set the option id via in theme using the function + * optionsframework_option_name, but it can also be set using a hook of the same name. + * + * If a theme developer doesn't explictly set the unique option id using one of those + * functions it will be set by default to: optionsframework_[the theme name] + * + */ + +function optionsframework_init() { + + // Include the required files + require_once dirname( __FILE__ ) . '/options-interface.php'; + require_once dirname( __FILE__ ) . '/options-media-uploader.php'; + + // Optionally Loads the options file from the theme + $location = apply_filters( 'options_framework_location', array( 'options.php' ) ); + $optionsfile = locate_template( $location ); + + // Load settings + $optionsframework_settings = get_option( 'optionsframework' ); + + // Updates the unique option id in the database if it has changed + if ( function_exists( 'optionsframework_option_name' ) ) { + optionsframework_option_name(); + } + elseif ( has_action( 'optionsframework_option_name' ) ) { + do_action( 'optionsframework_option_name' ); + } + // If the developer hasn't explicitly set an option id, we'll use a default + else { + $default_themename = get_option( 'stylesheet' ); + $default_themename = preg_replace("/\W/", "_", strtolower($default_themename) ); + $default_themename = 'optionsframework_' . $default_themename; + if ( isset( $optionsframework_settings['id'] ) ) { + if ( $optionsframework_settings['id'] == $default_themename ) { + // All good, using default theme id + } else { + $optionsframework_settings['id'] = $default_themename; + update_option( 'optionsframework', $optionsframework_settings ); + } + } + else { + $optionsframework_settings['id'] = $default_themename; + update_option( 'optionsframework', $optionsframework_settings ); + } + } + + // If the option has no saved data, load the defaults + if ( ! get_option( $optionsframework_settings['id'] ) ) { + optionsframework_setdefaults(); + } + + // Registers the settings fields and callback + register_setting( 'optionsframework', $optionsframework_settings['id'], 'optionsframework_validate' ); + // Change the capability required to save the 'optionsframework' options group. + add_filter( 'option_page_capability_optionsframework', 'optionsframework_page_capability' ); +} + +/** + * Ensures that a user with the 'edit_theme_options' capability can actually set the options + * See: http://core.trac.wordpress.org/ticket/14365 + * + * @param string $capability The capability used for the page, which is manage_options by default. + * @return string The capability to actually use. + */ + +function optionsframework_page_capability( $capability ) { + return 'edit_theme_options'; +} + +/* + * Adds default options to the database if they aren't already present. + * May update this later to load only on plugin activation, or theme + * activation since most people won't be editing the options.php + * on a regular basis. + * + * http://codex.wordpress.org/Function_Reference/add_option + * + */ + +function optionsframework_setdefaults() { + + $optionsframework_settings = get_option( 'optionsframework' ); + + // Gets the unique option id + $option_name = $optionsframework_settings['id']; + + /* + * Each theme will hopefully have a unique id, and all of its options saved + * as a separate option set. We need to track all of these option sets so + * it can be easily deleted if someone wishes to remove the plugin and + * its associated data. No need to clutter the database. + * + */ + + if ( isset( $optionsframework_settings['knownoptions'] ) ) { + $knownoptions = $optionsframework_settings['knownoptions']; + if ( !in_array( $option_name, $knownoptions ) ) { + array_push( $knownoptions, $option_name ); + $optionsframework_settings['knownoptions'] = $knownoptions; + update_option( 'optionsframework', $optionsframework_settings); + } + } else { + $newoptionname = array($option_name); + $optionsframework_settings['knownoptions'] = $newoptionname; + update_option('optionsframework', $optionsframework_settings); + } + + // Gets the default options data from the array in options.php + $options =& _optionsframework_options(); + + // If the options haven't been added to the database yet, they are added now + $values = of_get_default_values(); + + if ( isset($values) ) { + add_option( $option_name, $values ); // Add option with default settings + } +} + +/* Define menu options (still limited to appearance section) + * + * Examples usage: + * + * add_filter( 'optionsframework_menu', function($menu) { + * $menu['page_title'] = 'Hello Options'; + * $menu['menu_title'] = 'Hello Options'; + * return $menu; + * }); +*/ + +function optionsframework_menu_settings() { + + $menu = array( + 'page_title' => __( 'Theme Options', 'optionsframework'), + 'menu_title' => __('Theme Options', 'optionsframework'), + 'capability' => 'edit_theme_options', + 'menu_slug' => 'options-framework', + 'callback' => 'optionsframework_page' + ); + + return apply_filters( 'optionsframework_menu', $menu ); +} + +/* Add a subpage called "Theme Options" to the appearance menu. */ + +function optionsframework_add_page() { + + $menu = optionsframework_menu_settings(); + $of_page = add_theme_page( $menu['page_title'], $menu['menu_title'], $menu['capability'], $menu['menu_slug'], $menu['callback'] ); + + // Load the required CSS and javscript + add_action( 'admin_enqueue_scripts', 'optionsframework_load_scripts' ); + add_action( 'admin_print_styles-' . $of_page, 'optionsframework_load_styles' ); +} + +/* Loads the CSS */ + +function optionsframework_load_styles() { + wp_enqueue_style( 'optionsframework', OPTIONS_FRAMEWORK_URL.'css/optionsframework.css' ); + if ( !wp_style_is( 'wp-color-picker','registered' ) ) { + wp_register_style('wp-color-picker', OPTIONS_FRAMEWORK_URL.'css/color-picker.min.css'); + } + wp_enqueue_style( 'wp-color-picker' ); +} + +/* Loads the javascript */ + +function optionsframework_load_scripts( $hook ) { + + $menu = optionsframework_menu_settings(); + + if ( 'appearance_page_' . $menu['menu_slug'] != $hook ) + return; + + // Enqueue colorpicker scripts for versions below 3.5 for compatibility + if ( !wp_script_is( 'wp-color-picker', 'registered' ) ) { + wp_register_script( 'iris', OPTIONS_FRAMEWORK_URL . 'js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); + wp_register_script( 'wp-color-picker', OPTIONS_FRAMEWORK_URL . 'js/color-picker.min.js', array( 'jquery', 'iris' ) ); + $colorpicker_l10n = array( + 'clear' => __( 'Clear' ), + 'defaultString' => __( 'Default' ), + 'pick' => __( 'Select Color' ) + ); + wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', $colorpicker_l10n ); + } + + // Enqueue custom option panel JS + wp_enqueue_script( 'options-custom', OPTIONS_FRAMEWORK_URL . 'js/options-custom.js', array( 'jquery','wp-color-picker' ) ); + + // Inline scripts from options-interface.php + add_action( 'admin_head', 'of_admin_head' ); +} + +function of_admin_head() { + // Hook to add custom scripts + do_action( 'optionsframework_custom_scripts' ); +} + +/* + * Builds out the options panel. + * + * If we were using the Settings API as it was likely intended we would use + * do_settings_sections here. But as we don't want the settings wrapped in a table, + * we'll call our own custom optionsframework_fields. See options-interface.php + * for specifics on how each individual field is generated. + * + * Nonces are provided using the settings_fields() + * + */ + +if ( !function_exists( 'optionsframework_page' ) ) : +function optionsframework_page() { ?> + +
    + + + + + +
    +
    +
    + + +
    + + +
    +
    +
    +
    +
    + +
    + + $value ) { + $input[$id][$key] = false; + } + } + + // For a value to be submitted to database it must pass through a sanitization filter + if ( has_filter( 'of_sanitize_' . $option['type'] ) ) { + $clean[$id] = apply_filters( 'of_sanitize_' . $option['type'], $input[$id], $option ); + } + } + + // Hook to run after validation + do_action( 'optionsframework_after_validate', $clean ); + + return $clean; +} + +/** + * Display message when options have been saved + */ + +function optionsframework_save_options_notice() { + add_settings_error( 'options-framework', 'save_options', __( 'Options saved.', 'optionsframework' ), 'updated fade' ); +} + +add_action( 'optionsframework_after_validate', 'optionsframework_save_options_notice' ); + +/** + * Format Configuration Array. + * + * Get an array of all default values as set in + * options.php. The 'id','std' and 'type' keys need + * to be defined in the configuration array. In the + * event that these keys are not present the option + * will not be included in this function's output. + * + * @return array Rey-keyed options configuration array. + * + * @access private + */ + +function of_get_default_values() { + $output = array(); + $config =& _optionsframework_options(); + foreach ( (array) $config as $option ) { + if ( ! isset( $option['id'] ) ) { + continue; + } + if ( ! isset( $option['std'] ) ) { + continue; + } + if ( ! isset( $option['type'] ) ) { + continue; + } + if ( has_filter( 'of_sanitize_' . $option['type'] ) ) { + $output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option ); + } + } + return $output; +} + +/** + * Add Theme Options menu item to Admin Bar. + */ + +function optionsframework_adminbar() { + + global $wp_admin_bar; + + $wp_admin_bar->add_menu( array( + 'parent' => 'appearance', + 'id' => 'of_theme_options', + 'title' => __( 'Theme Options', 'optionsframework' ), + 'href' => admin_url( 'themes.php?page=options-framework' ) + )); +} + +/** + * Get Option. + * + * Helper function to return the theme option value. + * If no value has been saved, it returns $default. + * Needed because options are saved as serialized strings. + */ + +if ( ! function_exists( 'of_get_option' ) ) : + + function of_get_option( $name, $default = false ) { + $config = get_option( 'optionsframework' ); + + if ( ! isset( $config['id'] ) ) { + return $default; + } + + $options = get_option( $config['id'] ); + + if ( isset( $options[$name] ) ) { + return $options[$name]; + } + + return $default; + } + +endif; + +/** + * Wrapper for optionsframework_options() + * + * Allows for manipulating or setting options via 'of_options' filter + * For example: + * + * + * add_filter('of_options', function($options) { + * $options[] = array( + * 'name' => 'Input Text Mini', + * 'desc' => 'A mini text input field.', + * 'id' => 'example_text_mini', + * 'std' => 'Default', + * 'class' => 'mini', + * 'type' => 'text' + * ); + * + * return $options; + * }); + * + * + * Also allows for setting options via a return statement in the + * options.php file. For example (in options.php): + * + * + * return array(...); + * + * + * @return array (by reference) + */ +function &_optionsframework_options() { + static $options = null; + + if ( !$options ) { + // Load options from options.php file (if it exists) + $location = apply_filters( 'options_framework_location', array('options.php') ); + if ( $optionsfile = locate_template( $location ) ) { + $maybe_options = require_once $optionsfile; + if (is_array($maybe_options)) { + $options = $maybe_options; + } else if ( function_exists( 'optionsframework_options' ) ) { + $options = optionsframework_options(); + } + } + + // Allow setting/manipulating options via filters + $options = apply_filters('of_options', $options); + } + + return $options; +} \ No newline at end of file diff --git a/inc/options-framework/options-interface.php b/inc/options-framework/options-interface.php new file mode 100755 index 0000000..1212e61 --- /dev/null +++ b/inc/options-framework/options-interface.php @@ -0,0 +1,409 @@ +' . esc_html( $value['name'] ) . ''; + } + } + + return $menu; +} + +/** + * Generates the options fields that are used in the form. + */ + +function optionsframework_fields() { + + global $allowedtags; + $optionsframework_settings = get_option( 'optionsframework' ); + + // Gets the unique option id + if ( isset( $optionsframework_settings['id'] ) ) { + $option_name = $optionsframework_settings['id']; + } + else { + $option_name = 'optionsframework'; + }; + + $settings = get_option($option_name); + $options =& _optionsframework_options(); + + $counter = 0; + $menu = ''; + + foreach ( $options as $value ) { + + $val = ''; + $select_value = ''; + $output = ''; + + // Wrap all options + if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) { + + // Keep all ids lowercase with no spaces + $value['id'] = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($value['id']) ); + + $id = 'section-' . $value['id']; + + $class = 'section'; + if ( isset( $value['type'] ) ) { + $class .= ' section-' . $value['type']; + } + if ( isset( $value['class'] ) ) { + $class .= ' ' . $value['class']; + } + + $output .= '
    '."\n"; + if ( isset( $value['name'] ) ) { + $output .= '

    ' . esc_html( $value['name'] ) . '

    ' . "\n"; + } + if ( $value['type'] != 'editor' ) { + $output .= '
    ' . "\n" . '
    ' . "\n"; + } + else { + $output .= '
    ' . "\n" . '
    ' . "\n"; + } + } + + // Set default value to $val + if ( isset( $value['std'] ) ) { + $val = $value['std']; + } + + // If the option is already saved, ovveride $val + if ( ( $value['type'] != 'heading' ) && ( $value['type'] != 'info') ) { + if ( isset( $settings[($value['id'])]) ) { + $val = $settings[($value['id'])]; + // Striping slashes of non-array options + if ( !is_array($val) ) { + $val = stripslashes( $val ); + } + } + } + + // If there is a description save it for labels + $explain_value = ''; + if ( isset( $value['desc'] ) ) { + $explain_value = $value['desc']; + } + + if ( has_filter( 'optionsframework_' . $value['type'] ) ) { + $output .= apply_filters( 'optionsframework_' . $value['type'], $option_name, $value, $val ); + } + + + switch ( $value['type'] ) { + + // Basic text input + case 'text': + $output .= ''; + break; + + // Password input + case 'password': + $output .= ''; + break; + + // Textarea + case 'textarea': + $rows = '8'; + + if ( isset( $value['settings']['rows'] ) ) { + $custom_rows = $value['settings']['rows']; + if ( is_numeric( $custom_rows ) ) { + $rows = $custom_rows; + } + } + + $val = stripslashes( $val ); + $output .= ''; + break; + + // Select Box + case 'select': + $output .= ''; + break; + + + // Radio Box + case "radio": + $name = $option_name .'['. $value['id'] .']'; + foreach ($value['options'] as $key => $option) { + $id = $option_name . '-' . $value['id'] .'-'. $key; + $output .= ''; + } + break; + + // Image Selectors + case "images": + $name = $option_name .'['. $value['id'] .']'; + foreach ( $value['options'] as $key => $option ) { + $selected = ''; + if ( $val != '' && ($val == $key) ) { + $selected = ' of-radio-img-selected'; + } + $output .= ''; + $output .= '
    ' . esc_html( $key ) . '
    '; + $output .= '' . $option .''; + } + break; + + // Checkbox + case "checkbox": + $output .= ''; + $output .= ''; + break; + + // Multicheck + case "multicheck": + foreach ($value['options'] as $key => $option) { + $checked = ''; + $label = $option; + $option = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($key)); + + $id = $option_name . '-' . $value['id'] . '-'. $option; + $name = $option_name . '[' . $value['id'] . '][' . $option .']'; + + if ( isset($val[$option]) ) { + $checked = checked($val[$option], 1, false); + } + + $output .= ''; + } + break; + + // Color picker + case "color": + $default_color = ''; + if ( isset($value['std']) ) { + if ( $val != $value['std'] ) + $default_color = ' data-default-color="' .$value['std'] . '" '; + } + $output .= ''; + + break; + + // Uploader + case "upload": + $output .= optionsframework_uploader( $value['id'], $val, null ); + + break; + + // Typography + case 'typography': + + unset( $font_size, $font_style, $font_face, $font_color ); + + $typography_defaults = array( + 'size' => '', + 'face' => '', + 'style' => '', + 'color' => '' + ); + + $typography_stored = wp_parse_args( $val, $typography_defaults ); + + $typography_options = array( + 'sizes' => of_recognized_font_sizes(), + 'faces' => of_recognized_font_faces(), + 'styles' => of_recognized_font_styles(), + 'color' => true + ); + + if ( isset( $value['options'] ) ) { + $typography_options = wp_parse_args( $value['options'], $typography_options ); + } + + // Font Size + if ( $typography_options['sizes'] ) { + $font_size = ''; + } + + // Font Face + if ( $typography_options['faces'] ) { + $font_face = ''; + } + + // Font Styles + if ( $typography_options['styles'] ) { + $font_style = ''; + } + + // Font Color + if ( $typography_options['color'] ) { + $default_color = ''; + if ( isset($value['std']['color']) ) { + if ( $val != $value['std']['color'] ) + $default_color = ' data-default-color="' .$value['std']['color'] . '" '; + } + $font_color = ''; + } + + // Allow modification/injection of typography fields + $typography_fields = compact( 'font_size', 'font_face', 'font_style', 'font_color' ); + $typography_fields = apply_filters( 'of_typography_fields', $typography_fields, $typography_stored, $option_name, $value ); + $output .= implode( '', $typography_fields ); + + break; + + // Background + case 'background': + + $background = $val; + + // Background Color + $default_color = ''; + if ( isset( $value['std']['color'] ) ) { + if ( $val != $value['std']['color'] ) + $default_color = ' data-default-color="' .$value['std']['color'] . '" '; + } + $output .= ''; + + // Background Image + if ( !isset($background['image']) ) { + $background['image'] = ''; + } + + $output .= optionsframework_uploader( $value['id'], $background['image'], null, esc_attr( $option_name . '[' . $value['id'] . '][image]' ) ); + + $class = 'of-background-properties'; + if ( '' == $background['image'] ) { + $class .= ' hide'; + } + $output .= '
    '; + + // Background Repeat + $output .= ''; + + // Background Position + $output .= ''; + + // Background Attachment + $output .= ''; + $output .= '
    '; + + break; + + // Editor + case 'editor': + $output .= '
    ' . wp_kses( $explain_value, $allowedtags ) . '
    '."\n"; + echo $output; + $textarea_name = esc_attr( $option_name . '[' . $value['id'] . ']' ); + $default_editor_settings = array( + 'textarea_name' => $textarea_name, + 'media_buttons' => false, + 'tinymce' => array( 'plugins' => 'wordpress' ) + ); + $editor_settings = array(); + if ( isset( $value['settings'] ) ) { + $editor_settings = $value['settings']; + } + $editor_settings = array_merge( $default_editor_settings, $editor_settings ); + wp_editor( $val, $value['id'], $editor_settings ); + $output = ''; + break; + + // Info + case "info": + $id = ''; + $class = 'section'; + if ( isset( $value['id'] ) ) { + $id = 'id="' . esc_attr( $value['id'] ) . '" '; + } + if ( isset( $value['type'] ) ) { + $class .= ' section-' . $value['type']; + } + if ( isset( $value['class'] ) ) { + $class .= ' ' . $value['class']; + } + + $output .= '
    ' . "\n"; + if ( isset($value['name']) ) { + $output .= '

    ' . esc_html( $value['name'] ) . '

    ' . "\n"; + } + if ( $value['desc'] ) { + $output .= apply_filters('of_sanitize_info', $value['desc'] ) . "\n"; + } + $output .= '
    ' . "\n"; + break; + + // Heading for Navigation + case "heading": + $counter++; + if ( $counter >= 2 ) { + $output .= '
    '."\n"; + } + $class = ''; + $class = ! empty( $value['id'] ) ? $value['id'] : $value['name']; + $class = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($class) ); + $output .= '
    '; + $output .= '

    ' . esc_html( $value['name'] ) . '

    ' . "\n"; + break; + } + + if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) { + $output .= '
    '; + if ( ( $value['type'] != "checkbox" ) && ( $value['type'] != "editor" ) ) { + $output .= '
    ' . wp_kses( $explain_value, $allowedtags) . '
    '."\n"; + } + $output .= '
    '."\n"; + } + + echo $output; + } + echo '
    '; +} \ No newline at end of file diff --git a/inc/options-framework/options-media-uploader.php b/inc/options-framework/options-media-uploader.php new file mode 100755 index 0000000..6b45846 --- /dev/null +++ b/inc/options-framework/options-media-uploader.php @@ -0,0 +1,113 @@ +' . "\n"; + if ( function_exists( 'wp_enqueue_media' ) ) { + if ( ( $value == '' ) ) { + $output .= '' . "\n"; + } else { + $output .= '' . "\n"; + } + } else { + $output .= '

    ' . __( 'Upgrade your version of WordPress for full media support.', 'optionsframework' ) . '

    '; + } + + if ( $_desc != '' ) { + $output .= '' . $_desc . '' . "\n"; + } + + $output .= '
    ' . "\n"; + + if ( $value != '' ) { + $remove = 'Remove'; + $image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value ); + if ( $image ) { + $output .= '' . $remove; + } else { + $parts = explode( "/", $value ); + for( $i = 0; $i < sizeof( $parts ); ++$i ) { + $title = $parts[$i]; + } + + // No output preview if it's not an image. + $output .= ''; + + // Standard generic output if it's not an image. + $title = __( 'View File', 'optionsframework' ); + $output .= ''; + } + } + $output .= '
    ' . "\n"; + return $output; +} + +endif; + +/** + * Enqueue scripts for file uploader + */ + +if ( ! function_exists( 'optionsframework_media_scripts' ) ) : + +function optionsframework_media_scripts( $hook ) { + + $menu = optionsframework_menu_settings(); + + if ( 'appearance_page_' . $menu['menu_slug'] != $hook ) + return; + + if ( function_exists( 'wp_enqueue_media' ) ) + wp_enqueue_media(); + wp_register_script( 'of-media-uploader', OPTIONS_FRAMEWORK_URL .'js/media-uploader.js', array( 'jquery' ) ); + wp_enqueue_script( 'of-media-uploader' ); + wp_localize_script( 'of-media-uploader', 'optionsframework_l10n', array( + 'upload' => __( 'Upload', 'optionsframework' ), + 'remove' => __( 'Remove', 'optionsframework' ) + ) ); +} + +add_action( 'admin_enqueue_scripts', 'optionsframework_media_scripts' ); + +endif; diff --git a/inc/options-framework/options-sanitize.php b/inc/options-framework/options-sanitize.php new file mode 100755 index 0000000..848d716 --- /dev/null +++ b/inc/options-framework/options-sanitize.php @@ -0,0 +1,380 @@ + $value ) { + $output[$key] = false; + } + foreach( $input as $key => $value ) { + if ( array_key_exists( $key, $option['options'] ) && $value ) { + $output[$key] = "1"; + } + } + } + return $output; +} +add_filter( 'of_sanitize_multicheck', 'of_sanitize_multicheck', 10, 2 ); + +/* Color Picker */ + +add_filter( 'of_sanitize_color', 'of_sanitize_hex' ); + +/* Uploader */ + +function of_sanitize_upload( $input ) { + $output = ''; + $filetype = wp_check_filetype($input); + if ( $filetype["ext"] ) { + $output = $input; + } + return $output; +} +add_filter( 'of_sanitize_upload', 'of_sanitize_upload' ); + +/* Editor */ + +function of_sanitize_editor($input) { + if ( current_user_can( 'unfiltered_html' ) ) { + $output = $input; + } + else { + global $allowedtags; + $output = wpautop(wp_kses( $input, $allowedtags)); + } + return $output; +} +add_filter( 'of_sanitize_editor', 'of_sanitize_editor' ); + +/* Allowed Tags */ + +function of_sanitize_allowedtags($input) { + global $allowedtags; + $output = wpautop(wp_kses( $input, $allowedtags)); + return $output; +} + +/* Allowed Post Tags */ + +function of_sanitize_allowedposttags($input) { + global $allowedposttags; + $output = wpautop(wp_kses( $input, $allowedposttags)); + return $output; +} + +add_filter( 'of_sanitize_info', 'of_sanitize_allowedposttags' ); + + +/* Check that the key value sent is valid */ + +function of_sanitize_enum( $input, $option ) { + $output = ''; + if ( array_key_exists( $input, $option['options'] ) ) { + $output = $input; + } + return $output; +} + +/* Background */ + +function of_sanitize_background( $input ) { + $output = wp_parse_args( $input, array( + 'color' => '', + 'image' => '', + 'repeat' => 'repeat', + 'position' => 'top center', + 'attachment' => 'scroll' + ) ); + + $output['color'] = apply_filters( 'of_sanitize_hex', $input['color'] ); + $output['image'] = apply_filters( 'of_sanitize_upload', $input['image'] ); + $output['repeat'] = apply_filters( 'of_background_repeat', $input['repeat'] ); + $output['position'] = apply_filters( 'of_background_position', $input['position'] ); + $output['attachment'] = apply_filters( 'of_background_attachment', $input['attachment'] ); + + return $output; +} +add_filter( 'of_sanitize_background', 'of_sanitize_background' ); + +function of_sanitize_background_repeat( $value ) { + $recognized = of_recognized_background_repeat(); + if ( array_key_exists( $value, $recognized ) ) { + return $value; + } + return apply_filters( 'of_default_background_repeat', current( $recognized ) ); +} +add_filter( 'of_background_repeat', 'of_sanitize_background_repeat' ); + +function of_sanitize_background_position( $value ) { + $recognized = of_recognized_background_position(); + if ( array_key_exists( $value, $recognized ) ) { + return $value; + } + return apply_filters( 'of_default_background_position', current( $recognized ) ); +} +add_filter( 'of_background_position', 'of_sanitize_background_position' ); + +function of_sanitize_background_attachment( $value ) { + $recognized = of_recognized_background_attachment(); + if ( array_key_exists( $value, $recognized ) ) { + return $value; + } + return apply_filters( 'of_default_background_attachment', current( $recognized ) ); +} +add_filter( 'of_background_attachment', 'of_sanitize_background_attachment' ); + + +/* Typography */ + +function of_sanitize_typography( $input, $option ) { + + $output = wp_parse_args( $input, array( + 'size' => '', + 'face' => '', + 'style' => '', + 'color' => '' + ) ); + + if ( isset( $option['options']['faces'] ) && isset( $input['face'] ) ) { + if ( !( array_key_exists( $input['face'], $option['options']['faces'] ) ) ) { + $output['face'] = ''; + } + } + else { + $output['face'] = apply_filters( 'of_font_face', $output['face'] ); + } + + $output['size'] = apply_filters( 'of_font_size', $output['size'] ); + $output['style'] = apply_filters( 'of_font_style', $output['style'] ); + $output['color'] = apply_filters( 'of_sanitize_color', $output['color'] ); + return $output; +} +add_filter( 'of_sanitize_typography', 'of_sanitize_typography', 10, 2 ); + +function of_sanitize_font_size( $value ) { + $recognized = of_recognized_font_sizes(); + $value_check = preg_replace('/px/','', $value); + if ( in_array( (int) $value_check, $recognized ) ) { + return $value; + } + return apply_filters( 'of_default_font_size', $recognized ); +} +add_filter( 'of_font_size', 'of_sanitize_font_size' ); + + +function of_sanitize_font_style( $value ) { + $recognized = of_recognized_font_styles(); + if ( array_key_exists( $value, $recognized ) ) { + return $value; + } + return apply_filters( 'of_default_font_style', current( $recognized ) ); +} +add_filter( 'of_font_style', 'of_sanitize_font_style' ); + + +function of_sanitize_font_face( $value ) { + $recognized = of_recognized_font_faces(); + if ( array_key_exists( $value, $recognized ) ) { + return $value; + } + return apply_filters( 'of_default_font_face', current( $recognized ) ); +} +add_filter( 'of_font_face', 'of_sanitize_font_face' ); + +/** + * Get recognized background repeat settings + * + * @return array + * + */ +function of_recognized_background_repeat() { + $default = array( + 'no-repeat' => __('No Repeat', 'optionsframework'), + 'repeat-x' => __('Repeat Horizontally', 'optionsframework'), + 'repeat-y' => __('Repeat Vertically', 'optionsframework'), + 'repeat' => __('Repeat All', 'optionsframework'), + ); + return apply_filters( 'of_recognized_background_repeat', $default ); +} + +/** + * Get recognized background positions + * + * @return array + * + */ +function of_recognized_background_position() { + $default = array( + 'top left' => __('Top Left', 'optionsframework'), + 'top center' => __('Top Center', 'optionsframework'), + 'top right' => __('Top Right', 'optionsframework'), + 'center left' => __('Middle Left', 'optionsframework'), + 'center center' => __('Middle Center', 'optionsframework'), + 'center right' => __('Middle Right', 'optionsframework'), + 'bottom left' => __('Bottom Left', 'optionsframework'), + 'bottom center' => __('Bottom Center', 'optionsframework'), + 'bottom right' => __('Bottom Right', 'optionsframework') + ); + return apply_filters( 'of_recognized_background_position', $default ); +} + +/** + * Get recognized background attachment + * + * @return array + * + */ +function of_recognized_background_attachment() { + $default = array( + 'scroll' => __('Scroll Normally', 'optionsframework'), + 'fixed' => __('Fixed in Place', 'optionsframework') + ); + return apply_filters( 'of_recognized_background_attachment', $default ); +} + +/** + * Sanitize a color represented in hexidecimal notation. + * + * @param string Color in hexidecimal notation. "#" may or may not be prepended to the string. + * @param string The value that this function should return if it cannot be recognized as a color. + * @return string + * + */ + +function of_sanitize_hex( $hex, $default = '' ) { + if ( of_validate_hex( $hex ) ) { + return $hex; + } + return $default; +} + +/** + * Get recognized font sizes. + * + * Returns an indexed array of all recognized font sizes. + * Values are integers and represent a range of sizes from + * smallest to largest. + * + * @return array + */ + +function of_recognized_font_sizes() { + $sizes = range( 9, 71 ); + $sizes = apply_filters( 'of_recognized_font_sizes', $sizes ); + $sizes = array_map( 'absint', $sizes ); + return $sizes; +} + +/** + * Get recognized font faces. + * + * Returns an array of all recognized font faces. + * Keys are intended to be stored in the database + * while values are ready for display in in html. + * + * @return array + * + */ +function of_recognized_font_faces() { + $default = array( + 'arial' => 'Arial', + 'verdana' => 'Verdana, Geneva', + 'trebuchet' => 'Trebuchet', + 'georgia' => 'Georgia', + 'times' => 'Times New Roman', + 'tahoma' => 'Tahoma, Geneva', + 'palatino' => 'Palatino', + 'helvetica' => 'Helvetica*' + ); + return apply_filters( 'of_recognized_font_faces', $default ); +} + +/** + * Get recognized font styles. + * + * Returns an array of all recognized font styles. + * Keys are intended to be stored in the database + * while values are ready for display in in html. + * + * @return array + * + */ +function of_recognized_font_styles() { + $default = array( + 'normal' => __( 'Normal', 'optionsframework' ), + 'italic' => __( 'Italic', 'optionsframework' ), + 'bold' => __( 'Bold', 'optionsframework' ), + 'bold italic' => __( 'Bold Italic', 'optionsframework' ) + ); + return apply_filters( 'of_recognized_font_styles', $default ); +} + +/** + * Is a given string a color formatted in hexidecimal notation? + * + * @param string Color in hexidecimal notation. "#" may or may not be prepended to the string. + * @return bool + * + */ + +function of_validate_hex( $hex ) { + $hex = trim( $hex ); + /* Strip recognized prefixes. */ + if ( 0 === strpos( $hex, '#' ) ) { + $hex = substr( $hex, 1 ); + } + elseif ( 0 === strpos( $hex, '%23' ) ) { + $hex = substr( $hex, 3 ); + } + /* Regex match. */ + if ( 0 === preg_match( '/^[0-9a-fA-F]{6}$/', $hex ) ) { + return false; + } + else { + return true; + } +} \ No newline at end of file diff --git a/inc/options-framework/options-theme-customizer/footer.php b/inc/options-framework/options-theme-customizer/footer.php new file mode 100755 index 0000000..fe1a6f7 --- /dev/null +++ b/inc/options-framework/options-theme-customizer/footer.php @@ -0,0 +1,24 @@ + + +
    + + + * tag of your theme, or you will break many plugins, which + * generally use this hook to reference JavaScript files. + */ + + wp_footer(); +?> + + diff --git a/inc/options-framework/options-theme-customizer/functions.php b/inc/options-framework/options-theme-customizer/functions.php new file mode 100755 index 0000000..0bbec28 --- /dev/null +++ b/inc/options-framework/options-theme-customizer/functions.php @@ -0,0 +1,27 @@ + +> + + +Options Check + + + + +> + +
    \ No newline at end of file diff --git a/inc/options-framework/options-theme-customizer/index.php b/inc/options-framework/options-theme-customizer/index.php new file mode 100755 index 0000000..f26b97c --- /dev/null +++ b/inc/options-framework/options-theme-customizer/index.php @@ -0,0 +1,60 @@ + + +
    + +
    +

    Options Theme Customizer

    +
    + +
    + +
    +
    type: text
    +
    +
    + +
    +
    type: select
    +
    +
    + +
    +
    type: radio
    +
    +
    + +
    +
    type: checkbox (work in progress, little bug here)
    +
    +
    + +
    +
    type: uploader
    +
    + + + +
    + +
    +
    type: colorpicker
    +
    +
    +

    +
    +
    + +
    +
    + + \ No newline at end of file diff --git a/inc/options-framework/options-theme-customizer/options.php b/inc/options-framework/options-theme-customizer/options.php new file mode 100755 index 0000000..1aae761 --- /dev/null +++ b/inc/options-framework/options-theme-customizer/options.php @@ -0,0 +1,182 @@ + "First Option", + "Second" => "Second Option", + "Third" => "Third Option" ); + + $options = array(); + + $options[] = array( "name" => "Example Settings", + "type" => "heading" ); + + $options['example_text'] = array( + "name" => "Text", + "id" => "example_text", + "std" => "Default Value", + "type" => "text" ); + + $options['example_select'] = array( + "name" => "Select Box", + "id" => "example_select", + "std" => "First", + "type" => "select", + "options" => $test_array ); + + $options['example_radio'] = array( + "name" => "Radio Buttons", + "id" => "example_radio", + "std" => "Third", + "type" => "radio", + "options" => $test_array ); + + $options['example_checkbox'] = array( + "name" => "Input Checkbox", + "desc" => "This is a work in progress. There is are some issues with how the front end customizer saves checkbox options, and how the Options Framework does. Bear with me a bit while I work on a solution.", + "id" => "example_checkbox", + "std" => "1", + "type" => "checkbox" ); + + $options['example_uploader'] = array( + "name" => "Uploader Test", + "desc" => "This creates a full size uploader that previews the image.", + "id" => "example_uploader", + "type" => "upload" ); + + $options['example_colorpicker'] = array( + "name" => "Colorpicker", + "id" => "example_colorpicker", + "std" => "#666666", + "type" => "color" ); + + return $options; +} + +/** + * Front End Customizer + * + * WordPress 3.4 Required + */ + +add_action( 'customize_register', 'options_theme_customizer_register' ); + +function options_theme_customizer_register($wp_customize) { + + /** + * This is optional, but if you want to reuse some of the defaults + * or values you already have built in the options panel, you + * can load them into $options for easy reference + */ + + $options = optionsframework_options(); + + /* Basic */ + + $wp_customize->add_section( 'options_theme_customizer_basic', array( + 'title' => __( 'Basic', 'options_theme_customizer' ), + 'priority' => 100 + ) ); + + $wp_customize->add_setting( 'options_theme_customizer[example_text]', array( + 'default' => $options['example_text']['std'], + 'type' => 'option' + ) ); + + $wp_customize->add_control( 'options_theme_customizer_example_text', array( + 'label' => $options['example_text']['name'], + 'section' => 'options_theme_customizer_basic', + 'settings' => 'options_theme_customizer[example_text]', + 'type' => $options['example_text']['type'] + ) ); + + $wp_customize->add_setting( 'options_theme_customizer[example_select]', array( + 'default' => $options['example_select']['std'], + 'type' => 'option' + ) ); + + $wp_customize->add_control( 'options_theme_customizer_example_select', array( + 'label' => $options['example_select']['name'], + 'section' => 'options_theme_customizer_basic', + 'settings' => 'options_theme_customizer[example_select]', + 'type' => $options['example_select']['type'], + 'choices' => $options['example_select']['options'] + ) ); + + $wp_customize->add_setting( 'options_theme_customizer[example_radio]', array( + 'default' => $options['example_radio']['std'], + 'type' => 'option' + ) ); + + $wp_customize->add_control( 'options_theme_customizer_example_radio', array( + 'label' => $options['example_radio']['name'], + 'section' => 'options_theme_customizer_basic', + 'settings' => 'options_theme_customizer[example_radio]', + 'type' => $options['example_radio']['type'], + 'choices' => $options['example_radio']['options'] + ) ); + + $wp_customize->add_setting( 'options_theme_customizer[example_checkbox]', array( + 'default' => $options['example_checkbox']['std'], + 'type' => 'option' + ) ); + + $wp_customize->add_control( 'options_theme_customizer_example_checkbox', array( + 'label' => $options['example_checkbox']['name'], + 'section' => 'options_theme_customizer_basic', + 'settings' => 'options_theme_customizer[example_checkbox]', + 'type' => $options['example_checkbox']['type'] + ) ); + + /* Extended */ + + $wp_customize->add_section( 'options_theme_customizer_extended', array( + 'title' => __( 'Extended', 'options_theme_customizer' ), + 'priority' => 110 + ) ); + + $wp_customize->add_setting( 'options_theme_customizer[example_uploader]', array( + 'type' => 'option' + ) ); + + $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'example_uploader', array( + 'label' => $options['example_uploader']['name'], + 'section' => 'options_theme_customizer_extended', + 'settings' => 'options_theme_customizer[example_uploader]' + ) ) ); + + $wp_customize->add_setting( 'options_theme_customizer[example_colorpicker]', array( + 'default' => $options['example_colorpicker']['std'], + 'type' => 'option' + ) ); + + $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( + 'label' => $options['example_colorpicker']['name'], + 'section' => 'options_theme_customizer_extended', + 'settings' => 'options_theme_customizer[example_colorpicker]' + ) ) ); +} \ No newline at end of file diff --git a/inc/options-framework/options-theme-customizer/screenshot.png b/inc/options-framework/options-theme-customizer/screenshot.png new file mode 100755 index 0000000..e6099ea Binary files /dev/null and b/inc/options-framework/options-theme-customizer/screenshot.png differ diff --git a/inc/options-framework/options-theme-customizer/style.css b/inc/options-framework/options-theme-customizer/style.css new file mode 100755 index 0000000..e21165d --- /dev/null +++ b/inc/options-framework/options-theme-customizer/style.css @@ -0,0 +1,53 @@ +/* +Theme Name: Options Theme Customizer +Theme URI: http://wptheming.com +Description: A demo theme that shows how the front-end theme customizer works. +Author: Devin Price +Author URI: http://wptheming.com +Version: 1.6 +*/ + +body { + background:#eee; +} + +body, input, textarea { + color: #222; + font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 300; + line-height: 1.625; +} + +p { + margin:0 0 10px 0; +} + +h1, h2, h3 { + margin:0 0 10px 0; +} + +#page { + background:#fff; + min-width:440px; + max-width:740px; + margin:20px auto; +} + +header { + background:#dedede; + padding:30px 40px; +} + +.entry-content { + padding:20px 40px; +} + +dt { + color:#666; + margin-bottom:5px; +} +dd { + clear:both; + margin:0; + font-size:1.2em; +} \ No newline at end of file diff --git a/inc/options-framework/readme.md b/inc/options-framework/readme.md new file mode 100755 index 0000000..a74a146 --- /dev/null +++ b/inc/options-framework/readme.md @@ -0,0 +1,183 @@ +## Options Framework ## + +**Tags:** options, theme options +**Requires at least:** 3.4 +**Tested up to:** 3.6 +**Stable tag:** 1.6 +**License:** GPLv2 +**Donate link:** http://bit.ly/options-donate-2 + +## Screenshot ## + +![An example of the "Advanced Options" tag in the "Options Check" theme using this plugin.](https://github.com/devinsays/options-framework-plugin/raw/master/screenshot-1.png) + +## Description ## + +The Options Framework Plugin makes it easy to include an options panel in any WordPress theme. It was built so developers can concentrate on making the actual theme rather than spending time creating an options panel from scratch. It's free to use in both commercial and personal projects, just like WordPress itself. + +### Options Include: ### + +* text input +* textarea +* checkbox +* select +* radio button +* upload (image uploader) +* images (use images instead of radio buttons) +* background (a set of options to define a background) +* multicheck +* color (a jquery color picker) +* typography (a set of options to define typography) +* editor + +### Learn More ### + +Please visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin) for a full description of how to define and use the theme options. + +### Installation ### + +If your theme already has options enabled, they will show up under the appearance menu. + +If your theme doesn't have options, you can define them to options.php of your theme and they will instantly show up. For more on how to do this, visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin). + +## Frequently Asked Questions ## + +### How do I build options for my own theme? ### + +Download the development version from GitHub [https://github.com/devinsays/options-framework-plugin](https://github.com/devinsays/options-framework-plugin) and copy the "options-check" folder into your themes directory. + +The "Options Check" theme is a blueprint for how to work with options. It includes an example of every option available in the panel and sample output in the theme. + +You can also watch the video screencast I have at [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin). + +## Change log ## + +#### 1.6.1 #### + +* Fix for update notice location +* Use selected and checked functions more consistently +* Reuse media modal for uploads + +#### 1.6 #### + +* Allow media buttons in the editor option +* JS/CSS should only load on options page +* Menu tabs should be filterable +* Menu settings filter +* Fix js bindings for upload modal (props @themeblvd) + +#### 1.5.2 #### + +* Removed update routine to remove "optionsframework" post type + +#### 1.5.1 #### + +* Temporarily removed update routine + +#### 1.5 #### + +* Updated width of text input +* New media uploader +* Dropped custom post types for file attachments +* Update routine to remove unused 'optionsframework' post types +* Updated IDs for .tabs and .groups +* Italian translations (andreabersi.com) +* Russian translations (verha.net) +* Swedish translations (kjeell.se) + +#### 1.4 #### + +* Add missing sanitization to typography color (@weplantmedia) +* New colorpicker (props @mattweibe for getting this in WordPress core) +* Farsi translations (@vahidd.com) +* Added password option type (props @neojp) +* Allow ids to passed to tabs (props @themeblvd) +* Added optionsframework_after_validate hook (h/t @vanpop and @pryley) + +#### 1.3 #### + +* Allow options to save when set by theme customizer +* Save checkbox options to boolean false rather than "0" +* Added optionsframework_after hook +* Hungarian translations by kardiweb.org + +#### 1.2 #### + +* Fix for font_size santization +* Added internationalization support (@weslly) +* Portuguese translations (@weslly) +* Spanish translations (@sksmatt) +* Make uploader post type non-public (@samargulies) +* ID can now be passed on info option for styling purposes + +#### 1.1 #### + +* Added support for wp_editor +* Updated textarea settings to allow rows parameter +* Updated cursor:default for h3 metabox, props @yurifedorov +* Filtering of typography options (@mattwiebe) +* Updated methods for typography options + +#### 1.0 #### + +* Added filters for entire options array (props @inxilpro) +* Added a filter for options.php location (props @mattwiebe) +* Option header (h4) will not display in panel if name !isset (props @alepee) + +#### 0.9 #### + +* Load thickbox using site_url() to allow for https (props @samargulies) +* Change santization to use $allowedposttags for textarea and info +* Display notice if theme doesn't support the Options Framework +* Single checkboxes now use labels +* CSS updates for formatting long labels +* Allows dashes in the options id (props @mantone) +* Uses add_theme_page over add_submenu_page (props @enile8) + +#### 0.8 #### + +* Saves tab states using local storage +* Style updates WordPress 3.2 release +* Added sanitization filter for info (of_sanitize_allowedtags) + +#### 0.7 #### + +* Added filtering for recognized arrays (like Font Face) +* Using isset rather than !empty to return of_get_option +* Significant updates for setting and restoring defaults +* Background option outputs no-repeat rather than none + +#### 0.6 #### + +* Introduces validation filters (props @_mfields) +* Better data sanitization and escaping (props @_mfields) +* Updates labels in options-interface.php +* Changes how checkboxes saved in database ("0" or "1") +* Stores typography, backgrounds and multichecks directly as arrays +* For full description, see: http://wptheming.com/2011/05/options-framework-0-6/ + +#### 0.5 #### + +* Fixed errors when more than one multicheck options is used +* Updated optionsframework_setdefaults so defaults actually save on first run +* Require that all options have lowercase alphanumeric ids +* Added link to options from the WordPress admin bar + +#### 0.4 #### + +* Updated multicheck option to save keys rather than values +* Unset default array options after each output in optionsframework_setdefaults + +#### 0.3 #### + +* White listed options for increased security +* Fixed errors with checkbox and select boxes +* Improved the multicheck option and changed format + +#### 0.2 #### + +* Uploaded to the WordPress repository + +#### 0.1 #### + +* Initial release \ No newline at end of file diff --git a/inc/options-framework/readme.txt b/inc/options-framework/readme.txt new file mode 100755 index 0000000..e757ac9 --- /dev/null +++ b/inc/options-framework/readme.txt @@ -0,0 +1,198 @@ +=== Options Framework === + +Contributors: @downstairsdev +Tags: options, theme options +Donate link: http://bit.ly/options-donate-2 +Requires at least: 3.4 +Tested up to: 3.6 +Stable tag: 1.6 +License: GPLv2 + +== Description == + +The Options Framework Plugin makes it easy to include an options panel in any WordPress theme. It was built so developers can concentrate on making the actual theme rather than spending time creating an options panel from scratch. It's free to use in both commercial and personal projects, just like WordPress itself. + += Options Include = + +* text input +* textarea +* checkbox +* select +* radio button +* upload (image uploader) +* images (use images instead of radio buttons) +* background (a set of options to define a background) +* multicheck +* color (a jquery color picker) +* typography (a set of options to define typography) +* editor + += Learn More = + +Please visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin) for a full description of how to define and use the theme options. + +== Installation == + +If your theme already has options enabled, they will show up under the appearance menu. + +If your theme doesn't have options, you can define them to options.php of your theme and they will instantly show up. For more on how to do this, visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin). + +== Frequently Asked Questions == + += How do I build options for my own theme? = + +Download the development version from GitHub [https://github.com/devinsays/options-framework-plugin](https://github.com/devinsays/options-framework-plugin) and copy the "options-check" folder into your themes directory. + +The "Options Check" theme is a blueprint for how to work with options. It includes an example of every option available in the panel and sample output in the theme. + +You can also watch the video screencast I have at [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin). + += What options are available to use? = + +* text input +* textarea +* checkbox +* select +* radio button +* upload (image uploader) +* images (use images instead of radio buttons) +* background (a set of options to define a background) +* multicheck +* color (a jquery color picker) +* typography (a set of options to define typography) + +== Screenshots == + +1. An example of the "Advanced Options" tag in the "Options Check" theme using this plugin. + +== Changelog == + += 1.6.1 = + +* Fix for update notice location +* Use selected and checked functions more consistently +* Reuse media modal for uploads + += 1.6 = + +* Allow media buttons in the editor option +* JS/CSS should only load on options page +* Menu tabs should be filterable +* Menu settings filter +* Fix js bindings for upload modal (props @themeblvd) + += 1.5.2 = + +* Removed update routine to remove "optionsframework" post type + += 1.5.1 = + +* Temporarily removed update routine + += 1.5 = + +* Updated width of text input +* New media uploader +* Dropped custom post types for file attachments +* Update routine to remove unused 'optionsframework' post types +* Updated IDs for .tabs and .groups +* Italian translations (andreabersi.com) +* Russian translations (verha.net) +* Swedish translations (kjeell.se) + += 1.4 = + +* Add missing sanitization to typography color (@weplantmedia) +* New colorpicker (props @mattweibe for getting this in WordPress core) +* Farsi translations (@vahidd.com) +* Added password option type (props @neojp) +* Allow ids to passed to tabs (props @themeblvd) +* Added optionsframework_after_validate hook (h/t @vanpop and @pryley) + += 1.3 = + +* Allow options to save when set by theme customizer +* Save checkbox options to boolean false rather than "0" +* Added optionsframework_after hook +* Hungarian translations by kardiweb.org + += 1.2 = + +* Fix for font_size santization +* Added internationalization support (@weslly) +* Portuguese translations (@weslly) +* Spanish translations (@sksmatt) +* Make uploader post type non-public (@samargulies) +* ID can now be passed on info option for styling purposes + += 1.1 = + +* Added support for wp_editor +* Updated textarea settings to allow rows parameter +* Updated cursor:default for h3 metabox, props @yurifedorov +* Filtering of typography options (@mattwiebe) +* Updated methods for typography options + += 1.0 = + +* Added filters for entire options array (props @inxilpro) +* Added a filter for options.php location (props @mattwiebe) +* Option header (h4) will not display in panel if name !isset (props @alepee) + += 0.9 = + +* Load thickbox using site_url() to allow for https (props @samargulies) +* Change santization to use $allowedposttags for textarea and info +* Display notice if theme doesn't support the Options Framework +* Single checkboxes now use labels +* CSS updates for formatting long labels +* Allows dashes in the options id (props @mantone) +* Uses add_theme_page over add_submenu_page (props @enile8) + += 0.8 = + +* Saves tab states using local storage +* Style updates WordPress 3.2 release +* Added sanitization filter for info (of_sanitize_allowedtags) + += 0.7 = + +* Added filtering for recognized arrays (like Font Face) +* Using isset rather than !empty to return of_get_option +* Significant updates for setting and restoring defaults +* Background option outputs no-repeat rather than none + += 0.6 = + +* Introduces validation filters (props @_mfields) +* Better data sanitization and escaping (props @_mfields) +* Updates labels in options-interface.php +* Changes how checkboxes saved in database ("0" or "1") +* Stores typography, backgrounds and multichecks directly as arrays +* For full description, see: http://wptheming.com/2011/05/options-framework-0-6/ + += 0.5 = + +* Fixed errors when more than one multicheck options is used +* Updated optionsframework_setdefaults so defaults actually save on first run +* Require that all options have lowercase alphanumeric ids +* Added link to options from the WordPress admin bar + += 0.4 = + +* Updated multicheck option to save keys rather than values +* Unset default array options after each output in optionsframework_setdefaults + += 0.3 = + +* White listed options for increased security +* Fixed errors with checkbox and select boxes +* Improved the multicheck option and changed format + += 0.2 = + +* Uploaded to the WordPress repository + += 0.1 = + +* Initial release \ No newline at end of file diff --git a/inc/options-framework/screenshot-1.png b/inc/options-framework/screenshot-1.png new file mode 100755 index 0000000..6d2a188 Binary files /dev/null and b/inc/options-framework/screenshot-1.png differ diff --git a/inc/plugins/nav-menu-images/inc/admin.php b/inc/plugins/nav-menu-images/inc/admin.php new file mode 100755 index 0000000..affc1e4 --- /dev/null +++ b/inc/plugins/nav-menu-images/inc/admin.php @@ -0,0 +1,275 @@ +load_textdomain(); + + // Enqueue old script + wp_enqueue_script( 'nmi-scripts', plugins_url( 'nmi.js', __FILE__ ), array( 'media-upload', 'thickbox' ), '1', true ); + wp_localize_script( 'nmi-scripts', 'nmi_vars', array( + 'alert' => __( 'You need to set an image as a featured image to be able to use it as an menu item image', 'nmi' ) + ) + ); + add_thickbox(); + + // For WP 3.5+, enqueue new script & dependicies + if ( version_compare( $wp_version, '3.5', '>=' ) ) { + wp_enqueue_media(); + wp_enqueue_script( 'nmi-media-view', plugins_url( 'media-view.js', __FILE__ ), array( 'jquery', 'media-editor', 'media-views', 'post' ), '1.0', true ); + } + + do_action( 'nmi_enqueue_scripts' ); + } + + /** + * Use custom walker for nav menu edit. + * + * @since 1.0 + * @access public + * + * @uses Nav_Menu_Images::load_textdomain() To load translations. + * + * @param string $walker Name of used walker class. + */ + public function filter_walker( $walker ) { + // Load translations + $this->load_textdomain(); + + require_once dirname( __FILE__ ) . '/walker.php'; + return 'NMI_Walker_Nav_Menu_Edit'; + } + + /** + * Output HTML for the post thumbnail meta-box. + * + * @since 2.0 + * @access public + * + * @uses get_post() To get post's object. + * @uses Nav_Menu_Images::load_textdomain() To load translations. + * @uses admin_url() To get URL of uploader. + * @uses esc_url() To escape URL. + * @uses add_query_arg() To append variables to URL. + * @uses has_post_thumbnail() To check if item has thumb. + * @uses get_the_post_thumbnail() To get item's thumb. + * @uses wp_create_nonce() To create item's nonce. + * @uses esc_html__() To translate & escape string. + * @uses apply_filters() Calls 'nmi_admin_post_thumbnail_html' to + * overwrite returned output. + * + * @param string $content Original HTML output of the thubnail. + * @param int $post_id The post ID associated with the thumbnail. + * @return string New HTML output. + */ + public function _wp_post_thumbnail_html( $content, $post_id ) { + // Check if request from this plugin + if ( ! isset( $_REQUEST['nmi_request'] ) ) + return $content; + + // Get post object + $post = get_post( $post_id ); + + // Check if post exists and is nav menu item + if ( ! $post || 'nav_menu_item' != $post->post_type ) + return $content; + + // Load translations + $this->load_textdomain(); + + // Form upload link + $upload_url = admin_url( 'media-upload.php' ); + $query_args = array( + 'post_id' => $post->ID, + 'tab' => 'gallery', + 'TB_iframe' => '1', + 'width' => '640', + 'height' => '425' + ); + $upload_url = esc_url( add_query_arg( $query_args, $upload_url ) ); + + // Item's featured image or plain link + if ( has_post_thumbnail( $post->ID ) ) + $link = get_the_post_thumbnail( $post->ID, 'thumb' ); + else + $link = __( 'Upload menu item image', 'nmi' ); + + // Full link + $content = '' . $link . ''; + + // If item didn't have image, prepend actions links + if ( isset( $_REQUEST['thumb_was'] ) && -1 == $_REQUEST['thumb_was'] ) { + $link_text = __( 'Change menu item image', 'nmi' ); + $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID ); + $remove_link = ' | ' . esc_html__( 'Remove menu item image', 'nmi' ) . ''; + + $actions = '' . $link_text . '' . $remove_link; + + $content = $actions . $content; + } + + // Filter returned HTML output + return apply_filters( 'nmi_admin_post_thumbnail_html', $content, $post->ID ); + } + + /** + * Display hover & active image checkboxes. + * + * @since 3.0 + * @access public + * + * @uses Nav_Menu_Images::load_textdomain() To load translations. + * @uses get_post_meta() To get item's hover & active images IDs. + * @uses checked() To set proper checkbox status. + * @uses apply_filters() Calls 'nmi_attachment_fields_to_edit' to + * overwrite returned form fields. + * + * @param array $form_fields Original attachment form fields. + * @param object $post The post object data of attachment. + * @return string New attachment form fields. + */ + function attachment_fields_to_edit( $form_fields, $post ) { + // Display only for images + if ( ! wp_attachment_is_image( $post->ID ) ) + return $form_fields; + + // Display only for nav menu items + if ( 'nav_menu_item' != get_post_type( $post->post_parent ) ) + return $form_fields; + + // Load translations + $this->load_textdomain(); + + // Add "hover" checkbox + $parent_hover_id = get_post_meta( $post->post_parent, '_nmi_hover', true ); + $is_hover = ( $parent_hover_id == $post->ID ) ? true : false; + $is_hover_checked = checked( $is_hover, true, false ); + + $form_fields['nmihover'] = array( + 'label' => __( 'Used on hover?', 'nmi' ), + 'input' => 'html', + 'html' => "", + 'value' => $is_hover, + 'helps' => __( 'Should this image be used on hover', 'nmi' ), + 'show_in_edit' => false + ); + + // Add "active" checkbox + $parent_active_id = get_post_meta( $post->post_parent, '_nmi_active', true ); + $is_active = ( $parent_active_id == $post->ID ) ? true : false; + $is_active_checked = checked( $is_active, true, false ); + + $form_fields['nmiactive'] = array( + 'label' => __( 'Used when active?', 'nmi' ), + 'input' => 'html', + 'html' => "", + 'value' => $is_active, + 'helps' => __( 'Should this image be used when menu item is active', 'nmi' ), + 'show_in_edit' => false + ); + + // Filter returned HTML output + return apply_filters( 'nmi_attachment_fields_to_edit', $form_fields, $post ); + } + + /** + * Save hover & active image checkboxes submissions. + * + * @since 3.0 + * @access public + * + * @uses update_post_meta() To save new item's hover or active images IDs. + * @uses delete_post_meta() To delete old item's hover or active images IDs. + * + * @param object $post The post object data of attachment. + * @param array $attachment Submitted data of attachment. + * @return object $post The post object data of attachment. + */ + function attachment_fields_to_save( $post, $attachment ) { + // Save "hover" checkbox + if ( 'on' == $attachment['nmihover'] ) + update_post_meta( $post['post_parent'], '_nmi_hover', $post['ID'] ); + else + delete_post_meta( $post['post_parent'], '_nmi_hover', $post['ID'] ); + + // Save "active" checkbox + if ( 'on' == $attachment['nmiactive'] ) + update_post_meta( $post['post_parent'], '_nmi_active', $post['ID'] ); + else + delete_post_meta( $post['post_parent'], '_nmi_active', $post['ID'] ); + + return $post; + } +} diff --git a/inc/plugins/nav-menu-images/inc/media-view.js b/inc/plugins/nav-menu-images/inc/media-view.js new file mode 100755 index 0000000..34a9ce2 --- /dev/null +++ b/inc/plugins/nav-menu-images/inc/media-view.js @@ -0,0 +1,104 @@ +/** + * Nav Menu Images Media View. + * + * @since 2.0 + * + * @package Nav Menu Images + * @subpackage Media View + */ +jQuery(document).ready(function($){ + // Prepare the variable that holds our custom media manager. + // Based on wp.media.featuredImage + wp.media.nmi = { + get: function() { + return wp.media.view.settings.post.featuredImageId; + }, + + set: function( id ) { + var settings = wp.media.view.settings; + + settings.post.featuredImageId = id; + + wp.media.post( 'set-post-thumbnail', { + json: true, + post_id: settings.post.id, + thumbnail_id: settings.post.featuredImageId, + _wpnonce: settings.post.nonce, + thumb_was: settings.post.featuredExisted, + nmi_request: true + }).done( function( html ) { + if ( 1 == settings.post.featuredExisted ) + $( '.nmi-upload-link', "li#menu-item-"+settings.post.id ).show(); + else + $( '.nmi-upload-link', "li#menu-item-"+settings.post.id ).hide(); + $( '.nmi-current-image', "li#menu-item-"+settings.post.id ).html( html ); + }); + }, + + frame: function() { + if ( this._frame ) + return this._frame; + + this._frame = wp.media({ + state: 'featured-image', + states: [ new wp.media.controller.FeaturedImage() ] + }); + + this._frame.on( 'toolbar:create:featured-image', function( toolbar ) { + this.createSelectToolbar( toolbar, { + text: wp.media.view.l10n.setFeaturedImage + }); + }, this._frame ); + + this._frame.state('featured-image').on( 'select', this.select ); + return this._frame; + }, + + select: function() { + var settings = wp.media.view.settings, + selection = this.get('selection').single(); + + if ( ! settings.post.featuredImageId ) + return; + + wp.media.nmi.set( selection ? selection.id : -1 ); + }, + + init: function() { + // Open the content media manager to the 'featured image' tab when + // the post thumbnail is clicked. + $('.nmi-div').on( 'click', '.add_media', function( event ) { + event.preventDefault(); + // Stop propagation to prevent thickbox from activating. + event.stopPropagation(); + + var nmi_clicked_item_id = $(this).data('id'); + wp.media.view.settings = nmi_settings[nmi_clicked_item_id]; + + wp.media.nmi.frame().open(); + // Update the featured image id when the 'remove' link is clicked. + }).on( 'click', '.nmi_remove', function() { + var nmi_clicked_item_id = $(this).data('id'); + nmi_settings[nmi_clicked_item_id].post.featuredImageId = -1; + }); + } + }; + + $( wp.media.nmi.init ); + + // Based on WPRemoveThumbnail + NMIRemoveThumbnail = function(nonce,post_id){ + $.post(ajaxurl, { + action:"set-post-thumbnail", post_id: post_id, thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie), nmi_request: true + }, function(str){ + if ( str == '0' ) { + alert( setPostThumbnailL10n.error ); + } else { + $( '.nmi-upload-link', "li#menu-item-"+post_id ).hide(); + $( '.nmi-current-image', "li#menu-item-"+post_id ).html( str ); + } + } + ); + }; + +}); \ No newline at end of file diff --git a/inc/plugins/nav-menu-images/inc/nmi.js b/inc/plugins/nav-menu-images/inc/nmi.js new file mode 100755 index 0000000..e90f448 --- /dev/null +++ b/inc/plugins/nav-menu-images/inc/nmi.js @@ -0,0 +1,54 @@ +/** + * Display thumb when set as featured. + * + * Overwritess built in function. + */ +function WPSetThumbnailID( id ) { + tb_remove(); + jQuery.post( ajaxurl, { + action: "nmi_added_thumbnail", + thumbnail_id: id, + post_id: window.clicked_item_id + }, function( response ) { + jQuery("li#menu-item-"+window.clicked_item_id+" .nmi-current-image").html( response ); + tb_remove(); + } + ); +}; + +function WPSetThumbnailHTML( html ) { +}; + +jQuery( document ).ready( function( $ ) { + // Get all menu items + var items = $("ul#menu-to-edit li.menu-item"); + + // Go through all items and display link & thumb + for ( var i = 0; i < items.length; i++ ) { + var id = $(items[i]).children("#nmi_item_id").val(); + + var sibling = $("#edit-menu-item-attr-title-"+id).parent().parent(); + var image_div = $("li#menu-item-"+id+" .nmi-current-image"); + var link_div = $("li#menu-item-"+id+" .nmi-upload-link"); + + if ( image_div ) { + sibling.after( image_div ); + image_div.show(); + } + if ( link_div ) { + sibling.after( link_div ); + link_div.show(); + } + } + + // Save item ID on click on a link + $(".nmi-upload-link").click( function() { + window.clicked_item_id = $(this).parent().parent().children("#nmi_item_id").val(); + } ); + + // Display alert when not added as featured + window.send_to_editor = function( html ) { + alert(nmi_vars.alert); + tb_remove(); + }; +} ); \ No newline at end of file diff --git a/inc/plugins/nav-menu-images/inc/walker.php b/inc/plugins/nav-menu-images/inc/walker.php new file mode 100755 index 0000000..c948eda --- /dev/null +++ b/inc/plugins/nav-menu-images/inc/walker.php @@ -0,0 +1,198 @@ +ID; + + // Form upload link + $upload_url = admin_url( 'media-upload.php' ); + $query_args = array( + 'post_id' => $item_id, + 'tab' => 'gallery', + 'TB_iframe' => '1', + 'width' => '640', + 'height' => '425' + ); + $upload_url = esc_url( add_query_arg( $query_args, $upload_url ) ); + + // Hidden field with item's ID + $output .= ''; + + // Generate menu item image & link's text string + if ( has_post_thumbnail( $item_id ) ) { + $post_thumbnail = get_the_post_thumbnail( $item_id, 'thumb' ); + $output .= ''; + $link_text = __( 'Change menu item image', 'nmi' ); + + // For WP 3.5+, add 'remove' action link + if ( version_compare( $wp_version, '3.5', '>=' ) ) { + $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $item_id ); + $remove_link = ' | ' . esc_html__( 'Remove menu item image', 'nmi' ) . ''; + } + } else { + $output .= ''; + $link_text = __( 'Upload menu item image', 'nmi' ); + } + + // Append menu item upload link + $output .= ''; + + // Filter output + do_action_ref_array( 'nmi_menu_item_walker_output', array( &$output, $item, $depth, $args ) ); + + // Add JSONed meta data + $output .= $this->get_settings( $item_id ); + + do_action_ref_array( 'nmi_menu_item_walker_end', array( &$output, $item, $depth, $args ) ); + } + + /** + * Get JSONed item's data. + * + * Heavily based on wp_enqueue_media() and + * WP_Scripts::localize() + * + * @see wp_enqueue_media() + * @see WP_Scripts::localize() + * + * @since 2.0 + * @access public + * + * @uses version_compare() To compare WordPress versions. + * @uses wp_create_nonce() To create item's nonce. + * @uses get_post() To get post's object. + * @uses get_post_meta() To get post's meta data. + * @uses apply_filters() Calls 'media_view_settings' with the settings + * and post object to overwrite item's settings. + * @uses did_action() To check if action was done. + * @uses do_action() Calls 'nmi_setup_settings_var' with the item ID. + * + * @param int $post_id The item's post ID. + * @return string New HTML output. + */ + public function get_settings( $post_id ) { + global $wp_version; + + // Only works for WP 3.5+ + if ( ! version_compare( $wp_version, '3.5', '>=' ) ) + return; + + // Prepare general settings + $settings = array( + 'nonce' => array( + 'sendToEditor' => wp_create_nonce( 'media-send-to-editor' ), + ), + 'post' => array( + 'id' => 0, + ), + 'defaultProps' => array( + 'link' => get_option( 'image_default_link_type' ), // db default is 'file' + 'align' => get_option( 'image_default_align' ), // empty default + 'size' => get_option( 'image_default_size' ), // empty default + ) + ); + + // Prepare post specific settings + $post = null; + if ( isset( $post_id ) ) { + $post = get_post( $post_id ); + $settings['post'] = array( + 'id' => $post->ID, + 'nonce' => wp_create_nonce( 'update-post_' . $post->ID ), + ); + + $featured_image_id = get_post_meta( $post->ID, '_thumbnail_id', true ); + $settings['post']['featuredImageId'] = $featured_image_id ? $featured_image_id : -1; + $settings['post']['featuredExisted'] = $featured_image_id ? 1 : -1; + } + + // Filter item's settins + $settings = apply_filters( 'media_view_settings', $settings, $post ); + + // Prepare Javascript varible name + $object_name = 'nmi_settings[' . $post->ID . ']'; + + // Loop through each setting and prepare it for JSON + foreach ( (array) $settings as $key => $value ) { + if ( ! is_scalar( $value ) ) + continue; + + $settings[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' ); + } + + // Encode settings to JSON + $script = "$object_name = " . json_encode( $settings ) . ';'; + + // If this is first item, register variable + if ( ! did_action( 'nmi_setup_settings_var' ) ) { + $script = "var nmi_settings = [];\n" . $script; + do_action( 'nmi_setup_settings_var', $post->ID ); + } + + // Wrap everythig + $output = "\n"; + + return $output; + } +} \ No newline at end of file diff --git a/inc/plugins/nav-menu-images/languages/nmi-sr_RS.mo b/inc/plugins/nav-menu-images/languages/nmi-sr_RS.mo new file mode 100755 index 0000000..eb4acc5 Binary files /dev/null and b/inc/plugins/nav-menu-images/languages/nmi-sr_RS.mo differ diff --git a/inc/plugins/nav-menu-images/languages/nmi-sr_RS.po b/inc/plugins/nav-menu-images/languages/nmi-sr_RS.po new file mode 100755 index 0000000..a297b02 --- /dev/null +++ b/inc/plugins/nav-menu-images/languages/nmi-sr_RS.po @@ -0,0 +1,77 @@ +# Translation of Nav Menu Images in Serbian +# This file is distributed under the same license as the Nav Menu Images package. +msgid "" +msgstr "" +"Project-Id-Version: Nav Menu Images\n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/nav-menu-images\n" +"POT-Creation-Date: 2013-03-26 16:01:26+00:00\n" +"PO-Revision-Date: 2013-03-26 17:04+0100\n" +"Last-Translator: Milan Dinić \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 1.5.5\n" + +#: inc/admin.php:83 +msgid "" +"You need to set an image as a featured image to be able to use it as an menu " +"item image" +msgstr "" +"Потребно је да поставите слику као одабрану да бисте могли да је користите " +"као слику ставке изборника" + +#: inc/admin.php:167 inc/walker.php:84 +msgid "Upload menu item image" +msgstr "Отпреми слику ставке изборника" + +#: inc/admin.php:174 inc/walker.php:75 +msgid "Change menu item image" +msgstr "Промени слику ставке изборника" + +#: inc/admin.php:176 inc/walker.php:80 +msgid "Remove menu item image" +msgstr "Уклони слику ставке изборника" + +#: inc/admin.php:221 +msgid "Used on hover?" +msgstr "Користи се приликом преласка?" + +#: inc/admin.php:225 +msgid "Should this image be used on hover" +msgstr "Да ли би ова слика требало да се користи приликом преласка" + +#: inc/admin.php:235 +msgid "Used when active?" +msgstr "Користи је када је активна?" + +#: inc/admin.php:239 +msgid "Should this image be used when menu item is active" +msgstr "" +"Да ли би ова слика требало да се користи када је ставка изборника активна" + +#: nav-menu-images.php:320 +msgid "Donate" +msgstr "Донирај" + +#. Plugin Name of the plugin/theme +msgid "Nav Menu Images" +msgstr "Слике у изборнику кретања" + +#. Plugin URI of the plugin/theme +msgid "http://blog.milandinic.com/wordpress/plugins/nav-menu-images/" +msgstr "http://blog.milandinic.com/wordpress/plugins/nav-menu-images/" + +#. Description of the plugin/theme +msgid "Display image as a menu content." +msgstr "Прикажите слику као садржај ставке изборника." + +#. Author of the plugin/theme +msgid "Milan Dinić" +msgstr "Милан Динић" + +#. Author URI of the plugin/theme +msgid "http://blog.milandinic.com/" +msgstr "http://www.milandinic.com/" diff --git a/inc/plugins/nav-menu-images/languages/nmi.pot b/inc/plugins/nav-menu-images/languages/nmi.pot new file mode 100755 index 0000000..f77fe3f --- /dev/null +++ b/inc/plugins/nav-menu-images/languages/nmi.pot @@ -0,0 +1,71 @@ +# Copyright (C) 2013 Nav Menu Images +# This file is distributed under the same license as the Nav Menu Images package. +msgid "" +msgstr "" +"Project-Id-Version: Nav Menu Images 3.0\n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/nav-menu-images\n" +"POT-Creation-Date: 2013-03-26 16:01:26+00:00\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" + +#: inc/admin.php:83 +msgid "" +"You need to set an image as a featured image to be able to use it as an menu " +"item image" +msgstr "" + +#: inc/admin.php:167 inc/walker.php:84 +msgid "Upload menu item image" +msgstr "" + +#: inc/admin.php:174 inc/walker.php:75 +msgid "Change menu item image" +msgstr "" + +#: inc/admin.php:176 inc/walker.php:80 +msgid "Remove menu item image" +msgstr "" + +#: inc/admin.php:221 +msgid "Used on hover?" +msgstr "" + +#: inc/admin.php:225 +msgid "Should this image be used on hover" +msgstr "" + +#: inc/admin.php:235 +msgid "Used when active?" +msgstr "" + +#: inc/admin.php:239 +msgid "Should this image be used when menu item is active" +msgstr "" + +#: nav-menu-images.php:320 +msgid "Donate" +msgstr "" + +#. Plugin Name of the plugin/theme +msgid "Nav Menu Images" +msgstr "" + +#. Plugin URI of the plugin/theme +msgid "http://blog.milandinic.com/wordpress/plugins/nav-menu-images/" +msgstr "" + +#. Description of the plugin/theme +msgid "Display image as a menu content." +msgstr "" + +#. Author of the plugin/theme +msgid "Milan Dinić" +msgstr "" + +#. Author URI of the plugin/theme +msgid "http://blog.milandinic.com/" +msgstr "" diff --git a/inc/plugins/nav-menu-images/nav-menu-images.php b/inc/plugins/nav-menu-images/nav-menu-images.php new file mode 100755 index 0000000..1f75cd8 --- /dev/null +++ b/inc/plugins/nav-menu-images/nav-menu-images.php @@ -0,0 +1,336 @@ +plugin_basename = plugin_basename( __FILE__ ); + } + + /** + * Register actions & filters on init. + * + * @since 1.0 + * @access public + * + * @uses add_post_type_support() To enable thumbs for nav menu. + * @uses is_admin() To see if it's admin area. + * @uses Nav_Menu_Images_Admin() To call admin functions. + * @uses add_action() To hook function. + * @uses apply_filters() Calls 'nmi_filter_menu_item_content' to + * overwrite menu item filter. + * @uses add_filter() To hook filters. + * @uses do_action() Calls 'nmi_init'. + */ + public function init() { + // Add thumbnail support to menus + add_post_type_support( 'nav_menu_item', 'thumbnail' ); + + // Load admin file + if ( is_admin() ) { + require_once dirname( __FILE__ ) . '/inc/admin.php'; + new Nav_Menu_Images_Admin(); + } + + // Register AJAX handler + add_action( 'wp_ajax_nmi_added_thumbnail', array( &$this, 'ajax_added_thumbnail' ) ); + + // Register menu item content filter if needed + if ( apply_filters( 'nmi_filter_menu_item_content', true ) ) { + add_filter( 'nav_menu_css_class', array( &$this, 'register_menu_item_filter' ), 15, 3 ); + add_filter( 'walker_nav_menu_start_el', array( &$this, 'deregister_menu_item_filter' ), 15, 2 ); + } + + // Register plugins action links filter + add_filter( 'plugin_action_links_' . $this->plugin_basename, array( $this, 'action_links' ) ); + add_filter( 'network_admin_plugin_action_links_' . $this->plugin_basename, array( $this, 'action_links' ) ); + + do_action( 'nmi_init' ); + } + + /** + * Load textdomain for internationalization. + * + * @since 1.0 + * @access public + * + * @uses is_textdomain_loaded() To check if translation is loaded. + * @uses load_plugin_textdomain() To load translation file. + * @uses plugin_basename() To get plugin's file name. + */ + public function load_textdomain() { + /* If translation isn't loaded, load it */ + if ( ! is_textdomain_loaded( 'nmi' ) ) + load_plugin_textdomain( 'nmi', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); + } + + /** + * Return thumbnail's HTML after addition. + * + * @since 1.0 + * @access public + * + * @uses absint() To get positive integer. + * @uses has_post_thumbnail() To check if item has thumb. + * @uses admin_url() To get URL of uploader. + * @uses esc_url() To escape URL. + * @uses add_query_arg() To append variables to URL. + * @uses get_the_post_thumbnail() To get item's thumb. + */ + public function ajax_added_thumbnail() { + // Get submitted values + $post_id = isset( $_POST[ 'post_id' ] ) ? absint( $_POST[ 'post_id' ] ) : 0; + $thumbnail_id = isset( $_POST[ 'thumbnail_id' ] ) ? absint( $_POST[ 'thumbnail_id' ] ) : 0; + + // If there aren't values, exit + if ( 0 == $post_id || 0 == $thumbnail_id ) + die( '0' ); + + // If there isn't featured image, exit + if ( ! has_post_thumbnail( $post_id ) ) + die( '1' ); + + // Form upload link + $upload_url = admin_url( 'media-upload.php' ); + $query_args = array( + 'post_id' => $post_id, + 'tab' => 'gallery', + 'TB_iframe' => '1', + 'width' => '640', + 'height' => '425' + ); + $upload_url = esc_url( add_query_arg( $query_args, $upload_url ) ); + + // Item's featured image + $post_thumbnail = get_the_post_thumbnail( $post_id, 'thumb' ); + + // Full HTML + $return_html = '' . $post_thumbnail . ''; + + die( $return_html ); + } + + /** + * Display an image as menu item content. + * + * @since 1.0 + * @access public + * + * @uses has_post_thumbnail() To check if item has thumb. + * @uses apply_filters() Calls 'nmi_menu_item_content' to + * filter outputted content. + * @uses get_the_post_thumbnail() To get item's thumb. + * + * @param string $content Item's content + * @param int $item_id Item's ID + * @return string $content Item's content + */ + public function menu_item_content( $content, $item_id ) { + if ( has_post_thumbnail( $item_id ) ) + $content = apply_filters( 'nmi_menu_item_content', get_the_post_thumbnail( $item_id, 'full', array( 'alt' => $content, 'title' => $content ) ), $item_id, $content ); + + return $content; + } + + /** + * Display a hover image for menu item image. + * + * @since 3.0 + * @access public + * + * Thanks {@link http://www.webmasterworld.com/forum21/6615.htm} + * + * @uses get_post_meta() To get item's hover & active images IDs. + * @uses wp_get_attachment_image_src() To get hover image's data. + * @uses apply_filters() Calls 'nmi_menu_item_hover' to + * filter returned attributes. + * + * @param array $attr Image's attributes. + * @param object $attachment Image's post object data. + * @return array $attr New image's attributes. + */ + public function menu_item_hover( $attr, $attachment ) { + if ( ( $hover_id = get_post_meta( $attachment->post_parent, '_nmi_hover', true ) ) && ! ( $this->is_current_item && get_post_meta( $attachment->post_parent, '_nmi_active', true ) ) ) { + $image = wp_get_attachment_image_src( $hover_id, 'full', false ); + $url = $image[0]; + $src = $attr['src']; + $attr['onmouseover'] = 'this.src=\'' . $url . '\''; + $attr['onmouseout'] = 'this.src=\'' . $src . '\''; + + $attr = apply_filters( 'nmi_menu_item_hover', $attr, $attachment ); + } + + return $attr; + } + + /** + * Display an active image for menu item. + * + * @since 3.0 + * @access public + * + * @uses get_post_meta() To get item's active image ID. + * @uses wp_get_attachment_image_src() To get active image's data. + * @uses apply_filters() Calls 'nmi_menu_item_active' to + * filter returned attributes. + * + * @param array $attr Image's attributes. + * @param object $attachment Image's post object data. + * @return array $attr New image's attributes. + */ + public function menu_item_active( $attr, $attachment ) { + if ( $this->is_current_item && ( $active_id = get_post_meta( $attachment->post_parent, '_nmi_active', true ) ) ) { + $image = wp_get_attachment_image_src( $active_id, 'full', false ); + $url = $image[0]; + $attr['src'] = $url; + + $attr = apply_filters( 'nmi_menu_item_active', $attr, $attachment ); + } + + return $attr; + } + + /** + * Register menu item content filter. + * + * Also check if menu item is of + * currently displayed page. + * + * @since 1.0 + * @access public + * + * @uses has_post_thumbnail() To check if item has thumb. + * @uses add_filter() To hook filter. + * + * @param array $item_classes Item's classes. + * @param object $item Menu item data object. + * @param object $args Item's arguments. + * @return array $item_classes Item's classes. + */ + public function register_menu_item_filter( $item_classes, $item, $args ) { + if ( has_post_thumbnail( $item->ID ) ) { + // Register filters + add_filter( 'the_title', array( &$this, 'menu_item_content' ), 15, 2 ); + add_filter( 'wp_get_attachment_image_attributes', array( &$this, 'menu_item_hover' ), 15, 2 ); + add_filter( 'wp_get_attachment_image_attributes', array( &$this, 'menu_item_active' ), 15, 2 ); + + // Mark current item status + if ( in_array( 'current-menu-item', $item_classes ) ) + $this->is_current_item = true; + else + $this->is_current_item = false; + } + + return $item_classes; + } + + /** + * Deregister menu item content filter. + * + * @since 1.0 + * @access public + * + * @uses remove_filter() To unhook filter. + * + * @param string $item_output Item's content + * @param object $item Menu item data object. + * @return string $item_output Item's content + */ + public function deregister_menu_item_filter( $item_output, $item ) { + remove_filter( 'the_title', array( &$this, 'menu_item_content' ), 15, 2 ); + remove_filter( 'wp_get_attachment_image_attributes', array( &$this, 'menu_item_hover' ), 15, 2 ); + remove_filter( 'wp_get_attachment_image_attributes', array( &$this, 'menu_item_active' ), 15, 2 ); + + return $item_output; + } + + /** + * Add action links to plugins page. + * + * @since 1.0 + * @access public + * + * @uses Nav_Menu_Images::load_textdomain() To load translations. + * + * @param array $link Plugin's action links. + * @return array $link Plugin's action links. + */ + public function action_links( $links ) { + // Load translations + $this->load_textdomain(); + + $links['donate'] = '' . __( 'Donate', 'nmi' ) . ''; + return $links; + } +} + +/** + * Initialize a plugin. + * + * Load class when all plugins are loaded + * so that other plugins can overwrite it. + * + * @since 1.0 + * + * @uses Nav_Menu_Images To initialize plugin. + */ + diff --git a/inc/plugins/nav-menu-images/readme.txt b/inc/plugins/nav-menu-images/readme.txt new file mode 100755 index 0000000..3c9b8b2 --- /dev/null +++ b/inc/plugins/nav-menu-images/readme.txt @@ -0,0 +1,55 @@ +=== Nav Menu Images === +Contributors: dimadin +Donate link: http://blog.milandinic.com/donate/ +Tags: nav menu, menu, media, image +Requires at least: 3.1 +Tested up to: 3.5.1 +Stable tag: 3.0 + +Display image as a menu item content. + +== Description == + +[Plugin homepage](http://blog.milandinic.com/wordpress/plugins/nav-menu-images/) | [Plugin author](http://blog.milandinic.com/) | [Donate](http://blog.milandinic.com/donate/) + +This plugin enables you to upload images for nav menu items on a menu edit screen. By default, those images will be displayed instead of text for respective menu items. Note that after upload, you should set an image as 'featured' to be able to display it. + +You can also set images that will be displayed only when you hover menu item, or when menu item is of currently displayed page. See screenshots to get an idea how to do this. + +Developers can use many available filters to make their own way of displaying images, or even create a child class on top of base one. See source code for more ideas. + +Although this plugin displays uploaded images out of the box, it will probably not give best possible look, so it's recommended to create custom CSS styles for affected elements. + +Nav Menu Images code is partly based on a code from now defunct plugin Custom Menu Images by [Anabelle Handdoek +](http://huellaspyp.com/)/[∞manos s.a.s](http://8manos.com/) and a code from plugin [Metronet Profile Picture](http://wordpress.org/extend/plugins/metronet-profile-picture/) by [Ronald Huereca](http://www.ronalfy.com/)/[Metronet Norge AS](http://www.metronet.no/). + +== Installation == + +Either install the plugin via the WordPress admin panel, or ... + +1. Upload `nav-menu-images` folder to the `/wp-content/plugins/` directory +2. Activate the plugin through the 'Plugins' menu in WordPress + +There are no configuration options in this plugin. + +== Screenshots == + +1. Link to upload form on nav menu item's edit screen +2. Setting featured image from media modal screen +3. Uploaded image on nav menu item's edit screen +4. Setting image used on hover from media modal screen + +== Changelog == + += 3.0 = +* Released on 26th March 2013 +* Add support for active and hover menu item images + += 2.0 = +* Released on 11th February 2013 +* Use new media views for WordPress 3.5+ +* Add more hooks for developers + += 1.0 = +* Released on 22nd October 2012 +* Initial release \ No newline at end of file diff --git a/inc/template-tags.php b/inc/template-tags.php new file mode 100755 index 0000000..c4fde65 --- /dev/null +++ b/inc/template-tags.php @@ -0,0 +1,174 @@ +post_parent ) : get_adjacent_post( false, '', true ); + $next = get_adjacent_post( false, '', false ); + + if ( ! $next && ! $previous ) + return; + } + + // Don't print empty markup in archives if there's only one page. + if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) + return; + + $nav_class = 'site-navigation paging-navigation'; + if ( is_single() ) + $nav_class = 'site-navigation post-navigation'; + + ?> +
    ', '%title ' . _x( '→', 'Next post link', 'symbol' ) . '' ); ?> + + max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?> + + + + + + + + + + +
    + + comment_type ) : + case 'pingback' : + case 'trackback' : + ?> +
  • +

    + +
  • id="li-comment-"> +
    +
    +
    + + says:', 'symbol' ), sprintf( '%s', get_comment_author_link() ) ); ?> +
    + comment_approved == '0' ) : ?> + +
    + + + +
    + +
    + +
    + $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> +
    +
    + + ', 'symbol' ), + esc_url( get_permalink() ), + esc_attr( get_the_time() ), + esc_attr( get_the_date( 'c' ) ), + esc_html( get_the_date() ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + esc_attr( sprintf( __( 'View all posts by %s', 'symbol' ), get_the_author() ) ), + esc_html( get_the_author() ) + ); +} +endif; + +/** + * Returns true if a blog has more than 1 category + * + * @since Symbol 1.0 + */ +function symbol_categorized_blog() { + if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) { + // Create an array of all the categories that are attached to posts + $all_the_cool_cats = get_categories( array( + 'hide_empty' => 1, + ) ); + + // Count the number of categories that are attached to the posts + $all_the_cool_cats = count( $all_the_cool_cats ); + + set_transient( 'all_the_cool_cats', $all_the_cool_cats ); + } + + if ( '1' != $all_the_cool_cats ) { + // This blog has more than 1 category so symbol_categorized_blog should return true + return true; + } else { + // This blog has only 1 category so symbol_categorized_blog should return false + return false; + } +} + +/** + * Flush out the transients used in symbol_categorized_blog + * + * @since Symbol 1.0 + */ +function symbol_category_transient_flusher() { + // Like, beat it. Dig? + delete_transient( 'all_the_cool_cats' ); +} +add_action( 'edit_category', 'symbol_category_transient_flusher' ); +add_action( 'save_post', 'symbol_category_transient_flusher' ); \ No newline at end of file diff --git a/inc/tweaks.php b/inc/tweaks.php new file mode 100755 index 0000000..1351e2b --- /dev/null +++ b/inc/tweaks.php @@ -0,0 +1,52 @@ +post_parent ) && $image->post_parent != $id ) + $url .= '#main'; + + return $url; +} +add_filter( 'attachment_link', 'symbol_enhanced_image_navigation', 10, 2 ); \ No newline at end of file diff --git a/index.php b/index.php new file mode 100755 index 0000000..a06e910 --- /dev/null +++ b/index.php @@ -0,0 +1,52 @@ + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + +max_num_pages > 1 ) : ?> + + + + + \ No newline at end of file diff --git a/js/.DS_Store b/js/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/js/.DS_Store differ diff --git a/js/html5.js b/js/html5.js new file mode 100755 index 0000000..817f9b6 --- /dev/null +++ b/js/html5.js @@ -0,0 +1,6 @@ +/*! HTML5 Shiv v3.6 stable | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ +(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); +a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; +c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a"); +var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a, +b){a||(a=f);if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d + * This file could be used by goodle code to allow syntax highlight for + * Virtual AGC SVN repository or if you don't want to commonize + * the header for the agc/aea html assembly listing. + * + * @author ohommes@alumni.cmu.edu + */ + +PR['registerLangHandler']( + PR['createSimpleLexer']( + [ + // A line comment that starts with ; + [PR['PR_COMMENT'], /^#[^\r\n]*/, null, '#'], + // Whitespace + [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], + // A double quoted, possibly multi-line, string. + [PR['PR_STRING'], /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"'] + ], + [ + [PR['PR_KEYWORD'], /^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,null], + [PR['PR_TYPE'], /^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null], + // A single quote possibly followed by a word that optionally ends with + // = ! or ?. + [PR['PR_LITERAL'], + /^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/], + // Any word including labels that optionally ends with = ! or ?. + [PR['PR_PLAIN'], + /^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i], + // A printable non-space non-special character + [PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0()\"\\\';]+/] + ]), + ['apollo', 'agc', 'aea']); diff --git a/js/prettify/lang-clj.js b/js/prettify/lang-clj.js new file mode 100755 index 0000000..0758335 --- /dev/null +++ b/js/prettify/lang-clj.js @@ -0,0 +1,64 @@ +/** + * @license Copyright (C) 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileoverview + * Registers a language handler for Clojure. + * + * + * To use, include prettify.js and this file in your HTML page. + * Then put your code in an HTML tag like + *
    (my lisp code)
    + * The lang-cl class identifies the language as common lisp. + * This file supports the following language extensions: + * lang-clj - Clojure + * + * + * I used lang-lisp.js as the basis for this adding the clojure specific + * keywords and syntax. + * + * "Name" = 'Clojure' + * "Author" = 'Rich Hickey' + * "Version" = '1.2' + * "About" = 'Clojure is a lisp for the jvm with concurrency primitives and a richer set of types.' + * + * + * I used Clojure.org Reference as + * the basis for the reserved word list. + * + * + * @author jwall@google.com + */ + +PR['registerLangHandler']( + PR['createSimpleLexer']( + [ + // clojure has more paren types than minimal lisp. + ['opn', /^[\(\{\[]+/, null, '([{'], + ['clo', /^[\)\}\]]+/, null, ')]}'], + // A line comment that starts with ; + [PR['PR_COMMENT'], /^;[^\r\n]*/, null, ';'], + // Whitespace + [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], + // A double quoted, possibly multi-line, string. + [PR['PR_STRING'], /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"'] + ], + [ + // clojure has a much larger set of keywords + [PR['PR_KEYWORD'], /^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/, null], + [PR['PR_TYPE'], /^:[0-9a-zA-Z\-]+/] + ]), + ['clj']); diff --git a/js/prettify/lang-css.js b/js/prettify/lang-css.js new file mode 100755 index 0000000..034bd59 --- /dev/null +++ b/js/prettify/lang-css.js @@ -0,0 +1,78 @@ +// Copyright (C) 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * @fileoverview + * Registers a language handler for CSS. + * + * + * To use, include prettify.js and this file in your HTML page. + * Then put your code in an HTML tag like + *
    
    + *
    + *
    + * http://www.w3.org/TR/CSS21/grammar.html Section G2 defines the lexical
    + * grammar.  This scheme does not recognize keywords containing escapes.
    + *
    + * @author mikesamuel@gmail.com
    + */
    +
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer'](
    +        [
    +         // The space production 
    +         [PR['PR_PLAIN'],       /^[ \t\r\n\f]+/, null, ' \t\r\n\f']
    +        ],
    +        [
    +         // Quoted strings.   and 
    +         [PR['PR_STRING'],
    +          /^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/, null],
    +         [PR['PR_STRING'],
    +          /^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/, null],
    +         ['lang-css-str', /^url\(([^\)\"\']*)\)/i],
    +         [PR['PR_KEYWORD'],
    +          /^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,
    +          null],
    +         // A property name -- an identifier followed by a colon.
    +         ['lang-css-kw', /^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],
    +         // A C style block comment.  The  production.
    +         [PR['PR_COMMENT'], /^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],
    +         // Escaping text spans
    +         [PR['PR_COMMENT'], /^(?:)/],
    +         // A number possibly containing a suffix.
    +         [PR['PR_LITERAL'], /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],
    +         // A hex color
    +         [PR['PR_LITERAL'], /^#(?:[0-9a-f]{3}){1,2}/i],
    +         // An identifier
    +         [PR['PR_PLAIN'],
    +          /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],
    +         // A run of punctuation
    +         [PR['PR_PUNCTUATION'], /^[^\s\w\'\"]+/]
    +        ]),
    +    ['css']);
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer']([],
    +        [
    +         [PR['PR_KEYWORD'],
    +          /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]
    +        ]),
    +    ['css-kw']);
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer']([],
    +        [
    +         [PR['PR_STRING'], /^[^\)\"\']+/]
    +        ]),
    +    ['css-str']);
    diff --git a/js/prettify/lang-go.js b/js/prettify/lang-go.js
    new file mode 100755
    index 0000000..f329e29
    --- /dev/null
    +++ b/js/prettify/lang-go.js
    @@ -0,0 +1,58 @@
    +// Copyright (C) 2010 Google Inc.
    +//
    +// Licensed under the Apache License, Version 2.0 (the "License");
    +// you may not use this file except in compliance with the License.
    +// You may obtain a copy of the License at
    +//
    +//      http://www.apache.org/licenses/LICENSE-2.0
    +//
    +// Unless required by applicable law or agreed to in writing, software
    +// distributed under the License is distributed on an "AS IS" BASIS,
    +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +// See the License for the specific language governing permissions and
    +// limitations under the License.
    +
    +
    +
    +/**
    + * @fileoverview
    + * Registers a language handler for the Go language..
    + * 

    + * Based on the lexical grammar at + * http://golang.org/doc/go_spec.html#Lexical_elements + *

    + * Go uses a minimal style for highlighting so the below does not distinguish + * strings, keywords, literals, etc. by design. + * From a discussion with the Go designers: + *

    + * On Thursday, July 22, 2010, Mike Samuel <...> wrote:
    + * > On Thu, Jul 22, 2010, Rob 'Commander' Pike <...> wrote:
    + * >> Personally, I would vote for the subdued style godoc presents at http://golang.org
    + * >>
    + * >> Not as fancy as some like, but a case can be made it's the official style.
    + * >> If people want more colors, I wouldn't fight too hard, in the interest of
    + * >> encouragement through familiarity, but even then I would ask to shy away
    + * >> from technicolor starbursts.
    + * >
    + * > Like http://golang.org/pkg/go/scanner/ where comments are blue and all
    + * > other content is black?  I can do that.
    + * 
    + * + * @author mikesamuel@gmail.com + */ + +PR['registerLangHandler']( + PR['createSimpleLexer']( + [ + // Whitespace is made up of spaces, tabs and newline characters. + [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], + // Not escaped as a string. See note on minimalism above. + [PR['PR_PLAIN'], /^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])+(?:\'|$)|`[^`]*(?:`|$))/, null, '"\''] + ], + [ + // Block comments are delimited by /* and */. + // Single-line comments begin with // and extend to the end of a line. + [PR['PR_COMMENT'], /^(?:\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/], + [PR['PR_PLAIN'], /^(?:[^\/\"\'`]|\/(?![\/\*]))+/i] + ]), + ['go']); diff --git a/js/prettify/lang-hs.js b/js/prettify/lang-hs.js new file mode 100755 index 0000000..4a15cf0 --- /dev/null +++ b/js/prettify/lang-hs.js @@ -0,0 +1,101 @@ +// Copyright (C) 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * @fileoverview + * Registers a language handler for Haskell. + * + * + * To use, include prettify.js and this file in your HTML page. + * Then put your code in an HTML tag like + *
    (my lisp code)
    + * The lang-cl class identifies the language as common lisp. + * This file supports the following language extensions: + * lang-cl - Common Lisp + * lang-el - Emacs Lisp + * lang-lisp - Lisp + * lang-scm - Scheme + * + * + * I used http://www.informatik.uni-freiburg.de/~thiemann/haskell/haskell98-report-html/syntax-iso.html + * as the basis, but ignore the way the ncomment production nests since this + * makes the lexical grammar irregular. It might be possible to support + * ncomments using the lookbehind filter. + * + * + * @author mikesamuel@gmail.com + */ + +PR['registerLangHandler']( + PR['createSimpleLexer']( + [ + // Whitespace + // whitechar -> newline | vertab | space | tab | uniWhite + // newline -> return linefeed | return | linefeed | formfeed + [PR['PR_PLAIN'], /^[\t\n\x0B\x0C\r ]+/, null, '\t\n\x0B\x0C\r '], + // Single line double and single-quoted strings. + // char -> ' (graphic<' | \> | space | escape<\&>) ' + // string -> " {graphic<" | \> | space | escape | gap}" + // escape -> \ ( charesc | ascii | decimal | o octal + // | x hexadecimal ) + // charesc -> a | b | f | n | r | t | v | \ | " | ' | & + [PR['PR_STRING'], /^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/, + null, '"'], + [PR['PR_STRING'], /^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/, + null, "'"], + // decimal -> digit{digit} + // octal -> octit{octit} + // hexadecimal -> hexit{hexit} + // integer -> decimal + // | 0o octal | 0O octal + // | 0x hexadecimal | 0X hexadecimal + // float -> decimal . decimal [exponent] + // | decimal exponent + // exponent -> (e | E) [+ | -] decimal + [PR['PR_LITERAL'], + /^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i, + null, '0123456789'] + ], + [ + // Haskell does not have a regular lexical grammar due to the nested + // ncomment. + // comment -> dashes [ any {any}] newline + // ncomment -> opencom ANYseq {ncomment ANYseq}closecom + // dashes -> '--' {'-'} + // opencom -> '{-' + // closecom -> '-}' + [PR['PR_COMMENT'], /^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/], + // reservedid -> case | class | data | default | deriving | do + // | else | if | import | in | infix | infixl | infixr + // | instance | let | module | newtype | of | then + // | type | where | _ + [PR['PR_KEYWORD'], /^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/, null], + // qvarid -> [ modid . ] varid + // qconid -> [ modid . ] conid + // varid -> (small {small | large | digit | ' }) + // conid -> large {small | large | digit | ' } + // modid -> conid + // small -> ascSmall | uniSmall | _ + // ascSmall -> a | b | ... | z + // uniSmall -> any Unicode lowercase letter + // large -> ascLarge | uniLarge + // ascLarge -> A | B | ... | Z + // uniLarge -> any uppercase or titlecase Unicode letter + [PR['PR_PLAIN'], /^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/], + // matches the symbol production + [PR['PR_PUNCTUATION'], /^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/] + ]), + ['hs']); diff --git a/js/prettify/lang-lisp.js b/js/prettify/lang-lisp.js new file mode 100755 index 0000000..3bf75d7 --- /dev/null +++ b/js/prettify/lang-lisp.js @@ -0,0 +1,93 @@ +// Copyright (C) 2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * @fileoverview + * Registers a language handler for Common Lisp and related languages. + * + * + * To use, include prettify.js and this file in your HTML page. + * Then put your code in an HTML tag like + *
    (my lisp code)
    + * The lang-cl class identifies the language as common lisp. + * This file supports the following language extensions: + * lang-cl - Common Lisp + * lang-el - Emacs Lisp + * lang-lisp - Lisp + * lang-scm - Scheme + * + * + * I used http://www.devincook.com/goldparser/doc/meta-language/grammar-LISP.htm + * as the basis, but added line comments that start with ; and changed the atom + * production to disallow unquoted semicolons. + * + * "Name" = 'LISP' + * "Author" = 'John McCarthy' + * "Version" = 'Minimal' + * "About" = 'LISP is an abstract language that organizes ALL' + * | 'data around "lists".' + * + * "Start Symbol" = [s-Expression] + * + * {Atom Char} = {Printable} - {Whitespace} - [()"\''] + * + * Atom = ( {Atom Char} | '\'{Printable} )+ + * + * [s-Expression] ::= [Quote] Atom + * | [Quote] '(' [Series] ')' + * | [Quote] '(' [s-Expression] '.' [s-Expression] ')' + * + * [Series] ::= [s-Expression] [Series] + * | + * + * [Quote] ::= '' !Quote = do not evaluate + * | + * + * + * I used Practical Common Lisp as + * the basis for the reserved word list. + * + * + * @author mikesamuel@gmail.com + */ + +PR['registerLangHandler']( + PR['createSimpleLexer']( + [ + ['opn', /^\(+/, null, '('], + ['clo', /^\)+/, null, ')'], + // A line comment that starts with ; + [PR['PR_COMMENT'], /^;[^\r\n]*/, null, ';'], + // Whitespace + [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], + // A double quoted, possibly multi-line, string. + [PR['PR_STRING'], /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"'] + ], + [ + [PR['PR_KEYWORD'], /^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, null], + [PR['PR_LITERAL'], + /^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i], + // A single quote possibly followed by a word that optionally ends with + // = ! or ?. + [PR['PR_LITERAL'], + /^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/], + // A word that optionally ends with = ! or ?. + [PR['PR_PLAIN'], + /^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i], + // A printable non-space non-special character + [PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0()\"\\\';]+/] + ]), + ['cl', 'el', 'lisp', 'scm']); diff --git a/js/prettify/lang-lua.js b/js/prettify/lang-lua.js new file mode 100755 index 0000000..7a3f976 --- /dev/null +++ b/js/prettify/lang-lua.js @@ -0,0 +1,59 @@ +// Copyright (C) 2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * @fileoverview + * Registers a language handler for Lua. + * + * + * To use, include prettify.js and this file in your HTML page. + * Then put your code in an HTML tag like + *
    (my Lua code)
    + * + * + * I used http://www.lua.org/manual/5.1/manual.html#2.1 + * Because of the long-bracket concept used in strings and comments, Lua does + * not have a regular lexical grammar, but luckily it fits within the space + * of irregular grammars supported by javascript regular expressions. + * + * @author mikesamuel@gmail.com + */ + +PR['registerLangHandler']( + PR['createSimpleLexer']( + [ + // Whitespace + [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], + // A double or single quoted, possibly multi-line, string. + [PR['PR_STRING'], /^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/, null, '"\''] + ], + [ + // A comment is either a line comment that starts with two dashes, or + // two dashes preceding a long bracketed block. + [PR['PR_COMMENT'], /^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/], + // A long bracketed block not preceded by -- is a string. + [PR['PR_STRING'], /^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/], + [PR['PR_KEYWORD'], /^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/, null], + // A number is a hex integer literal, a decimal real literal, or in + // scientific notation. + [PR['PR_LITERAL'], + /^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i], + // An identifier + [PR['PR_PLAIN'], /^[a-z_]\w*/i], + // A run of punctuation + [PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/] + ]), + ['lua']); diff --git a/js/prettify/lang-ml.js b/js/prettify/lang-ml.js new file mode 100755 index 0000000..b5a4c17 --- /dev/null +++ b/js/prettify/lang-ml.js @@ -0,0 +1,56 @@ +// Copyright (C) 2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * @fileoverview + * Registers a language handler for OCaml, SML, F# and similar languages. + * + * Based on the lexical grammar at + * http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc270597388 + * + * @author mikesamuel@gmail.com + */ + +PR['registerLangHandler']( + PR['createSimpleLexer']( + [ + // Whitespace is made up of spaces, tabs and newline characters. + [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], + // #if ident/#else/#endif directives delimit conditional compilation + // sections + [PR['PR_COMMENT'], + /^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i, + null, '#'], + // A double or single quoted, possibly multi-line, string. + // F# allows escaped newlines in strings. + [PR['PR_STRING'], /^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/, null, '"\''] + ], + [ + // Block comments are delimited by (* and *) and may be + // nested. Single-line comments begin with // and extend to + // the end of a line. + // TODO: (*...*) comments can be nested. This does not handle that. + [PR['PR_COMMENT'], /^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/], + [PR['PR_KEYWORD'], /^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], + // A number is a hex integer literal, a decimal real literal, or in + // scientific notation. + [PR['PR_LITERAL'], + /^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i], + [PR['PR_PLAIN'], /^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i], + // A printable non-space non-special character + [PR['PR_PUNCTUATION'], /^[^\t\n\r \xA0\"\'\w]+/] + ]), + ['fs', 'ml']); diff --git a/js/prettify/lang-n.js b/js/prettify/lang-n.js new file mode 100755 index 0000000..babe8f3 --- /dev/null +++ b/js/prettify/lang-n.js @@ -0,0 +1,62 @@ +// Copyright (C) 2011 Zimin A.V. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +/** + * @fileoverview + * Registers a language handler for the Nemerle language. + * http://nemerle.org + * @author Zimin A.V. + */ +(function () { + var keywords = 'abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|' + + 'fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|' + + 'null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|' + + 'syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|' + + 'assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|' + + 'otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield'; + + var shortcutStylePatterns = [ + [PR.PR_STRING, /^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/, null, '"'], + [PR.PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/, null, '#'], + [PR.PR_PLAIN, /^\s+/, null, ' \r\n\t\xA0'] + ]; + + var fallthroughStylePatterns = [ + [PR.PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null], + [PR.PR_STRING, /^<#(?:[^#>])*(?:#>|$)/, null], + [PR.PR_STRING, /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, null], + [PR.PR_COMMENT, /^\/\/[^\r\n]*/, null], + [PR.PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null], + [PR.PR_KEYWORD, new RegExp('^(?:' + keywords + ')\\b'), null], + [PR.PR_TYPE, /^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/, null], + [PR.PR_LITERAL, /^@[a-z_$][a-z_$@0-9]*/i, null], + [PR.PR_TYPE, /^@[A-Z]+[a-z][A-Za-z_$@0-9]*/, null], + [PR.PR_PLAIN, /^'?[A-Za-z_$][a-z_$@0-9]*/i, null], + [PR.PR_LITERAL, new RegExp( + '^(?:' + // A hex number + + '0x[a-f0-9]+' + // or an octal or decimal number, + + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)' + // possibly in scientific notation + + '(?:e[+\\-]?\\d+)?' + + ')' + // with an optional modifier like UL for unsigned long + + '[a-z]*', 'i'), null, '0123456789'], + + [PR.PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#]*/, null] + ]; + PR.registerLangHandler(PR.createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns), ['n', 'nemerle']); +})(); diff --git a/js/prettify/lang-proto.js b/js/prettify/lang-proto.js new file mode 100755 index 0000000..5395491 --- /dev/null +++ b/js/prettify/lang-proto.js @@ -0,0 +1,35 @@ +// Copyright (C) 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +/** + * @fileoverview + * Registers a language handler for Protocol Buffers as described at + * http://code.google.com/p/protobuf/. + * + * Based on the lexical grammar at + * http://research.microsoft.com/fsharp/manual/spec2.aspx#_Toc202383715 + * + * @author mikesamuel@gmail.com + */ + +PR['registerLangHandler'](PR['sourceDecorator']({ + 'keywords': ( + 'bytes,default,double,enum,extend,extensions,false,' + + 'group,import,max,message,option,' + + 'optional,package,repeated,required,returns,rpc,service,' + + 'syntax,to,true'), + 'types': /^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/, + 'cStyleComments': true + }), ['proto']); diff --git a/js/prettify/lang-scala.js b/js/prettify/lang-scala.js new file mode 100755 index 0000000..db9b484 --- /dev/null +++ b/js/prettify/lang-scala.js @@ -0,0 +1,54 @@ +// Copyright (C) 2010 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +/** + * @fileoverview + * Registers a language handler for Scala. + * + * Derived from http://lampsvn.epfl.ch/svn-repos/scala/scala-documentation/trunk/src/reference/SyntaxSummary.tex + * + * @author mikesamuel@gmail.com + */ + +PR['registerLangHandler']( + PR['createSimpleLexer']( + [ + // Whitespace + [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], + // A double or single quoted string + // or a triple double-quoted multi-line string. + [PR['PR_STRING'], + /^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/, + null, '"'], + [PR['PR_LITERAL'], /^`(?:[^\r\n\\`]|\\.)*`?/, null, '`'], + [PR['PR_PUNCTUATION'], /^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/, null, + '!#%&()*+,-:;<=>?@[\\]^{|}~'] + ], + [ + // A symbol literal is a single quote followed by an identifier with no + // single quote following + // A character literal has single quotes on either side + [PR['PR_STRING'], /^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/], + [PR['PR_LITERAL'], /^'[a-zA-Z_$][\w$]*(?!['$\w])/], + [PR['PR_KEYWORD'], /^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], + [PR['PR_LITERAL'], /^(?:true|false|null|this)\b/], + [PR['PR_LITERAL'], /^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i], + // Treat upper camel case identifiers as types. + [PR['PR_TYPE'], /^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/], + [PR['PR_PLAIN'], /^[$a-zA-Z_][\w$]*/], + [PR['PR_COMMENT'], /^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/], + [PR['PR_PUNCTUATION'], /^(?:\.+|\/)/] + ]), + ['scala']); diff --git a/js/prettify/lang-sql.js b/js/prettify/lang-sql.js new file mode 100755 index 0000000..a4adec8 --- /dev/null +++ b/js/prettify/lang-sql.js @@ -0,0 +1,57 @@ +// Copyright (C) 2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * @fileoverview + * Registers a language handler for SQL. + * + * + * To use, include prettify.js and this file in your HTML page. + * Then put your code in an HTML tag like + *
    (my SQL code)
    + * + * + * http://savage.net.au/SQL/sql-99.bnf.html is the basis for the grammar, and + * http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx as the basis + * for the keyword list. + * + * @author mikesamuel@gmail.com + */ + +PR['registerLangHandler']( + PR['createSimpleLexer']( + [ + // Whitespace + [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], + // A double or single quoted, possibly multi-line, string. + [PR['PR_STRING'], /^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/, null, + '"\''] + ], + [ + // A comment is either a line comment that starts with two dashes, or + // two dashes preceding a long bracketed block. + [PR['PR_COMMENT'], /^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/], + [PR['PR_KEYWORD'], /^(?:ADD|ALL|ALTER|AND|ANY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|MATCH|MERGE|NATIONAL|NOCHECK|NONCLUSTERED|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PERCENT|PLAN|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNION|UNIQUE|UPDATE|UPDATETEXT|USE|USER|USING|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WRITETEXT)(?=[^\w-]|$)/i, null], + // A number is a hex integer literal, a decimal real literal, or in + // scientific notation. + [PR['PR_LITERAL'], + /^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i], + // An identifier + [PR['PR_PLAIN'], /^[a-z_][\w-]*/i], + // A run of punctuation + [PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/] + ]), + ['sql']); diff --git a/js/prettify/lang-tex.js b/js/prettify/lang-tex.js new file mode 100755 index 0000000..57d0ac4 --- /dev/null +++ b/js/prettify/lang-tex.js @@ -0,0 +1,46 @@ +// Copyright (C) 2011 Martin S. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview + * Support for tex highlighting as discussed on + * meta.tex.stackexchange.com. + * + * @author Martin S. + */ + +PR.registerLangHandler( + PR.createSimpleLexer( + [ + // whitespace + [PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], + // all comments begin with '%' + [PR.PR_COMMENT, /^%[^\r\n]*/, null, '%'] + ], + [ + //[PR.PR_DECLARATION, /^\\([egx]?def|(new|renew|provide)(command|environment))\b/], + // any command starting with a \ and contains + // either only letters (a-z,A-Z), '@' (internal macros) + [PR.PR_KEYWORD, /^\\[a-zA-Z@]+/], + // or contains only one character + [PR.PR_KEYWORD, /^\\./], + // Highlight dollar for math mode and ampersam for tabular + [PR.PR_TYPE, /^[$&]/], + // numeric measurement values with attached units + [PR.PR_LITERAL, + /[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i], + // punctuation usually occurring within commands + [PR.PR_PUNCTUATION, /^[{}()\[\]=]+/] + ]), + ['latex', 'tex']); diff --git a/js/prettify/lang-vb.js b/js/prettify/lang-vb.js new file mode 100755 index 0000000..5fb4a38 --- /dev/null +++ b/js/prettify/lang-vb.js @@ -0,0 +1,61 @@ +// Copyright (C) 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * @fileoverview + * Registers a language handler for various flavors of basic. + * + * + * To use, include prettify.js and this file in your HTML page. + * Then put your code in an HTML tag like + *
    
    + *
    + *
    + * http://msdn.microsoft.com/en-us/library/aa711638(VS.71).aspx defines the
    + * visual basic grammar lexical grammar.
    + *
    + * @author mikesamuel@gmail.com
    + */
    +
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer'](
    +        [
    +         // Whitespace
    +         [PR['PR_PLAIN'],       /^[\t\n\r \xA0\u2028\u2029]+/, null, '\t\n\r \xA0\u2028\u2029'],
    +         // A double quoted string with quotes escaped by doubling them.
    +         // A single character can be suffixed with C.
    +         [PR['PR_STRING'],      /^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i, null,
    +          '"\u201C\u201D'],
    +         // A comment starts with a single quote and runs until the end of the
    +         // line.
    +         [PR['PR_COMMENT'],     /^[\'\u2018\u2019][^\r\n\u2028\u2029]*/, null, '\'\u2018\u2019']
    +        ],
    +        [
    +         [PR['PR_KEYWORD'], /^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, null],
    +         // A second comment form
    +         [PR['PR_COMMENT'], /^REM[^\r\n\u2028\u2029]*/i],
    +         // A boolean, numeric, or date literal.
    +         [PR['PR_LITERAL'],
    +          /^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],
    +         // An identifier?
    +         [PR['PR_PLAIN'], /^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*\])/i],
    +         // A run of punctuation
    +         [PR['PR_PUNCTUATION'],
    +          /^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],
    +         // Square brackets
    +         [PR['PR_PUNCTUATION'], /^(?:\[|\])/]
    +        ]),
    +    ['vb', 'vbs']);
    diff --git a/js/prettify/lang-vhdl.js b/js/prettify/lang-vhdl.js
    new file mode 100755
    index 0000000..f6410bc
    --- /dev/null
    +++ b/js/prettify/lang-vhdl.js
    @@ -0,0 +1,34 @@
    +/**
    + * @fileoverview
    + * Registers a language handler for VHDL '93.
    + *
    + * Based on the lexical grammar and keywords at
    + * http://www.iis.ee.ethz.ch/~zimmi/download/vhdl93_syntax.html
    + *
    + * @author benoit@ryder.fr
    + */
    +
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer'](
    +        [
    +         // Whitespace
    +         [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0']
    +        ],
    +        [
    +         // String, character or bit string
    +         [PR['PR_STRING'], /^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],
    +         // Comment, from two dashes until end of line.
    +         [PR['PR_COMMENT'], /^--[^\r\n]*/],
    +         [PR['PR_KEYWORD'], /^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, null],
    +         // Type, predefined or standard
    +         [PR['PR_TYPE'], /^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i, null],
    +         // Predefined attributes
    +         [PR['PR_TYPE'], /^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i, null],
    +         // Number, decimal or based literal
    +         [PR['PR_LITERAL'], /^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i],
    +         // Identifier, basic or extended
    +         [PR['PR_PLAIN'], /^(?:[a-z]\w*|\\[^\\]*\\)/i],
    +         // Punctuation
    +         [PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]
    +        ]),
    +    ['vhdl', 'vhd']);
    diff --git a/js/prettify/lang-wiki.js b/js/prettify/lang-wiki.js
    new file mode 100755
    index 0000000..660423e
    --- /dev/null
    +++ b/js/prettify/lang-wiki.js
    @@ -0,0 +1,53 @@
    +// Copyright (C) 2009 Google Inc.
    +//
    +// Licensed under the Apache License, Version 2.0 (the "License");
    +// you may not use this file except in compliance with the License.
    +// You may obtain a copy of the License at
    +//
    +//      http://www.apache.org/licenses/LICENSE-2.0
    +//
    +// Unless required by applicable law or agreed to in writing, software
    +// distributed under the License is distributed on an "AS IS" BASIS,
    +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +// See the License for the specific language governing permissions and
    +// limitations under the License.
    +
    +
    +/**
    + * @fileoverview
    + * Registers a language handler for Wiki pages.
    + *
    + * Based on WikiSyntax at http://code.google.com/p/support/wiki/WikiSyntax
    + *
    + * @author mikesamuel@gmail.com
    + */
    +
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer'](
    +        [
    +         // Whitespace
    +         [PR['PR_PLAIN'],       /^[\t \xA0a-gi-z0-9]+/, null,
    +          '\t \xA0abcdefgijklmnopqrstuvwxyz0123456789'],
    +         // Wiki formatting
    +         [PR['PR_PUNCTUATION'], /^[=*~\^\[\]]+/, null, '=*~^[]']
    +        ],
    +        [
    +         // Meta-info like #summary, #labels, etc.
    +         ['lang-wiki.meta',  /(?:^^|\r\n?|\n)(#[a-z]+)\b/],
    +         // A WikiWord
    +         [PR['PR_LITERAL'],     /^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/
    +          ],
    +         // A preformatted block in an unknown language
    +         ['lang-',           /^\{\{\{([\s\S]+?)\}\}\}/],
    +         // A block of source code in an unknown language
    +         ['lang-',           /^`([^\r\n`]+)`/],
    +         // An inline URL.
    +         [PR['PR_STRING'],
    +          /^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],
    +         [PR['PR_PLAIN'],       /^(?:\r\n|[\s\S])[^#=*~^A-Zh\{`\[\r\n]*/]
    +        ]),
    +    ['wiki']);
    +
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer']([[PR['PR_KEYWORD'], /^#[a-z]+/i, null, '#']], []),
    +    ['wiki.meta']);
    diff --git a/js/prettify/lang-xq.js b/js/prettify/lang-xq.js
    new file mode 100755
    index 0000000..38ffd72
    --- /dev/null
    +++ b/js/prettify/lang-xq.js
    @@ -0,0 +1,67 @@
    +// Copyright (C) 2011 Patrick Wied
    +//
    +// Licensed under the Apache License, Version 2.0 (the "License");
    +// you may not use this file except in compliance with the License.
    +// You may obtain a copy of the License at
    +//
    +//      http://www.apache.org/licenses/LICENSE-2.0
    +//
    +// Unless required by applicable law or agreed to in writing, software
    +// distributed under the License is distributed on an "AS IS" BASIS,
    +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +// See the License for the specific language governing permissions and
    +// limitations under the License.
    +
    +
    +
    +/**
    + * @fileoverview
    + * Registers a language handler for XQuery.
    + *
    + * To use, include prettify.js and this file in your HTML page.
    + * Then put your code in an HTML tag like
    + *      
    
    + *
    + *
    + * @author Patrick Wied ( patpa7p@live.de )
    + * @version 2010-09-28
    + */
    +
    +// Falls back to plain for stylesheets that don't style fun.
    +var PR_FUNCTION = 'fun pln';
    +// Falls back to plaiin for stylesheets that don't style var.
    +var PR_VARIABLE = 'var pln';
    +
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer'](
    +        [
    +         // Matching $var-ia_bles
    +         [PR_VARIABLE, /^\$[A-Za-z0-9_\-]+/, null, "$"]
    +        ],
    +        [
    +         // Matching lt and gt operators
    +         // Not the best matching solution but you have to differentiate between the gt operator and the tag closing char
    +         [PR['PR_PLAIN'], /^[\s=][<>][\s=]/],
    +         // Matching @Attributes
    +         [PR['PR_LITERAL'], /^\@[\w-]+/],
    +         // Matching xml tags
    +         [PR['PR_TAG'], /^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
    +         // Matching single or multiline xquery comments -> (:  :)
    +         [PR['PR_COMMENT'], /^\(:[\s\S]*?:\)/],
    +         // Tokenizing /{}:=;*,[]() as plain
    +         [PR['PR_PLAIN'], /^[\/\{\};,\[\]\(\)]$/],
    +         // Matching a double or single quoted, possibly multi-line, string.
    +         // with the special condition that a { in a string changes to xquery context 
    +         [PR['PR_STRING'], /^(?:\"(?:[^\"\\\{]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\\{]|\\[\s\S])*(?:\'|$))/, null, '"\''],
    +         // Matching standard xquery keywords
    +         [PR['PR_KEYWORD'], /^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/],
    +         // Matching standard xquery types
    +         [PR['PR_TYPE'], /^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/, null],
    +         // Matching standard xquery functions
    +         [PR_FUNCTION, /^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/],
    +         // Matching normal words if none of the previous regular expressions matched
    +         [PR['PR_PLAIN'], /^[A-Za-z0-9_\-\:]+/],
    +         // Matching whitespaces
    +         [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/]
    +         ]),
    +    ['xq', 'xquery']);
    diff --git a/js/prettify/lang-yaml.js b/js/prettify/lang-yaml.js
    new file mode 100755
    index 0000000..c2e52b2
    --- /dev/null
    +++ b/js/prettify/lang-yaml.js
    @@ -0,0 +1,27 @@
    +// Contributed by ribrdb @ code.google.com
    +
    +/**
    + * @fileoverview
    + * Registers a language handler for YAML.
    + *
    + * @author ribrdb
    + */
    +
    +PR['registerLangHandler'](
    +  PR['createSimpleLexer'](
    +    [
    +      [PR['PR_PUNCTUATION'], /^[:|>?]+/, null, ':|>?'],
    +      [PR['PR_DECLARATION'],  /^%(?:YAML|TAG)[^#\r\n]+/, null, '%'],
    +      [PR['PR_TYPE'], /^[&]\S+/, null, '&'],
    +      [PR['PR_TYPE'], /^!\S*/, null, '!'],
    +      [PR['PR_STRING'], /^"(?:[^\\"]|\\.)*(?:"|$)/, null, '"'],
    +      [PR['PR_STRING'], /^'(?:[^']|'')*(?:'|$)/, null, "'"],
    +      [PR['PR_COMMENT'], /^#[^\r\n]*/, null, '#'],
    +      [PR['PR_PLAIN'], /^\s+/, null, ' \t\r\n']
    +    ],
    +    [
    +      [PR['PR_DECLARATION'], /^(?:---|\.\.\.)(?:[\r\n]|$)/],
    +      [PR['PR_PUNCTUATION'], /^-/],
    +      [PR['PR_KEYWORD'], /^\w+:[ \r\n]/],
    +      [PR['PR_PLAIN'], /^\w+/]
    +    ]), ['yaml', 'yml']);
    diff --git a/js/prettify/prettify.css b/js/prettify/prettify.css
    new file mode 100755
    index 0000000..400fd74
    --- /dev/null
    +++ b/js/prettify/prettify.css
    @@ -0,0 +1,52 @@
    +/* Pretty printing styles. Used with prettify.js. */
    +
    +/* SPAN elements with the classes below are added by prettyprint. */
    +.pln { color: #000 }  /* plain text */
    +
    +@media screen {
    +  .str { color: #080 }  /* string content */
    +  .kwd { color: #008 }  /* a keyword */
    +  .com { color: #800 }  /* a comment */
    +  .typ { color: #606 }  /* a type name */
    +  .lit { color: #066 }  /* a literal value */
    +  /* punctuation, lisp open bracket, lisp close bracket */
    +  .pun, .opn, .clo { color: #660 }
    +  .tag { color: #008 }  /* a markup tag name */
    +  .atn { color: #606 }  /* a markup attribute name */
    +  .atv { color: #080 }  /* a markup attribute value */
    +  .dec, .var { color: #606 }  /* a declaration; a variable name */
    +  .fun { color: red }  /* a function name */
    +}
    +
    +/* Use higher contrast and text-weight for printable form. */
    +@media print, projection {
    +  .str { color: #060 }
    +  .kwd { color: #006; font-weight: bold }
    +  .com { color: #600; font-style: italic }
    +  .typ { color: #404; font-weight: bold }
    +  .lit { color: #044 }
    +  .pun, .opn, .clo { color: #440 }
    +  .tag { color: #006; font-weight: bold }
    +  .atn { color: #404 }
    +  .atv { color: #060 }
    +}
    +
    +/* Put a border around prettyprinted code snippets. */
    +pre.prettyprint { padding: 2px; border: 1px solid #888 }
    +
    +/* Specify class=linenums on a pre to get line numbering */
    +ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
    +li.L0,
    +li.L1,
    +li.L2,
    +li.L3,
    +li.L5,
    +li.L6,
    +li.L7,
    +li.L8 { list-style-type: none }
    +/* Alternate shading for lines */
    +li.L1,
    +li.L3,
    +li.L5,
    +li.L7,
    +li.L9 { background: #eee }
    diff --git a/js/prettify/prettify.js b/js/prettify/prettify.js
    new file mode 100755
    index 0000000..037c26d
    --- /dev/null
    +++ b/js/prettify/prettify.js
    @@ -0,0 +1,1477 @@
    +// Copyright (C) 2006 Google Inc.
    +//
    +// Licensed under the Apache License, Version 2.0 (the "License");
    +// you may not use this file except in compliance with the License.
    +// You may obtain a copy of the License at
    +//
    +//      http://www.apache.org/licenses/LICENSE-2.0
    +//
    +// Unless required by applicable law or agreed to in writing, software
    +// distributed under the License is distributed on an "AS IS" BASIS,
    +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +// See the License for the specific language governing permissions and
    +// limitations under the License.
    +
    +
    +/**
    + * @fileoverview
    + * some functions for browser-side pretty printing of code contained in html.
    + *
    + * 

    + * For a fairly comprehensive set of languages see the + * README + * file that came with this source. At a minimum, the lexer should work on a + * number of languages including C and friends, Java, Python, Bash, SQL, HTML, + * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk + * and a subset of Perl, but, because of commenting conventions, doesn't work on + * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class. + *

    + * Usage:

      + *
    1. include this source file in an html page via + * {@code } + *
    2. define style rules. See the example page for examples. + *
    3. mark the {@code
      } and {@code } tags in your source with
      + *    {@code class=prettyprint.}
      + *    You can also use the (html deprecated) {@code } tag, but the pretty
      + *    printer needs to do more substantial DOM manipulations to support that, so
      + *    some css styles may not be preserved.
      + * </ol>
      + * That's it.  I wanted to keep the API as simple as possible, so there's no
      + * need to specify which language the code is in, but if you wish, you can add
      + * another class to the {@code <pre>} or {@code <code>} element to specify the
      + * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
      + * starts with "lang-" followed by a file extension, specifies the file type.
      + * See the "lang-*.js" files in this directory for code that implements
      + * per-language file handlers.
      + * <p>
      + * Change log:<br>
      + * cbeust, 2006/08/22
      + * <blockquote>
      + *   Java annotations (start with "@") are now captured as literals ("lit")
      + * </blockquote>
      + * @requires console
      + */
      +
      +// JSLint declarations
      +/*global console, document, navigator, setTimeout, window */
      +
      +/**
      + * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
      + * UI events.
      + * If set to {@code false}, {@code prettyPrint()} is synchronous.
      + */
      +window['PR_SHOULD_USE_CONTINUATION'] = true;
      +
      +(function () {
      +  // Keyword lists for various languages.
      +  // We use things that coerce to strings to make them compact when minified
      +  // and to defeat aggressive optimizers that fold large string constants.
      +  var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
      +  var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," + 
      +      "double,enum,extern,float,goto,int,long,register,short,signed,sizeof," +
      +      "static,struct,switch,typedef,union,unsigned,void,volatile"];
      +  var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
      +      "new,operator,private,protected,public,this,throw,true,try,typeof"];
      +  var CPP_KEYWORDS = [COMMON_KEYWORDS,"alignof,align_union,asm,axiom,bool," +
      +      "concept,concept_map,const_cast,constexpr,decltype," +
      +      "dynamic_cast,explicit,export,friend,inline,late_check," +
      +      "mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast," +
      +      "template,typeid,typename,using,virtual,where"];
      +  var JAVA_KEYWORDS = [COMMON_KEYWORDS,
      +      "abstract,boolean,byte,extends,final,finally,implements,import," +
      +      "instanceof,null,native,package,strictfp,super,synchronized,throws," +
      +      "transient"];
      +  var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
      +      "as,base,by,checked,decimal,delegate,descending,dynamic,event," +
      +      "fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock," +
      +      "object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed," +
      +      "stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];
      +  var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
      +      "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
      +      "true,try,unless,until,when,while,yes";
      +  var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
      +      "debugger,eval,export,function,get,null,set,undefined,var,with," +
      +      "Infinity,NaN"];
      +  var PERL_KEYWORDS = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for," +
      +      "goto,if,import,last,local,my,next,no,our,print,package,redo,require," +
      +      "sub,undef,unless,until,use,wantarray,while,BEGIN,END";
      +  var PYTHON_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "and,as,assert,class,def,del," +
      +      "elif,except,exec,finally,from,global,import,in,is,lambda," +
      +      "nonlocal,not,or,pass,print,raise,try,with,yield," +
      +      "False,True,None"];
      +  var RUBY_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "alias,and,begin,case,class," +
      +      "def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo," +
      +      "rescue,retry,self,super,then,true,undef,unless,until,when,yield," +
      +      "BEGIN,END"];
      +  var SH_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "case,done,elif,esac,eval,fi," +
      +      "function,in,local,set,then,until"];
      +  var ALL_KEYWORDS = [
      +      CPP_KEYWORDS, CSHARP_KEYWORDS, JSCRIPT_KEYWORDS, PERL_KEYWORDS +
      +      PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
      +  var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;
      +
      +  // token style names.  correspond to css classes
      +  /**
      +   * token style for a string literal
      +   * @const
      +   */
      +  var PR_STRING = 'str';
      +  /**
      +   * token style for a keyword
      +   * @const
      +   */
      +  var PR_KEYWORD = 'kwd';
      +  /**
      +   * token style for a comment
      +   * @const
      +   */
      +  var PR_COMMENT = 'com';
      +  /**
      +   * token style for a type
      +   * @const
      +   */
      +  var PR_TYPE = 'typ';
      +  /**
      +   * token style for a literal value.  e.g. 1, null, true.
      +   * @const
      +   */
      +  var PR_LITERAL = 'lit';
      +  /**
      +   * token style for a punctuation string.
      +   * @const
      +   */
      +  var PR_PUNCTUATION = 'pun';
      +  /**
      +   * token style for a punctuation string.
      +   * @const
      +   */
      +  var PR_PLAIN = 'pln';
      +
      +  /**
      +   * token style for an sgml tag.
      +   * @const
      +   */
      +  var PR_TAG = 'tag';
      +  /**
      +   * token style for a markup declaration such as a DOCTYPE.
      +   * @const
      +   */
      +  var PR_DECLARATION = 'dec';
      +  /**
      +   * token style for embedded source.
      +   * @const
      +   */
      +  var PR_SOURCE = 'src';
      +  /**
      +   * token style for an sgml attribute name.
      +   * @const
      +   */
      +  var PR_ATTRIB_NAME = 'atn';
      +  /**
      +   * token style for an sgml attribute value.
      +   * @const
      +   */
      +  var PR_ATTRIB_VALUE = 'atv';
      +
      +  /**
      +   * A class that indicates a section of markup that is not code, e.g. to allow
      +   * embedding of line numbers within code listings.
      +   * @const
      +   */
      +  var PR_NOCODE = 'nocode';
      +
      +
      +
      +/**
      + * A set of tokens that can precede a regular expression literal in
      + * javascript
      + * http://web.archive.org/web/20070717142515/http://www.mozilla.org/js/language/js20/rationale/syntax.html
      + * has the full list, but I've removed ones that might be problematic when
      + * seen in languages that don't support regular expression literals.
      + *
      + * <p>Specifically, I've removed any keywords that can't precede a regexp
      + * literal in a syntactically legal javascript program, and I've removed the
      + * "in" keyword since it's not a keyword in many languages, and might be used
      + * as a count of inches.
      + *
      + * <p>The link a above does not accurately describe EcmaScript rules since
      + * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
      + * very well in practice.
      + *
      + * @private
      + * @const
      + */
      +var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
      +
      +// CAVEAT: this does not properly handle the case where a regular
      +// expression immediately follows another since a regular expression may
      +// have flags for case-sensitivity and the like.  Having regexp tokens
      +// adjacent is not valid in any language I'm aware of, so I'm punting.
      +// TODO: maybe style special characters inside a regexp as punctuation.
      +
      +
      +  /**
      +   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
      +   * matches the union of the sets of strings matched by the input RegExp.
      +   * Since it matches globally, if the input strings have a start-of-input
      +   * anchor (/^.../), it is ignored for the purposes of unioning.
      +   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
      +   * @return {RegExp} a global regex.
      +   */
      +  function combinePrefixPatterns(regexs) {
      +    var capturedGroupIndex = 0;
      +  
      +    var needToFoldCase = false;
      +    var ignoreCase = false;
      +    for (var i = 0, n = regexs.length; i < n; ++i) {
      +      var regex = regexs[i];
      +      if (regex.ignoreCase) {
      +        ignoreCase = true;
      +      } else if (/[a-z]/i.test(regex.source.replace(
      +                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
      +        needToFoldCase = true;
      +        ignoreCase = false;
      +        break;
      +      }
      +    }
      +  
      +    var escapeCharToCodeUnit = {
      +      'b': 8,
      +      't': 9,
      +      'n': 0xa,
      +      'v': 0xb,
      +      'f': 0xc,
      +      'r': 0xd
      +    };
      +  
      +    function decodeEscape(charsetPart) {
      +      var cc0 = charsetPart.charCodeAt(0);
      +      if (cc0 !== 92 /* \\ */) {
      +        return cc0;
      +      }
      +      var c1 = charsetPart.charAt(1);
      +      cc0 = escapeCharToCodeUnit[c1];
      +      if (cc0) {
      +        return cc0;
      +      } else if ('0' <= c1 && c1 <= '7') {
      +        return parseInt(charsetPart.substring(1), 8);
      +      } else if (c1 === 'u' || c1 === 'x') {
      +        return parseInt(charsetPart.substring(2), 16);
      +      } else {
      +        return charsetPart.charCodeAt(1);
      +      }
      +    }
      +  
      +    function encodeEscape(charCode) {
      +      if (charCode < 0x20) {
      +        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
      +      }
      +      var ch = String.fromCharCode(charCode);
      +      if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
      +        ch = '\\' + ch;
      +      }
      +      return ch;
      +    }
      +  
      +    function caseFoldCharset(charSet) {
      +      var charsetParts = charSet.substring(1, charSet.length - 1).match(
      +          new RegExp(
      +              '\\\\u[0-9A-Fa-f]{4}'
      +              + '|\\\\x[0-9A-Fa-f]{2}'
      +              + '|\\\\[0-3][0-7]{0,2}'
      +              + '|\\\\[0-7]{1,2}'
      +              + '|\\\\[\\s\\S]'
      +              + '|-'
      +              + '|[^-\\\\]',
      +              'g'));
      +      var groups = [];
      +      var ranges = [];
      +      var inverse = charsetParts[0] === '^';
      +      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
      +        var p = charsetParts[i];
      +        if (/\\[bdsw]/i.test(p)) {  // Don't muck with named groups.
      +          groups.push(p);
      +        } else {
      +          var start = decodeEscape(p);
      +          var end;
      +          if (i + 2 < n && '-' === charsetParts[i + 1]) {
      +            end = decodeEscape(charsetParts[i + 2]);
      +            i += 2;
      +          } else {
      +            end = start;
      +          }
      +          ranges.push([start, end]);
      +          // If the range might intersect letters, then expand it.
      +          // This case handling is too simplistic.
      +          // It does not deal with non-latin case folding.
      +          // It works for latin source code identifiers though.
      +          if (!(end < 65 || start > 122)) {
      +            if (!(end < 65 || start > 90)) {
      +              ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
      +            }
      +            if (!(end < 97 || start > 122)) {
      +              ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
      +            }
      +          }
      +        }
      +      }
      +  
      +      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
      +      // -> [[1, 12], [14, 14], [16, 17]]
      +      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
      +      var consolidatedRanges = [];
      +      var lastRange = [NaN, NaN];
      +      for (var i = 0; i < ranges.length; ++i) {
      +        var range = ranges[i];
      +        if (range[0] <= lastRange[1] + 1) {
      +          lastRange[1] = Math.max(lastRange[1], range[1]);
      +        } else {
      +          consolidatedRanges.push(lastRange = range);
      +        }
      +      }
      +  
      +      var out = ['['];
      +      if (inverse) { out.push('^'); }
      +      out.push.apply(out, groups);
      +      for (var i = 0; i < consolidatedRanges.length; ++i) {
      +        var range = consolidatedRanges[i];
      +        out.push(encodeEscape(range[0]));
      +        if (range[1] > range[0]) {
      +          if (range[1] + 1 > range[0]) { out.push('-'); }
      +          out.push(encodeEscape(range[1]));
      +        }
      +      }
      +      out.push(']');
      +      return out.join('');
      +    }
      +  
      +    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
      +      // Split into character sets, escape sequences, punctuation strings
      +      // like ('(', '(?:', ')', '^'), and runs of characters that do not
      +      // include any of the above.
      +      var parts = regex.source.match(
      +          new RegExp(
      +              '(?:'
      +              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
      +              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
      +              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
      +              + '|\\\\[0-9]+'  // a back-reference or octal escape
      +              + '|\\\\[^ux0-9]'  // other escape sequence
      +              + '|\\(\\?[:!=]'  // start of a non-capturing group
      +              + '|[\\(\\)\\^]'  // start/emd of a group, or line start
      +              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
      +              + ')',
      +              'g'));
      +      var n = parts.length;
      +  
      +      // Maps captured group numbers to the number they will occupy in
      +      // the output or to -1 if that has not been determined, or to
      +      // undefined if they need not be capturing in the output.
      +      var capturedGroups = [];
      +  
      +      // Walk over and identify back references to build the capturedGroups
      +      // mapping.
      +      for (var i = 0, groupIndex = 0; i < n; ++i) {
      +        var p = parts[i];
      +        if (p === '(') {
      +          // groups are 1-indexed, so max group index is count of '('
      +          ++groupIndex;
      +        } else if ('\\' === p.charAt(0)) {
      +          var decimalValue = +p.substring(1);
      +          if (decimalValue && decimalValue <= groupIndex) {
      +            capturedGroups[decimalValue] = -1;
      +          }
      +        }
      +      }
      +  
      +      // Renumber groups and reduce capturing groups to non-capturing groups
      +      // where possible.
      +      for (var i = 1; i < capturedGroups.length; ++i) {
      +        if (-1 === capturedGroups[i]) {
      +          capturedGroups[i] = ++capturedGroupIndex;
      +        }
      +      }
      +      for (var i = 0, groupIndex = 0; i < n; ++i) {
      +        var p = parts[i];
      +        if (p === '(') {
      +          ++groupIndex;
      +          if (capturedGroups[groupIndex] === undefined) {
      +            parts[i] = '(?:';
      +          }
      +        } else if ('\\' === p.charAt(0)) {
      +          var decimalValue = +p.substring(1);
      +          if (decimalValue && decimalValue <= groupIndex) {
      +            parts[i] = '\\' + capturedGroups[groupIndex];
      +          }
      +        }
      +      }
      +  
      +      // Remove any prefix anchors so that the output will match anywhere.
      +      // ^^ really does mean an anchored match though.
      +      for (var i = 0, groupIndex = 0; i < n; ++i) {
      +        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
      +      }
      +  
      +      // Expand letters to groups to handle mixing of case-sensitive and
      +      // case-insensitive patterns if necessary.
      +      if (regex.ignoreCase && needToFoldCase) {
      +        for (var i = 0; i < n; ++i) {
      +          var p = parts[i];
      +          var ch0 = p.charAt(0);
      +          if (p.length >= 2 && ch0 === '[') {
      +            parts[i] = caseFoldCharset(p);
      +          } else if (ch0 !== '\\') {
      +            // TODO: handle letters in numeric escapes.
      +            parts[i] = p.replace(
      +                /[a-zA-Z]/g,
      +                function (ch) {
      +                  var cc = ch.charCodeAt(0);
      +                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
      +                });
      +          }
      +        }
      +      }
      +  
      +      return parts.join('');
      +    }
      +  
      +    var rewritten = [];
      +    for (var i = 0, n = regexs.length; i < n; ++i) {
      +      var regex = regexs[i];
      +      if (regex.global || regex.multiline) { throw new Error('' + regex); }
      +      rewritten.push(
      +          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
      +    }
      +  
      +    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
      +  }
      +
      +
      +  /**
      +   * Split markup into a string of source code and an array mapping ranges in
      +   * that string to the text nodes in which they appear.
      +   *
      +   * <p>
      +   * The HTML DOM structure:</p>
      +   * <pre>
      +   * (Element   "p"
      +   *   (Element "b"
      +   *     (Text  "print "))       ; #1
      +   *   (Text    "'Hello '")      ; #2
      +   *   (Element "br")            ; #3
      +   *   (Text    "  + 'World';")) ; #4
      +   * </pre>
      +   * <p>
      +   * corresponds to the HTML
      +   * {@code <p><b>print </b>'Hello '<br>  + 'World';</p>}.</p>
      +   *
      +   * <p>
      +   * It will produce the output:</p>
      +   * <pre>
      +   * {
      +   *   sourceCode: "print 'Hello '\n  + 'World';",
      +   *   //                 1         2
      +   *   //       012345678901234 5678901234567
      +   *   spans: [0, #1, 6, #2, 14, #3, 15, #4]
      +   * }
      +   * </pre>
      +   * <p>
      +   * where #1 is a reference to the {@code "print "} text node above, and so
      +   * on for the other text nodes.
      +   * </p>
      +   *
      +   * <p>
      +   * The {@code} spans array is an array of pairs.  Even elements are the start
      +   * indices of substrings, and odd elements are the text nodes (or BR elements)
      +   * that contain the text for those substrings.
      +   * Substrings continue until the next index or the end of the source.
      +   * </p>
      +   *
      +   * @param {Node} node an HTML DOM subtree containing source-code.
      +   * @return {Object} source code and the text nodes in which they occur.
      +   */
      +  function extractSourceSpans(node) {
      +    var nocode = /(?:^|\s)nocode(?:\s|$)/;
      +  
      +    var chunks = [];
      +    var length = 0;
      +    var spans = [];
      +    var k = 0;
      +  
      +    var whitespace;
      +    if (node.currentStyle) {
      +      whitespace = node.currentStyle.whiteSpace;
      +    } else if (window.getComputedStyle) {
      +      whitespace = document.defaultView.getComputedStyle(node, null)
      +          .getPropertyValue('white-space');
      +    }
      +    var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
      +  
      +    function walk(node) {
      +      switch (node.nodeType) {
      +        case 1:  // Element
      +          if (nocode.test(node.className)) { return; }
      +          for (var child = node.firstChild; child; child = child.nextSibling) {
      +            walk(child);
      +          }
      +          var nodeName = node.nodeName;
      +          if ('BR' === nodeName || 'LI' === nodeName) {
      +            chunks[k] = '\n';
      +            spans[k << 1] = length++;
      +            spans[(k++ << 1) | 1] = node;
      +          }
      +          break;
      +        case 3: case 4:  // Text
      +          var text = node.nodeValue;
      +          if (text.length) {
      +            if (!isPreformatted) {
      +              text = text.replace(/[ \t\r\n]+/g, ' ');
      +            } else {
      +              text = text.replace(/\r\n?/g, '\n');  // Normalize newlines.
      +            }
      +            // TODO: handle tabs here?
      +            chunks[k] = text;
      +            spans[k << 1] = length;
      +            length += text.length;
      +            spans[(k++ << 1) | 1] = node;
      +          }
      +          break;
      +      }
      +    }
      +  
      +    walk(node);
      +  
      +    return {
      +      sourceCode: chunks.join('').replace(/\n$/, ''),
      +      spans: spans
      +    };
      +  }
      +
      +
      +  /**
      +   * Apply the given language handler to sourceCode and add the resulting
      +   * decorations to out.
      +   * @param {number} basePos the index of sourceCode within the chunk of source
      +   *    whose decorations are already present on out.
      +   */
      +  function appendDecorations(basePos, sourceCode, langHandler, out) {
      +    if (!sourceCode) { return; }
      +    var job = {
      +      sourceCode: sourceCode,
      +      basePos: basePos
      +    };
      +    langHandler(job);
      +    out.push.apply(out, job.decorations);
      +  }
      +
      +  var notWs = /\S/;
      +
      +  /**
      +   * Given an element, if it contains only one child element and any text nodes
      +   * it contains contain only space characters, return the sole child element.
      +   * Otherwise returns undefined.
      +   * <p>
      +   * This is meant to return the CODE element in {@code <pre><code ...>} when
      +   * there is a single child element that contains all the non-space textual
      +   * content, but not to return anything where there are multiple child elements
      +   * as in {@code <pre><code>...</code><code>...</code></pre>} or when there
      +   * is textual content.
      +   */
      +  function childContentWrapper(element) {
      +    var wrapper = undefined;
      +    for (var c = element.firstChild; c; c = c.nextSibling) {
      +      var type = c.nodeType;
      +      wrapper = (type === 1)  // Element Node
      +          ? (wrapper ? element : c)
      +          : (type === 3)  // Text Node
      +          ? (notWs.test(c.nodeValue) ? element : wrapper)
      +          : wrapper;
      +    }
      +    return wrapper === element ? undefined : wrapper;
      +  }
      +
      +  /** Given triples of [style, pattern, context] returns a lexing function,
      +    * The lexing function interprets the patterns to find token boundaries and
      +    * returns a decoration list of the form
      +    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
      +    * where index_n is an index into the sourceCode, and style_n is a style
      +    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
      +    * all characters in sourceCode[index_n-1:index_n].
      +    *
      +    * The stylePatterns is a list whose elements have the form
      +    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
      +    *
      +    * Style is a style constant like PR_PLAIN, or can be a string of the
      +    * form 'lang-FOO', where FOO is a language extension describing the
      +    * language of the portion of the token in $1 after pattern executes.
      +    * E.g., if style is 'lang-lisp', and group 1 contains the text
      +    * '(hello (world))', then that portion of the token will be passed to the
      +    * registered lisp handler for formatting.
      +    * The text before and after group 1 will be restyled using this decorator
      +    * so decorators should take care that this doesn't result in infinite
      +    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
      +    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
      +    * '<script>foo()<\/script>', which would cause the current decorator to
      +    * be called with '<script>' which would not match the same rule since
      +    * group 1 must not be empty, so it would be instead styled as PR_TAG by
      +    * the generic tag rule.  The handler registered for the 'js' extension would
      +    * then be called with 'foo()', and finally, the current decorator would
      +    * be called with '<\/script>' which would not match the original rule and
      +    * so the generic tag rule would identify it as a tag.
      +    *
      +    * Pattern must only match prefixes, and if it matches a prefix, then that
      +    * match is considered a token with the same style.
      +    *
      +    * Context is applied to the last non-whitespace, non-comment token
      +    * recognized.
      +    *
      +    * Shortcut is an optional string of characters, any of which, if the first
      +    * character, gurantee that this pattern and only this pattern matches.
      +    *
      +    * @param {Array} shortcutStylePatterns patterns that always start with
      +    *   a known character.  Must have a shortcut string.
      +    * @param {Array} fallthroughStylePatterns patterns that will be tried in
      +    *   order if the shortcut ones fail.  May have shortcuts.
      +    *
      +    * @return {function (Object)} a
      +    *   function that takes source code and returns a list of decorations.
      +    */
      +  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
      +    var shortcuts = {};
      +    var tokenizer;
      +    (function () {
      +      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
      +      var allRegexs = [];
      +      var regexKeys = {};
      +      for (var i = 0, n = allPatterns.length; i < n; ++i) {
      +        var patternParts = allPatterns[i];
      +        var shortcutChars = patternParts[3];
      +        if (shortcutChars) {
      +          for (var c = shortcutChars.length; --c >= 0;) {
      +            shortcuts[shortcutChars.charAt(c)] = patternParts;
      +          }
      +        }
      +        var regex = patternParts[1];
      +        var k = '' + regex;
      +        if (!regexKeys.hasOwnProperty(k)) {
      +          allRegexs.push(regex);
      +          regexKeys[k] = null;
      +        }
      +      }
      +      allRegexs.push(/[\0-\uffff]/);
      +      tokenizer = combinePrefixPatterns(allRegexs);
      +    })();
      +
      +    var nPatterns = fallthroughStylePatterns.length;
      +
      +    /**
      +     * Lexes job.sourceCode and produces an output array job.decorations of
      +     * style classes preceded by the position at which they start in
      +     * job.sourceCode in order.
      +     *
      +     * @param {Object} job an object like <pre>{
      +     *    sourceCode: {string} sourceText plain text,
      +     *    basePos: {int} position of job.sourceCode in the larger chunk of
      +     *        sourceCode.
      +     * }</pre>
      +     */
      +    var decorate = function (job) {
      +      var sourceCode = job.sourceCode, basePos = job.basePos;
      +      /** Even entries are positions in source in ascending order.  Odd enties
      +        * are style markers (e.g., PR_COMMENT) that run from that position until
      +        * the end.
      +        * @type {Array.<number|string>}
      +        */
      +      var decorations = [basePos, PR_PLAIN];
      +      var pos = 0;  // index into sourceCode
      +      var tokens = sourceCode.match(tokenizer) || [];
      +      var styleCache = {};
      +
      +      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
      +        var token = tokens[ti];
      +        var style = styleCache[token];
      +        var match = void 0;
      +
      +        var isEmbedded;
      +        if (typeof style === 'string') {
      +          isEmbedded = false;
      +        } else {
      +          var patternParts = shortcuts[token.charAt(0)];
      +          if (patternParts) {
      +            match = token.match(patternParts[1]);
      +            style = patternParts[0];
      +          } else {
      +            for (var i = 0; i < nPatterns; ++i) {
      +              patternParts = fallthroughStylePatterns[i];
      +              match = token.match(patternParts[1]);
      +              if (match) {
      +                style = patternParts[0];
      +                break;
      +              }
      +            }
      +
      +            if (!match) {  // make sure that we make progress
      +              style = PR_PLAIN;
      +            }
      +          }
      +
      +          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
      +          if (isEmbedded && !(match && typeof match[1] === 'string')) {
      +            isEmbedded = false;
      +            style = PR_SOURCE;
      +          }
      +
      +          if (!isEmbedded) { styleCache[token] = style; }
      +        }
      +
      +        var tokenStart = pos;
      +        pos += token.length;
      +
      +        if (!isEmbedded) {
      +          decorations.push(basePos + tokenStart, style);
      +        } else {  // Treat group 1 as an embedded block of source code.
      +          var embeddedSource = match[1];
      +          var embeddedSourceStart = token.indexOf(embeddedSource);
      +          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
      +          if (match[2]) {
      +            // If embeddedSource can be blank, then it would match at the
      +            // beginning which would cause us to infinitely recurse on the
      +            // entire token, so we catch the right context in match[2].
      +            embeddedSourceEnd = token.length - match[2].length;
      +            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
      +          }
      +          var lang = style.substring(5);
      +          // Decorate the left of the embedded source
      +          appendDecorations(
      +              basePos + tokenStart,
      +              token.substring(0, embeddedSourceStart),
      +              decorate, decorations);
      +          // Decorate the embedded source
      +          appendDecorations(
      +              basePos + tokenStart + embeddedSourceStart,
      +              embeddedSource,
      +              langHandlerForExtension(lang, embeddedSource),
      +              decorations);
      +          // Decorate the right of the embedded section
      +          appendDecorations(
      +              basePos + tokenStart + embeddedSourceEnd,
      +              token.substring(embeddedSourceEnd),
      +              decorate, decorations);
      +        }
      +      }
      +      job.decorations = decorations;
      +    };
      +    return decorate;
      +  }
      +
      +  /** returns a function that produces a list of decorations from source text.
      +    *
      +    * This code treats ", ', and ` as string delimiters, and \ as a string
      +    * escape.  It does not recognize perl's qq() style strings.
      +    * It has no special handling for double delimiter escapes as in basic, or
      +    * the tripled delimiters used in python, but should work on those regardless
      +    * although in those cases a single string literal may be broken up into
      +    * multiple adjacent string literals.
      +    *
      +    * It recognizes C, C++, and shell style comments.
      +    *
      +    * @param {Object} options a set of optional parameters.
      +    * @return {function (Object)} a function that examines the source code
      +    *     in the input job and builds the decoration list.
      +    */
      +  function sourceDecorator(options) {
      +    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
      +    if (options['tripleQuotedStrings']) {
      +      // '''multi-line-string''', 'single-line-string', and double-quoted
      +      shortcutStylePatterns.push(
      +          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
      +           null, '\'"']);
      +    } else if (options['multiLineStrings']) {
      +      // 'multi-line-string', "multi-line-string"
      +      shortcutStylePatterns.push(
      +          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
      +           null, '\'"`']);
      +    } else {
      +      // 'single-line-string', "single-line-string"
      +      shortcutStylePatterns.push(
      +          [PR_STRING,
      +           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
      +           null, '"\'']);
      +    }
      +    if (options['verbatimStrings']) {
      +      // verbatim-string-literal production from the C# grammar.  See issue 93.
      +      fallthroughStylePatterns.push(
      +          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
      +    }
      +    var hc = options['hashComments'];
      +    if (hc) {
      +      if (options['cStyleComments']) {
      +        if (hc > 1) {  // multiline hash comments
      +          shortcutStylePatterns.push(
      +              [PR_COMMENT, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']);
      +        } else {
      +          // Stop C preprocessor declarations at an unclosed open comment
      +          shortcutStylePatterns.push(
      +              [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
      +               null, '#']);
      +        }
      +        fallthroughStylePatterns.push(
      +            [PR_STRING,
      +             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
      +             null]);
      +      } else {
      +        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
      +      }
      +    }
      +    if (options['cStyleComments']) {
      +      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
      +      fallthroughStylePatterns.push(
      +          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
      +    }
      +    if (options['regexLiterals']) {
      +      /**
      +       * @const
      +       */
      +      var REGEX_LITERAL = (
      +          // A regular expression literal starts with a slash that is
      +          // not followed by * or / so that it is not confused with
      +          // comments.
      +          '/(?=[^/*])'
      +          // and then contains any number of raw characters,
      +          + '(?:[^/\\x5B\\x5C]'
      +          // escape sequences (\x5C),
      +          +    '|\\x5C[\\s\\S]'
      +          // or non-nesting character sets (\x5B\x5D);
      +          +    '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'
      +          // finally closed by a /.
      +          + '/');
      +      fallthroughStylePatterns.push(
      +          ['lang-regex',
      +           new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
      +           ]);
      +    }
      +
      +    var types = options['types'];
      +    if (types) {
      +      fallthroughStylePatterns.push([PR_TYPE, types]);
      +    }
      +
      +    var keywords = ("" + options['keywords']).replace(/^ | $/g, '');
      +    if (keywords.length) {
      +      fallthroughStylePatterns.push(
      +          [PR_KEYWORD,
      +           new RegExp('^(?:' + keywords.replace(/[\s,]+/g, '|') + ')\\b'),
      +           null]);
      +    }
      +
      +    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
      +    fallthroughStylePatterns.push(
      +        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
      +        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
      +        [PR_TYPE,        /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null],
      +        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
      +        [PR_LITERAL,
      +         new RegExp(
      +             '^(?:'
      +             // A hex number
      +             + '0x[a-f0-9]+'
      +             // or an octal or decimal number,
      +             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
      +             // possibly in scientific notation
      +             + '(?:e[+\\-]?\\d+)?'
      +             + ')'
      +             // with an optional modifier like UL for unsigned long
      +             + '[a-z]*', 'i'),
      +         null, '0123456789'],
      +        // Don't treat escaped quotes in bash as starting strings.  See issue 144.
      +        [PR_PLAIN,       /^\\[\s\S]?/, null],
      +        [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#\\]*/, null]);
      +
      +    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
      +  }
      +
      +  var decorateSource = sourceDecorator({
      +        'keywords': ALL_KEYWORDS,
      +        'hashComments': true,
      +        'cStyleComments': true,
      +        'multiLineStrings': true,
      +        'regexLiterals': true
      +      });
      +
      +  /**
      +   * Given a DOM subtree, wraps it in a list, and puts each line into its own
      +   * list item.
      +   *
      +   * @param {Node} node modified in place.  Its content is pulled into an
      +   *     HTMLOListElement, and each line is moved into a separate list item.
      +   *     This requires cloning elements, so the input might not have unique
      +   *     IDs after numbering.
      +   */
      +  function numberLines(node, opt_startLineNum) {
      +    var nocode = /(?:^|\s)nocode(?:\s|$)/;
      +    var lineBreak = /\r\n?|\n/;
      +  
      +    var document = node.ownerDocument;
      +  
      +    var whitespace;
      +    if (node.currentStyle) {
      +      whitespace = node.currentStyle.whiteSpace;
      +    } else if (window.getComputedStyle) {
      +      whitespace = document.defaultView.getComputedStyle(node, null)
      +          .getPropertyValue('white-space');
      +    }
      +    // If it's preformatted, then we need to split lines on line breaks
      +    // in addition to <BR>s.
      +    var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
      +  
      +    var li = document.createElement('LI');
      +    while (node.firstChild) {
      +      li.appendChild(node.firstChild);
      +    }
      +    // An array of lines.  We split below, so this is initialized to one
      +    // un-split line.
      +    var listItems = [li];
      +  
      +    function walk(node) {
      +      switch (node.nodeType) {
      +        case 1:  // Element
      +          if (nocode.test(node.className)) { break; }
      +          if ('BR' === node.nodeName) {
      +            breakAfter(node);
      +            // Discard the <BR> since it is now flush against a </LI>.
      +            if (node.parentNode) {
      +              node.parentNode.removeChild(node);
      +            }
      +          } else {
      +            for (var child = node.firstChild; child; child = child.nextSibling) {
      +              walk(child);
      +            }
      +          }
      +          break;
      +        case 3: case 4:  // Text
      +          if (isPreformatted) {
      +            var text = node.nodeValue;
      +            var match = text.match(lineBreak);
      +            if (match) {
      +              var firstLine = text.substring(0, match.index);
      +              node.nodeValue = firstLine;
      +              var tail = text.substring(match.index + match[0].length);
      +              if (tail) {
      +                var parent = node.parentNode;
      +                parent.insertBefore(
      +                    document.createTextNode(tail), node.nextSibling);
      +              }
      +              breakAfter(node);
      +              if (!firstLine) {
      +                // Don't leave blank text nodes in the DOM.
      +                node.parentNode.removeChild(node);
      +              }
      +            }
      +          }
      +          break;
      +      }
      +    }
      +  
      +    // Split a line after the given node.
      +    function breakAfter(lineEndNode) {
      +      // If there's nothing to the right, then we can skip ending the line
      +      // here, and move root-wards since splitting just before an end-tag
      +      // would require us to create a bunch of empty copies.
      +      while (!lineEndNode.nextSibling) {
      +        lineEndNode = lineEndNode.parentNode;
      +        if (!lineEndNode) { return; }
      +      }
      +  
      +      function breakLeftOf(limit, copy) {
      +        // Clone shallowly if this node needs to be on both sides of the break.
      +        var rightSide = copy ? limit.cloneNode(false) : limit;
      +        var parent = limit.parentNode;
      +        if (parent) {
      +          // We clone the parent chain.
      +          // This helps us resurrect important styling elements that cross lines.
      +          // E.g. in <i>Foo<br>Bar</i>
      +          // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.
      +          var parentClone = breakLeftOf(parent, 1);
      +          // Move the clone and everything to the right of the original
      +          // onto the cloned parent.
      +          var next = limit.nextSibling;
      +          parentClone.appendChild(rightSide);
      +          for (var sibling = next; sibling; sibling = next) {
      +            next = sibling.nextSibling;
      +            parentClone.appendChild(sibling);
      +          }
      +        }
      +        return rightSide;
      +      }
      +  
      +      var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);
      +  
      +      // Walk the parent chain until we reach an unattached LI.
      +      for (var parent;
      +           // Check nodeType since IE invents document fragments.
      +           (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {
      +        copiedListItem = parent;
      +      }
      +      // Put it on the list of lines for later processing.
      +      listItems.push(copiedListItem);
      +    }
      +  
      +    // Split lines while there are lines left to split.
      +    for (var i = 0;  // Number of lines that have been split so far.
      +         i < listItems.length;  // length updated by breakAfter calls.
      +         ++i) {
      +      walk(listItems[i]);
      +    }
      +  
      +    // Make sure numeric indices show correctly.
      +    if (opt_startLineNum === (opt_startLineNum|0)) {
      +      listItems[0].setAttribute('value', opt_startLineNum);
      +    }
      +  
      +    var ol = document.createElement('OL');
      +    ol.className = 'linenums';
      +    var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
      +    for (var i = 0, n = listItems.length; i < n; ++i) {
      +      li = listItems[i];
      +      // Stick a class on the LIs so that stylesheets can
      +      // color odd/even rows, or any other row pattern that
      +      // is co-prime with 10.
      +      li.className = 'L' + ((i + offset) % 10);
      +      if (!li.firstChild) {
      +        li.appendChild(document.createTextNode('\xA0'));
      +      }
      +      ol.appendChild(li);
      +    }
      +  
      +    node.appendChild(ol);
      +  }
      +
      +  /**
      +   * Breaks {@code job.sourceCode} around style boundaries in
      +   * {@code job.decorations} and modifies {@code job.sourceNode} in place.
      +   * @param {Object} job like <pre>{
      +   *    sourceCode: {string} source as plain text,
      +   *    spans: {Array.<number|Node>} alternating span start indices into source
      +   *       and the text node or element (e.g. {@code <BR>}) corresponding to that
      +   *       span.
      +   *    decorations: {Array.<number|string} an array of style classes preceded
      +   *       by the position at which they start in job.sourceCode in order
      +   * }</pre>
      +   * @private
      +   */
      +  function recombineTagsAndDecorations(job) {
      +    var isIE = /\bMSIE\b/.test(navigator.userAgent);
      +    var newlineRe = /\n/g;
      +  
      +    var source = job.sourceCode;
      +    var sourceLength = source.length;
      +    // Index into source after the last code-unit recombined.
      +    var sourceIndex = 0;
      +  
      +    var spans = job.spans;
      +    var nSpans = spans.length;
      +    // Index into spans after the last span which ends at or before sourceIndex.
      +    var spanIndex = 0;
      +  
      +    var decorations = job.decorations;
      +    var nDecorations = decorations.length;
      +    // Index into decorations after the last decoration which ends at or before
      +    // sourceIndex.
      +    var decorationIndex = 0;
      +  
      +    // Remove all zero-length decorations.
      +    decorations[nDecorations] = sourceLength;
      +    var decPos, i;
      +    for (i = decPos = 0; i < nDecorations;) {
      +      if (decorations[i] !== decorations[i + 2]) {
      +        decorations[decPos++] = decorations[i++];
      +        decorations[decPos++] = decorations[i++];
      +      } else {
      +        i += 2;
      +      }
      +    }
      +    nDecorations = decPos;
      +  
      +    // Simplify decorations.
      +    for (i = decPos = 0; i < nDecorations;) {
      +      var startPos = decorations[i];
      +      // Conflate all adjacent decorations that use the same style.
      +      var startDec = decorations[i + 1];
      +      var end = i + 2;
      +      while (end + 2 <= nDecorations && decorations[end + 1] === startDec) {
      +        end += 2;
      +      }
      +      decorations[decPos++] = startPos;
      +      decorations[decPos++] = startDec;
      +      i = end;
      +    }
      +  
      +    nDecorations = decorations.length = decPos;
      +  
      +    var decoration = null;
      +    while (spanIndex < nSpans) {
      +      var spanStart = spans[spanIndex];
      +      var spanEnd = spans[spanIndex + 2] || sourceLength;
      +  
      +      var decStart = decorations[decorationIndex];
      +      var decEnd = decorations[decorationIndex + 2] || sourceLength;
      +  
      +      var end = Math.min(spanEnd, decEnd);
      +  
      +      var textNode = spans[spanIndex + 1];
      +      var styledText;
      +      if (textNode.nodeType !== 1  // Don't muck with <BR>s or <LI>s
      +          // Don't introduce spans around empty text nodes.
      +          && (styledText = source.substring(sourceIndex, end))) {
      +        // This may seem bizarre, and it is.  Emitting LF on IE causes the
      +        // code to display with spaces instead of line breaks.
      +        // Emitting Windows standard issue linebreaks (CRLF) causes a blank
      +        // space to appear at the beginning of every line but the first.
      +        // Emitting an old Mac OS 9 line separator makes everything spiffy.
      +        if (isIE) { styledText = styledText.replace(newlineRe, '\r'); }
      +        textNode.nodeValue = styledText;
      +        var document = textNode.ownerDocument;
      +        var span = document.createElement('SPAN');
      +        span.className = decorations[decorationIndex + 1];
      +        var parentNode = textNode.parentNode;
      +        parentNode.replaceChild(span, textNode);
      +        span.appendChild(textNode);
      +        if (sourceIndex < spanEnd) {  // Split off a text node.
      +          spans[spanIndex + 1] = textNode
      +              // TODO: Possibly optimize by using '' if there's no flicker.
      +              = document.createTextNode(source.substring(end, spanEnd));
      +          parentNode.insertBefore(textNode, span.nextSibling);
      +        }
      +      }
      +  
      +      sourceIndex = end;
      +  
      +      if (sourceIndex >= spanEnd) {
      +        spanIndex += 2;
      +      }
      +      if (sourceIndex >= decEnd) {
      +        decorationIndex += 2;
      +      }
      +    }
      +  }
      +
      +
      +  /** Maps language-specific file extensions to handlers. */
      +  var langHandlerRegistry = {};
      +  /** Register a language handler for the given file extensions.
      +    * @param {function (Object)} handler a function from source code to a list
      +    *      of decorations.  Takes a single argument job which describes the
      +    *      state of the computation.   The single parameter has the form
      +    *      {@code {
      +    *        sourceCode: {string} as plain text.
      +    *        decorations: {Array.<number|string>} an array of style classes
      +    *                     preceded by the position at which they start in
      +    *                     job.sourceCode in order.
      +    *                     The language handler should assigned this field.
      +    *        basePos: {int} the position of source in the larger source chunk.
      +    *                 All positions in the output decorations array are relative
      +    *                 to the larger source chunk.
      +    *      } }
      +    * @param {Array.<string>} fileExtensions
      +    */
      +  function registerLangHandler(handler, fileExtensions) {
      +    for (var i = fileExtensions.length; --i >= 0;) {
      +      var ext = fileExtensions[i];
      +      if (!langHandlerRegistry.hasOwnProperty(ext)) {
      +        langHandlerRegistry[ext] = handler;
      +      } else if (window['console']) {
      +        console['warn']('cannot override language handler %s', ext);
      +      }
      +    }
      +  }
      +  function langHandlerForExtension(extension, source) {
      +    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
      +      // Treat it as markup if the first non whitespace character is a < and
      +      // the last non-whitespace character is a >.
      +      extension = /^\s*</.test(source)
      +          ? 'default-markup'
      +          : 'default-code';
      +    }
      +    return langHandlerRegistry[extension];
      +  }
      +  registerLangHandler(decorateSource, ['default-code']);
      +  registerLangHandler(
      +      createSimpleLexer(
      +          [],
      +          [
      +           [PR_PLAIN,       /^[^<?]+/],
      +           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
      +           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
      +           // Unescaped content in an unknown language
      +           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
      +           ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
      +           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
      +           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
      +           // Unescaped content in javascript.  (Or possibly vbscript).
      +           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
      +           // Contains unescaped stylesheet content
      +           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
      +           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
      +          ]),
      +      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
      +  registerLangHandler(
      +      createSimpleLexer(
      +          [
      +           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
      +           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
      +           ],
      +          [
      +           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
      +           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
      +           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
      +           [PR_PUNCTUATION,  /^[=<>\/]+/],
      +           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
      +           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
      +           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
      +           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
      +           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
      +           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
      +           ]),
      +      ['in.tag']);
      +  registerLangHandler(
      +      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': CPP_KEYWORDS,
      +          'hashComments': true,
      +          'cStyleComments': true,
      +          'types': C_TYPES
      +        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': 'null,true,false'
      +        }), ['json']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': CSHARP_KEYWORDS,
      +          'hashComments': true,
      +          'cStyleComments': true,
      +          'verbatimStrings': true,
      +          'types': C_TYPES
      +        }), ['cs']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': JAVA_KEYWORDS,
      +          'cStyleComments': true
      +        }), ['java']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': SH_KEYWORDS,
      +          'hashComments': true,
      +          'multiLineStrings': true
      +        }), ['bsh', 'csh', 'sh']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': PYTHON_KEYWORDS,
      +          'hashComments': true,
      +          'multiLineStrings': true,
      +          'tripleQuotedStrings': true
      +        }), ['cv', 'py']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': PERL_KEYWORDS,
      +          'hashComments': true,
      +          'multiLineStrings': true,
      +          'regexLiterals': true
      +        }), ['perl', 'pl', 'pm']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': RUBY_KEYWORDS,
      +          'hashComments': true,
      +          'multiLineStrings': true,
      +          'regexLiterals': true
      +        }), ['rb']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': JSCRIPT_KEYWORDS,
      +          'cStyleComments': true,
      +          'regexLiterals': true
      +        }), ['js']);
      +  registerLangHandler(sourceDecorator({
      +          'keywords': COFFEE_KEYWORDS,
      +          'hashComments': 3,  // ### style block comments
      +          'cStyleComments': true,
      +          'multilineStrings': true,
      +          'tripleQuotedStrings': true,
      +          'regexLiterals': true
      +        }), ['coffee']);
      +  registerLangHandler(createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
      +
      +  function applyDecorator(job) {
      +    var opt_langExtension = job.langExtension;
      +
      +    try {
      +      // Extract tags, and convert the source code to plain text.
      +      var sourceAndSpans = extractSourceSpans(job.sourceNode);
      +      /** Plain text. @type {string} */
      +      var source = sourceAndSpans.sourceCode;
      +      job.sourceCode = source;
      +      job.spans = sourceAndSpans.spans;
      +      job.basePos = 0;
      +
      +      // Apply the appropriate language handler
      +      langHandlerForExtension(opt_langExtension, source)(job);
      +
      +      // Integrate the decorations and tags back into the source code,
      +      // modifying the sourceNode in place.
      +      recombineTagsAndDecorations(job);
      +    } catch (e) {
      +      if ('console' in window) {
      +        console['log'](e && e['stack'] ? e['stack'] : e);
      +      }
      +    }
      +  }
      +
      +  /**
      +   * @param sourceCodeHtml {string} The HTML to pretty print.
      +   * @param opt_langExtension {string} The language name to use.
      +   *     Typically, a filename extension like 'cpp' or 'java'.
      +   * @param opt_numberLines {number|boolean} True to number lines,
      +   *     or the 1-indexed number of the first line in sourceCodeHtml.
      +   */
      +  function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
      +    var container = document.createElement('PRE');
      +    // This could cause images to load and onload listeners to fire.
      +    // E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
      +    // We assume that the inner HTML is from a trusted source.
      +    container.innerHTML = sourceCodeHtml;
      +    if (opt_numberLines) {
      +      numberLines(container, opt_numberLines);
      +    }
      +
      +    var job = {
      +      langExtension: opt_langExtension,
      +      numberLines: opt_numberLines,
      +      sourceNode: container
      +    };
      +    applyDecorator(job);
      +    return container.innerHTML;
      +  }
      +
      +  function prettyPrint(opt_whenDone) {
      +    function byTagName(tn) { return document.getElementsByTagName(tn); }
      +    // fetch a list of nodes to rewrite
      +    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
      +    var elements = [];
      +    for (var i = 0; i < codeSegments.length; ++i) {
      +      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
      +        elements.push(codeSegments[i][j]);
      +      }
      +    }
      +    codeSegments = null;
      +
      +    var clock = Date;
      +    if (!clock['now']) {
      +      clock = { 'now': function () { return +(new Date); } };
      +    }
      +
      +    // The loop is broken into a series of continuations to make sure that we
      +    // don't make the browser unresponsive when rewriting a large page.
      +    var k = 0;
      +    var prettyPrintingJob;
      +
      +    var langExtensionRe = /\blang(?:uage)?-([\w.]+)(?!\S)/;
      +    var prettyPrintRe = /\bprettyprint\b/;
      +
      +    function doWork() {
      +      var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
      +                     clock['now']() + 250 /* ms */ :
      +                     Infinity);
      +      for (; k < elements.length && clock['now']() < endTime; k++) {
      +        var cs = elements[k];
      +        var className = cs.className;
      +        if (className.indexOf('prettyprint') >= 0) {
      +          // If the classes includes a language extensions, use it.
      +          // Language extensions can be specified like
      +          //     <pre class="prettyprint lang-cpp">
      +          // the language extension "cpp" is used to find a language handler as
      +          // passed to PR.registerLangHandler.
      +          // HTML5 recommends that a language be specified using "language-"
      +          // as the prefix instead.  Google Code Prettify supports both.
      +          // http://dev.w3.org/html5/spec-author-view/the-code-element.html
      +          var langExtension = className.match(langExtensionRe);
      +          // Support <pre class="prettyprint"><code class="language-c">
      +          var wrapper;
      +          if (!langExtension && (wrapper = childContentWrapper(cs))
      +              && "CODE" === wrapper.tagName) {
      +            langExtension = wrapper.className.match(langExtensionRe);
      +          }
      +
      +          if (langExtension) {
      +            langExtension = langExtension[1];
      +          }
      +
      +          // make sure this is not nested in an already prettified element
      +          var nested = false;
      +          for (var p = cs.parentNode; p; p = p.parentNode) {
      +            if ((p.tagName === 'pre' || p.tagName === 'code' ||
      +                 p.tagName === 'xmp') &&
      +                p.className && p.className.indexOf('prettyprint') >= 0) {
      +              nested = true;
      +              break;
      +            }
      +          }
      +          if (!nested) {
      +            // Look for a class like linenums or linenums:<n> where <n> is the
      +            // 1-indexed number of the first line.
      +            var lineNums = cs.className.match(/\blinenums\b(?::(\d+))?/);
      +            lineNums = lineNums
      +                  ? lineNums[1] && lineNums[1].length ? +lineNums[1] : true
      +                  : false;
      +            if (lineNums) { numberLines(cs, lineNums); }
      +
      +            // do the pretty printing
      +            prettyPrintingJob = {
      +              langExtension: langExtension,
      +              sourceNode: cs,
      +              numberLines: lineNums
      +            };
      +            applyDecorator(prettyPrintingJob);
      +          }
      +        }
      +      }
      +      if (k < elements.length) {
      +        // finish up in a continuation
      +        setTimeout(doWork, 250);
      +      } else if (opt_whenDone) {
      +        opt_whenDone();
      +      }
      +    }
      +
      +    doWork();
      +  }
      +
      +   /**
      +    * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
      +    * {@code class=prettyprint} and prettify them.
      +    *
      +    * @param {Function?} opt_whenDone if specified, called when the last entry
      +    *     has been finished.
      +    */
      +  window['prettyPrintOne'] = prettyPrintOne;
      +   /**
      +    * Pretty print a chunk of code.
      +    *
      +    * @param {string} sourceCodeHtml code as html
      +    * @return {string} code as html, but prettier
      +    */
      +  window['prettyPrint'] = prettyPrint;
      +   /**
      +    * Contains functions for creating and registering new language handlers.
      +    * @type {Object}
      +    */
      +  window['PR'] = {
      +        'createSimpleLexer': createSimpleLexer,
      +        'registerLangHandler': registerLangHandler,
      +        'sourceDecorator': sourceDecorator,
      +        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
      +        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
      +        'PR_COMMENT': PR_COMMENT,
      +        'PR_DECLARATION': PR_DECLARATION,
      +        'PR_KEYWORD': PR_KEYWORD,
      +        'PR_LITERAL': PR_LITERAL,
      +        'PR_NOCODE': PR_NOCODE,
      +        'PR_PLAIN': PR_PLAIN,
      +        'PR_PUNCTUATION': PR_PUNCTUATION,
      +        'PR_SOURCE': PR_SOURCE,
      +        'PR_STRING': PR_STRING,
      +        'PR_TAG': PR_TAG,
      +        'PR_TYPE': PR_TYPE
      +      };
      +})();
      diff --git a/js/site.js b/js/site.js
      new file mode 100755
      index 0000000..3632c5d
      --- /dev/null
      +++ b/js/site.js
      @@ -0,0 +1,31 @@
      +
      +(function($) {
      +	
      +var snapper = new Snap({
      +    element: document.getElementById('page'),
      +    disable: 'right',
      +    touchToDrag: false,
      +    hyperextensible: false
      +});
      +
      +var myToggleButton =  document.getElementById('myToggleButton');
      +
      +if ($("#myToggleButton").length>0) {
      +
      +    myToggleButton.addEventListener('click', function(){
      +
      +        if( snapper.state().state=="left" ){
      +            snapper.close();
      +        } else {
      +            snapper.open('left');
      +        }
      +
      +    });
      +
      +};
      +	
      +	$('code, pre').addClass('prettyprint');
      +
      +	prettyPrint();
      +
      +})( jQuery );
      diff --git a/js/snap.min.js b/js/snap.min.js
      new file mode 100755
      index 0000000..2a3b22f
      --- /dev/null
      +++ b/js/snap.min.js
      @@ -0,0 +1,11 @@
      +/*
      + * Snap.js
      + *
      + * Copyright 2013, Jacob Kelley - http://jakiestfu.com/
      + * Released under the MIT Licence
      + * http://opensource.org/licenses/MIT
      + *
      + * Github:  http://github.com/jakiestfu/Snap.js/
      + * Version: 1.9.2
      + */
      + (function(c,b){var a=a||function(k){var f={element:null,dragger:null,disable:"none",addBodyClasses:true,hyperextensible:true,resistance:0.5,flickThreshold:50,transitionSpeed:0.3,easing:"ease",maxPosition:266,minPosition:-266,tapToClose:true,touchToDrag:true,slideIntent:40,minDragDistance:5},e={simpleStates:{opening:null,towards:null,hyperExtending:null,halfway:null,flick:null,translation:{absolute:0,relative:0,sinceDirectionChange:0,percentage:0}}},h={},d={hasTouch:(b.ontouchstart===null),eventType:function(m){var l={down:(d.hasTouch?"touchstart":"mousedown"),move:(d.hasTouch?"touchmove":"mousemove"),up:(d.hasTouch?"touchend":"mouseup"),out:(d.hasTouch?"touchcancel":"mouseout")};return l[m]},page:function(l,m){return(d.hasTouch&&m.touches.length&&m.touches[0])?m.touches[0]["page"+l]:m["page"+l]},klass:{has:function(m,l){return(m.className).indexOf(l)!==-1},add:function(m,l){if(!d.klass.has(m,l)&&f.addBodyClasses){m.className+=" "+l}},remove:function(m,l){if(f.addBodyClasses){m.className=(m.className).replace(l,"").replace(/^\s+|\s+$/g,"")}}},dispatchEvent:function(l){if(typeof h[l]==="function"){return h[l].call()}},vendor:function(){var m=b.createElement("div"),n="webkit Moz O ms".split(" "),l;for(l in n){if(typeof m.style[n[l]+"Transition"]!=="undefined"){return n[l]}}},transitionCallback:function(){return(e.vendor==="Moz"||e.vendor==="ms")?"transitionend":e.vendor+"TransitionEnd"},canTransform:function(){return typeof f.element.style[e.vendor+"Transform"]!=="undefined"},deepExtend:function(l,n){var m;for(m in n){if(n[m]&&n[m].constructor&&n[m].constructor===Object){l[m]=l[m]||{};d.deepExtend(l[m],n[m])}else{l[m]=n[m]}}return l},angleOfDrag:function(l,o){var n,m;m=Math.atan2(-(e.startDragY-o),(e.startDragX-l));if(m<0){m+=2*Math.PI}n=Math.floor(m*(180/Math.PI)-180);if(n<0&&n>-180){n=360-Math.abs(n)}return Math.abs(n)},events:{addEvent:function g(m,l,n){if(m.addEventListener){return m.addEventListener(l,n,false)}else{if(m.attachEvent){return m.attachEvent("on"+l,n)}}},removeEvent:function g(m,l,n){if(m.addEventListener){return m.removeEventListener(l,n,false)}else{if(m.attachEvent){return m.detachEvent("on"+l,n)}}},prevent:function(l){if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}}},parentUntil:function(n,l){var m=typeof l==="string";while(n.parentNode){if(m&&n.getAttribute&&n.getAttribute(l)){return n}else{if(!m&&n===l){return n}}n=n.parentNode}return null}},i={translate:{get:{matrix:function(n){if(!d.canTransform()){return parseInt(f.element.style.left,10)}else{var m=c.getComputedStyle(f.element)[e.vendor+"Transform"].match(/\((.*)\)/),l=8;if(m){m=m[1].split(",");if(m.length===16){n+=l}return parseInt(m[n],10)}return 0}}},easeCallback:function(){f.element.style[e.vendor+"Transition"]="";e.translation=i.translate.get.matrix(4);e.easing=false;clearInterval(e.animatingInterval);if(e.easingTo===0){d.klass.remove(b.body,"snapjs-right");d.klass.remove(b.body,"snapjs-left")}d.dispatchEvent("animated");d.events.removeEvent(f.element,d.transitionCallback(),i.translate.easeCallback)},easeTo:function(l){if(!d.canTransform()){e.translation=l;i.translate.x(l)}else{e.easing=true;e.easingTo=l;f.element.style[e.vendor+"Transition"]="all "+f.transitionSpeed+"s "+f.easing;e.animatingInterval=setInterval(function(){d.dispatchEvent("animating")},1);d.events.addEvent(f.element,d.transitionCallback(),i.translate.easeCallback);i.translate.x(l)}if(l===0){f.element.style[e.vendor+"Transform"]=""}},x:function(m){if((f.disable==="left"&&m>0)||(f.disable==="right"&&m<0)){return}if(!f.hyperextensible){if(m===f.maxPosition||m>f.maxPosition){m=f.maxPosition}else{if(m===f.minPosition||m<f.minPosition){m=f.minPosition}}}m=parseInt(m,10);if(isNaN(m)){m=0}if(d.canTransform()){var l="translate3d("+m+"px, 0,0)";f.element.style[e.vendor+"Transform"]=l}else{f.element.style.width=(c.innerWidth||b.documentElement.clientWidth)+"px";f.element.style.left=m+"px";f.element.style.right=""}}},drag:{listen:function(){e.translation=0;e.easing=false;d.events.addEvent(f.element,d.eventType("down"),i.drag.startDrag);d.events.addEvent(f.element,d.eventType("move"),i.drag.dragging);d.events.addEvent(f.element,d.eventType("up"),i.drag.endDrag)},stopListening:function(){d.events.removeEvent(f.element,d.eventType("down"),i.drag.startDrag);d.events.removeEvent(f.element,d.eventType("move"),i.drag.dragging);d.events.removeEvent(f.element,d.eventType("up"),i.drag.endDrag)},startDrag:function(n){var m=n.target?n.target:n.srcElement,l=d.parentUntil(m,"data-snap-ignore");if(l){d.dispatchEvent("ignore");return}if(f.dragger){var o=d.parentUntil(m,f.dragger);if(!o&&(e.translation!==f.minPosition&&e.translation!==f.maxPosition)){return}}d.dispatchEvent("start");f.element.style[e.vendor+"Transition"]="";e.isDragging=true;e.hasIntent=null;e.intentChecked=false;e.startDragX=d.page("X",n);e.startDragY=d.page("Y",n);e.dragWatchers={current:0,last:0,hold:0,state:""};e.simpleStates={opening:null,towards:null,hyperExtending:null,halfway:null,flick:null,translation:{absolute:0,relative:0,sinceDirectionChange:0,percentage:0}}},dragging:function(s){if(e.isDragging&&f.touchToDrag){var v=d.page("X",s),u=d.page("Y",s),t=e.translation,o=i.translate.get.matrix(4),n=v-e.startDragX,p=o>0,q=n,w;if((e.intentChecked&&!e.hasIntent)){return}if(f.addBodyClasses){if((o)>0){d.klass.add(b.body,"snapjs-left");d.klass.remove(b.body,"snapjs-right")}else{if((o)<0){d.klass.add(b.body,"snapjs-right");d.klass.remove(b.body,"snapjs-left")}}}if(e.hasIntent===false||e.hasIntent===null){var m=d.angleOfDrag(v,u),l=(m>=0&&m<=f.slideIntent)||(m<=360&&m>(360-f.slideIntent)),r=(m>=180&&m<=(180+f.slideIntent))||(m<=180&&m>=(180-f.slideIntent));if(!r&&!l){e.hasIntent=false}else{e.hasIntent=true}e.intentChecked=true}if((f.minDragDistance>=Math.abs(v-e.startDragX))||(e.hasIntent===false)){return}d.events.prevent(s);d.dispatchEvent("drag");e.dragWatchers.current=v;if(e.dragWatchers.last>v){if(e.dragWatchers.state!=="left"){e.dragWatchers.state="left";e.dragWatchers.hold=v}e.dragWatchers.last=v}else{if(e.dragWatchers.last<v){if(e.dragWatchers.state!=="right"){e.dragWatchers.state="right";e.dragWatchers.hold=v}e.dragWatchers.last=v}}if(p){if(f.maxPosition<o){w=(o-f.maxPosition)*f.resistance;q=n-w}e.simpleStates={opening:"left",towards:e.dragWatchers.state,hyperExtending:f.maxPosition<o,halfway:o>(f.maxPosition/2),flick:Math.abs(e.dragWatchers.current-e.dragWatchers.hold)>f.flickThreshold,translation:{absolute:o,relative:n,sinceDirectionChange:(e.dragWatchers.current-e.dragWatchers.hold),percentage:(o/f.maxPosition)*100}}}else{if(f.minPosition>o){w=(o-f.minPosition)*f.resistance;q=n-w}e.simpleStates={opening:"right",towards:e.dragWatchers.state,hyperExtending:f.minPosition>o,halfway:o<(f.minPosition/2),flick:Math.abs(e.dragWatchers.current-e.dragWatchers.hold)>f.flickThreshold,translation:{absolute:o,relative:n,sinceDirectionChange:(e.dragWatchers.current-e.dragWatchers.hold),percentage:(o/f.minPosition)*100}}}i.translate.x(q+t)}},endDrag:function(m){if(e.isDragging){d.dispatchEvent("end");var l=i.translate.get.matrix(4);if(e.dragWatchers.current===0&&l!==0&&f.tapToClose){d.dispatchEvent("close");d.events.prevent(m);i.translate.easeTo(0);e.isDragging=false;e.startDragX=0;return}if(e.simpleStates.opening==="left"){if((e.simpleStates.halfway||e.simpleStates.hyperExtending||e.simpleStates.flick)){if(e.simpleStates.flick&&e.simpleStates.towards==="left"){i.translate.easeTo(0)}else{if((e.simpleStates.flick&&e.simpleStates.towards==="right")||(e.simpleStates.halfway||e.simpleStates.hyperExtending)){i.translate.easeTo(f.maxPosition)}}}else{i.translate.easeTo(0)}}else{if(e.simpleStates.opening==="right"){if((e.simpleStates.halfway||e.simpleStates.hyperExtending||e.simpleStates.flick)){if(e.simpleStates.flick&&e.simpleStates.towards==="right"){i.translate.easeTo(0)}else{if((e.simpleStates.flick&&e.simpleStates.towards==="left")||(e.simpleStates.halfway||e.simpleStates.hyperExtending)){i.translate.easeTo(f.minPosition)}}}else{i.translate.easeTo(0)}}}e.isDragging=false;e.startDragX=d.page("X",m)}}}},j=function(l){if(l.element){d.deepExtend(f,l);e.vendor=d.vendor();i.drag.listen()}};this.open=function(l){d.dispatchEvent("open");d.klass.remove(b.body,"snapjs-expand-left");d.klass.remove(b.body,"snapjs-expand-right");if(l==="left"){e.simpleStates.opening="left";e.simpleStates.towards="right";d.klass.add(b.body,"snapjs-left");d.klass.remove(b.body,"snapjs-right");i.translate.easeTo(f.maxPosition)}else{if(l==="right"){e.simpleStates.opening="right";e.simpleStates.towards="left";d.klass.remove(b.body,"snapjs-left");d.klass.add(b.body,"snapjs-right");i.translate.easeTo(f.minPosition)}}};this.close=function(){d.dispatchEvent("close");i.translate.easeTo(0)};this.expand=function(l){var m=c.innerWidth||b.documentElement.clientWidth;if(l==="left"){d.dispatchEvent("expandLeft");d.klass.add(b.body,"snapjs-expand-left");d.klass.remove(b.body,"snapjs-expand-right")}else{d.dispatchEvent("expandRight");d.klass.add(b.body,"snapjs-expand-right");d.klass.remove(b.body,"snapjs-expand-left");m*=-1}i.translate.easeTo(m)};this.on=function(l,m){h[l]=m;return this};this.off=function(l){if(h[l]){h[l]=false}};this.enable=function(){d.dispatchEvent("enable");i.drag.listen()};this.disable=function(){d.dispatchEvent("disable");i.drag.stopListening()};this.settings=function(l){d.deepExtend(f,l)};this.state=function(){var l,m=i.translate.get.matrix(4);if(m===f.maxPosition){l="left"}else{if(m===f.minPosition){l="right"}else{l="closed"}}return{state:l,info:e.simpleStates}};j(k)};if((typeof module!=="undefined")&&module.exports){module.exports=a}if(typeof ender==="undefined"){this.Snap=a}if((typeof define==="function")&&define.amd){define("snap",[],function(){return a})}}).call(this,window,document);
      diff --git a/license.txt b/license.txt
      new file mode 100755
      index 0000000..f4685f8
      --- /dev/null
      +++ b/license.txt
      @@ -0,0 +1,281 @@
      +		    GNU GENERAL PUBLIC LICENSE
      +		       Version 2, June 1991
      +
      + Copyright (C) 1989, 1991 Free Software Foundation, Inc.
      +							51 Franklin St, Fifth Floor, Boston, MA 02110, USA
      +
      + Everyone is permitted to copy and distribute verbatim copies
      + of this license document, but changing it is not allowed.
      +
      +			    Preamble
      +
      +	The licenses for most software are designed to take away your
      +freedom to share and change it.  By contrast, the GNU General Public
      +License is intended to guarantee your freedom to share and change free
      +software--to make sure the software is free for all its users.  This
      +General Public License applies to most of the Free Software
      +Foundation's software and to any other program whose authors commit to
      +using it.  (Some other Free Software Foundation software is covered by
      +the GNU Library General Public License instead.)  You can apply it to
      +your programs, too.
      +
      +	When we speak of free software, we are referring to freedom, not
      +price.  Our General Public Licenses are designed to make sure that you
      +have the freedom to distribute copies of free software (and charge for
      +this service if you wish), that you receive source code or can get it
      +if you want it, that you can change the software or use pieces of it
      +in new free programs; and that you know you can do these things.
      +
      +	To protect your rights, we need to make restrictions that forbid
      +anyone to deny you these rights or to ask you to surrender the rights.
      +These restrictions translate to certain responsibilities for you if you
      +distribute copies of the software, or if you modify it.
      +
      +	For example, if you distribute copies of such a program, whether
      +gratis or for a fee, you must give the recipients all the rights that
      +you have.  You must make sure that they, too, receive or can get the
      +source code.  And you must show them these terms so they know their
      +rights.
      +
      +	We protect your rights with two steps: (1) copyright the software, and
      +(2) offer you this license which gives you legal permission to copy,
      +distribute and/or modify the software.
      +
      +	Also, for each author's protection and ours, we want to make certain
      +that everyone understands that there is no warranty for this free
      +software.  If the software is modified by someone else and passed on, we
      +want its recipients to know that what they have is not the original, so
      +that any problems introduced by others will not reflect on the original
      +authors' reputations.
      +
      +	Finally, any free program is threatened constantly by software
      +patents.  We wish to avoid the danger that redistributors of a free
      +program will individually obtain patent licenses, in effect making the
      +program proprietary.  To prevent this, we have made it clear that any
      +patent must be licensed for everyone's free use or not licensed at all.
      +
      +	The precise terms and conditions for copying, distribution and
      +modification follow.
      +
      +		    GNU GENERAL PUBLIC LICENSE
      +	 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
      +
      +	0. This License applies to any program or other work which contains
      +a notice placed by the copyright holder saying it may be distributed
      +under the terms of this General Public License.  The "Program", below,
      +refers to any such program or work, and a "work based on the Program"
      +means either the Program or any derivative work under copyright law:
      +that is to say, a work containing the Program or a portion of it,
      +either verbatim or with modifications and/or translated into another
      +language.  (Hereinafter, translation is included without limitation in
      +the term "modification".)  Each licensee is addressed as "you".
      +
      +Activities other than copying, distribution and modification are not
      +covered by this License; they are outside its scope.  The act of
      +running the Program is not restricted, and the output from the Program
      +is covered only if its contents constitute a work based on the
      +Program (independent of having been made by running the Program).
      +Whether that is true depends on what the Program does.
      +
      +	1. You may copy and distribute verbatim copies of the Program's
      +source code as you receive it, in any medium, provided that you
      +conspicuously and appropriately publish on each copy an appropriate
      +copyright notice and disclaimer of warranty; keep intact all the
      +notices that refer to this License and to the absence of any warranty;
      +and give any other recipients of the Program a copy of this License
      +along with the Program.
      +
      +You may charge a fee for the physical act of transferring a copy, and
      +you may at your option offer warranty protection in exchange for a fee.
      +
      +	2. You may modify your copy or copies of the Program or any portion
      +of it, thus forming a work based on the Program, and copy and
      +distribute such modifications or work under the terms of Section 1
      +above, provided that you also meet all of these conditions:
      +
      +		a) You must cause the modified files to carry prominent notices
      +		stating that you changed the files and the date of any change.
      +
      +		b) You must cause any work that you distribute or publish, that in
      +		whole or in part contains or is derived from the Program or any
      +		part thereof, to be licensed as a whole at no charge to all third
      +		parties under the terms of this License.
      +
      +		c) If the modified program normally reads commands interactively
      +		when run, you must cause it, when started running for such
      +		interactive use in the most ordinary way, to print or display an
      +		announcement including an appropriate copyright notice and a
      +		notice that there is no warranty (or else, saying that you provide
      +		a warranty) and that users may redistribute the program under
      +		these conditions, and telling the user how to view a copy of this
      +		License.  (Exception: if the Program itself is interactive but
      +		does not normally print such an announcement, your work based on
      +		the Program is not required to print an announcement.)
      +
      +These requirements apply to the modified work as a whole.  If
      +identifiable sections of that work are not derived from the Program,
      +and can be reasonably considered independent and separate works in
      +themselves, then this License, and its terms, do not apply to those
      +sections when you distribute them as separate works.  But when you
      +distribute the same sections as part of a whole which is a work based
      +on the Program, the distribution of the whole must be on the terms of
      +this License, whose permissions for other licensees extend to the
      +entire whole, and thus to each and every part regardless of who wrote it.
      +Thus, it is not the intent of this section to claim rights or contest
      +your rights to work written entirely by you; rather, the intent is to
      +exercise the right to control the distribution of derivative or
      +collective works based on the Program.
      +
      +In addition, mere aggregation of another work not based on the Program
      +with the Program (or with a work based on the Program) on a volume of
      +a storage or distribution medium does not bring the other work under
      +the scope of this License.
      +
      +	3. You may copy and distribute the Program (or a work based on it,
      +under Section 2) in object code or executable form under the terms of
      +Sections 1 and 2 above provided that you also do one of the following:
      +
      +		a) Accompany it with the complete corresponding machine-readable
      +		source code, which must be distributed under the terms of Sections
      +		1 and 2 above on a medium customarily used for software interchange; or,
      +
      +		b) Accompany it with a written offer, valid for at least three
      +		years, to give any third party, for a charge no more than your
      +		cost of physically performing source distribution, a complete
      +		machine-readable copy of the corresponding source code, to be
      +		distributed under the terms of Sections 1 and 2 above on a medium
      +		customarily used for software interchange; or,
      +
      +		c) Accompany it with the information you received as to the offer
      +		to distribute corresponding source code.  (This alternative is
      +		allowed only for noncommercial distribution and only if you
      +		received the program in object code or executable form with such
      +		an offer, in accord with Subsection b above.)
      +
      +The source code for a work means the preferred form of the work for
      +making modifications to it.  For an executable work, complete source
      +code means all the source code for all modules it contains, plus any
      +associated interface definition files, plus the scripts used to
      +control compilation and installation of the executable.  However, as a
      +special exception, the source code distributed need not include
      +anything that is normally distributed (in either source or binary
      +form) with the major components (compiler, kernel, and so on) of the
      +operating system on which the executable runs, unless that component
      +itself accompanies the executable.
      +
      +If distribution of executable or object code is made by offering
      +access to copy from a designated place, then offering equivalent
      +access to copy the source code from the same place counts as
      +distribution of the source code, even though third parties are not
      +compelled to copy the source along with the object code.
      +
      +	4. You may not copy, modify, sublicense, or distribute the Program
      +except as expressly provided under this License.  Any attempt
      +otherwise to copy, modify, sublicense or distribute the Program is
      +void, and will automatically terminate your rights under this License.
      +However, parties who have received copies, or rights, from you under
      +this License will not have their licenses terminated so long as such
      +parties remain in full compliance.
      +
      +	5. You are not required to accept this License, since you have not
      +signed it.  However, nothing else grants you permission to modify or
      +distribute the Program or its derivative works.  These actions are
      +prohibited by law if you do not accept this License.  Therefore, by
      +modifying or distributing the Program (or any work based on the
      +Program), you indicate your acceptance of this License to do so, and
      +all its terms and conditions for copying, distributing or modifying
      +the Program or works based on it.
      +
      +	6. Each time you redistribute the Program (or any work based on the
      +Program), the recipient automatically receives a license from the
      +original licensor to copy, distribute or modify the Program subject to
      +these terms and conditions.  You may not impose any further
      +restrictions on the recipients' exercise of the rights granted herein.
      +You are not responsible for enforcing compliance by third parties to
      +this License.
      +
      +	7. If, as a consequence of a court judgment or allegation of patent
      +infringement or for any other reason (not limited to patent issues),
      +conditions are imposed on you (whether by court order, agreement or
      +otherwise) that contradict the conditions of this License, they do not
      +excuse you from the conditions of this License.  If you cannot
      +distribute so as to satisfy simultaneously your obligations under this
      +License and any other pertinent obligations, then as a consequence you
      +may not distribute the Program at all.  For example, if a patent
      +license would not permit royalty-free redistribution of the Program by
      +all those who receive copies directly or indirectly through you, then
      +the only way you could satisfy both it and this License would be to
      +refrain entirely from distribution of the Program.
      +
      +If any portion of this section is held invalid or unenforceable under
      +any particular circumstance, the balance of the section is intended to
      +apply and the section as a whole is intended to apply in other
      +circumstances.
      +
      +It is not the purpose of this section to induce you to infringe any
      +patents or other property right claims or to contest validity of any
      +such claims; this section has the sole purpose of protecting the
      +integrity of the free software distribution system, which is
      +implemented by public license practices.  Many people have made
      +generous contributions to the wide range of software distributed
      +through that system in reliance on consistent application of that
      +system; it is up to the author/donor to decide if he or she is willing
      +to distribute software through any other system and a licensee cannot
      +impose that choice.
      +
      +This section is intended to make thoroughly clear what is believed to
      +be a consequence of the rest of this License.
      +
      +	8. If the distribution and/or use of the Program is restricted in
      +certain countries either by patents or by copyrighted interfaces, the
      +original copyright holder who places the Program under this License
      +may add an explicit geographical distribution limitation excluding
      +those countries, so that distribution is permitted only in or among
      +countries not thus excluded.  In such case, this License incorporates
      +the limitation as if written in the body of this License.
      +
      +	9. The Free Software Foundation may publish revised and/or new versions
      +of the General Public License from time to time.  Such new versions will
      +be similar in spirit to the present version, but may differ in detail to
      +address new problems or concerns.
      +
      +Each version is given a distinguishing version number.  If the Program
      +specifies a version number of this License which applies to it and "any
      +later version", you have the option of following the terms and conditions
      +either of that version or of any later version published by the Free
      +Software Foundation.  If the Program does not specify a version number of
      +this License, you may choose any version ever published by the Free Software
      +Foundation.
      +
      +	10. If you wish to incorporate parts of the Program into other free
      +programs whose distribution conditions are different, write to the author
      +to ask for permission.  For software which is copyrighted by the Free
      +Software Foundation, write to the Free Software Foundation; we sometimes
      +make exceptions for this.  Our decision will be guided by the two goals
      +of preserving the free status of all derivatives of our free software and
      +of promoting the sharing and reuse of software generally.
      +
      +			    NO WARRANTY
      +
      +	11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
      +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
      +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
      +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
      +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
      +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
      +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
      +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
      +REPAIR OR CORRECTION.
      +
      +	12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
      +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
      +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
      +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
      +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
      +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
      +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
      +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
      +POSSIBILITY OF SUCH DAMAGES.
      +
      +		     END OF TERMS AND CONDITIONS
      +
      diff --git a/no-results.php b/no-results.php
      new file mode 100755
      index 0000000..808697c
      --- /dev/null
      +++ b/no-results.php
      @@ -0,0 +1,37 @@
      +<?php
      +/**
      + * The template part for displaying a message that posts cannot be found.
      + *
      + * Learn more: http://codex.wordpress.org/Template_Hierarchy
      + *
      + * @package Symbol
      + * @since Symbol 1.0
      + */
      +?>
      +
      +<article id="post-0" class="post no-results not-found">
      +	<div class=" center-content">
      +			<header class="entry-header">
      +		<h1 class="entry-title"><?php _e( 'Nothing Found', 'symbol' ); ?></h1>
      +	</header><!-- .entry-header -->
      +
      +	<div class="entry-content">
      +		<?php if ( is_home() ) : ?>
      +
      +			<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'symbol' ), admin_url( 'post-new.php' ) ); ?></p>
      +
      +		<?php elseif ( is_search() ) : ?>
      +
      +			<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'symbol' ); ?></p>
      +			<?php get_search_form(); ?>
      +
      +		<?php else : ?>
      +
      +			<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'symbol' ); ?></p>
      +			<?php get_search_form(); ?>
      +
      +		<?php endif; ?>
      +	</div><!-- .entry-content -->
      +	</div>
      +
      +</article><!-- #post-0 .post .no-results .not-found -->
      diff --git a/page-instagram.php b/page-instagram.php
      new file mode 100755
      index 0000000..d004633
      --- /dev/null
      +++ b/page-instagram.php
      @@ -0,0 +1,51 @@
      +<?php
      +/**
      + * Template Name: Instagram
      + */
      +
      +get_header(); ?>
      +
      +<div id="primary" class="content-area">
      +	<div id="content" class="site-content" role="main">
      +
      +		<?php while ( have_posts() ) : the_post(); ?>
      +
      +			<?php get_template_part( 'content', 'page' ); ?>
      +
      +		<?php endwhile; // end of the loop. ?>
      +
      +		<!-- http://instagram.com/developer/authentication/ -->
      +
      +		<div class="instagram-list center-content">
      +			<?php
      +				// Supply a user id and an access token
      +				$userid = get_option('instagram_user_id');
      +				$accessToken = get_option('instagram_access_token');
      +
      +				// Gets our data
      +				function fetchData($url){
      +				     $ch = curl_init();
      +				     curl_setopt($ch, CURLOPT_URL, $url);
      +				     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      +				     curl_setopt($ch, CURLOPT_TIMEOUT, 20);
      +				     $result = curl_exec($ch);
      +				     curl_close($ch); 
      +				     return $result;
      +				}
      +
      +				// Pulls and parses data.
      +				$result = fetchData("https://api.instagram.com/v1/users/".$userid."/media/recent/?access_token=" . $accessToken);
      +				$result = json_decode($result);
      +			?>
      +
      +
      +			<?php foreach ($result->data as $post): ?>
      +				<!-- Renders images. @Options (thumbnail,low_resoulution, high_resolution) -->
      +				<a class="insta-pic" target="_blank"  href="<?php echo $post->link ?>"><img src="<?php echo $post->images->low_resolution->url ?>" /></a>
      +			<?php endforeach ?>
      +		</div>
      +
      +	</div><!-- #content .site-content -->
      +</div><!-- #primary .content-area -->
      +
      +<?php get_footer(); ?>
      \ No newline at end of file
      diff --git a/page-lastfm.php b/page-lastfm.php
      new file mode 100755
      index 0000000..774c1b5
      --- /dev/null
      +++ b/page-lastfm.php
      @@ -0,0 +1,55 @@
      +<?php
      +/**
      + * Template Name: Last.fm
      + */
      +
      +get_header(); ?>
      +
      +<div>
      +
      +<?php while ( have_posts() ) : the_post(); ?>
      +
      +	<?php get_template_part( 'content', 'page' ); ?>
      +
      +<?php endwhile; // end of the loop. ?>
      +<?php 
      +$username = $options['lastfm_username'];
      +$scrobbler_url = "http://ws.audioscrobbler.com/2.0/user/" . $username . "/recenttracks";
      + 
      +if ($scrobbler_xml = file_get_contents($scrobbler_url)):
      +    $scrobbler_data = simplexml_load_string($scrobbler_xml); 
      +?>
      +
      +<div class="center-content">
      +    <ul class="last-fm-tracks ">
      +    	<?php foreach ($scrobbler_data->track as $track): ?>
      +        	<li>
      +        		<span class="track-date">
      +        			<?php if ($track->date): ?>
      +    	    			Played on <?php echo $track->date ?>
      +    	    		<?php else: ?>
      +    	    			<i>Playing now...</i>
      +        			<?php endif ?>
      +        		</span>
      +        		<span class="track-album">
      +        			<?php if (!empty($track->image[2])): ?>
      +        				<img class="cover" src="<?php echo $track->image[2] ?>" />
      +        			<?php else: ?>
      +        				<i class="cover">No Image</i>
      +        			<?php endif ?>
      +        		</span>
      +        		<div class="track">
      +        			<span class="track-name"><?php echo $track->name ?></span>
      +        			<span class="space">–</span>
      +    	    		<span class="track-artist"><?php echo $track->artist ?></span>
      +        		</div>
      +
      +        	</li>
      +    	<?php endforeach ?>    
      +    </ul>
      +
      +</div>
      +        
      +<?php endif; ?>
      +</div>
      +<?php get_footer() ?>
      \ No newline at end of file
      diff --git a/page.php b/page.php
      new file mode 100755
      index 0000000..23b7aa1
      --- /dev/null
      +++ b/page.php
      @@ -0,0 +1,28 @@
      +<?php
      +/**
      + * The template for displaying all pages.
      + *
      + * This is the template that displays all pages by default.
      + * Please note that this is the WordPress construct of pages
      + * and that other 'pages' on your WordPress site will use a
      + * different template.
      + *
      + * @package Symbol
      + * @since Symbol 1.0
      + */
      +
      +get_header(); ?>
      +
      +<div id="primary" class="content-area">
      +	<div id="content" class="site-content" role="main">
      +
      +		<?php while ( have_posts() ) : the_post(); ?>
      +
      +			<?php get_template_part( 'content', 'page' ); ?>
      +
      +		<?php endwhile; // end of the loop. ?>
      +
      +	</div><!-- #content .site-content -->
      +</div><!-- #primary .content-area -->
      +
      +<?php get_footer(); ?>
      \ No newline at end of file
      diff --git a/rtl.css b/rtl.css
      new file mode 100755
      index 0000000..92b0bd1
      --- /dev/null
      +++ b/rtl.css
      @@ -0,0 +1,17 @@
      +/*
      +Theme Name: Symbol
      +
      +Adding support for language written in a Right To Left (RTL) direction is easy -
      +it's just a matter of overwriting all the horizontal positioning attributes
      +of your CSS stylesheet in a separate stylesheet file named rtl.css.
      +
      +http://codex.wordpress.org/Right_to_Left_Language_Support
      +
      +*/
      +
      +/*
      +body {
      +	direction: rtl;
      +	unicode-bidi: embed;
      +}
      +*/
      \ No newline at end of file
      diff --git a/screenshot.png b/screenshot.png
      new file mode 100755
      index 0000000..09a396f
      Binary files /dev/null and b/screenshot.png differ
      diff --git a/search.php b/search.php
      new file mode 100755
      index 0000000..81ea33b
      --- /dev/null
      +++ b/search.php
      @@ -0,0 +1,41 @@
      +<?php
      +/**
      + * The template for displaying Search Results pages.
      + *
      + * @package Symbol
      + * @since Symbol 1.0
      + */
      +
      +get_header(); ?>
      +
      +		<section id="primary" class="content-area">
      +			<div id="content" class="site-content" role="main">
      +
      +			<?php if ( have_posts() ) : ?>
      +
      +				<header class="page-header">
      +					<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'symbol' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
      +				</header><!-- .page-header -->
      +
      +				<?php symbol_content_nav( 'nav-above' ); ?>
      +
      +				<?php /* Start the Loop */ ?>
      +				<?php while ( have_posts() ) : the_post(); ?>
      +
      +					<?php get_template_part( 'content', 'search' ); ?>
      +
      +				<?php endwhile; ?>
      +
      +				<?php symbol_content_nav( 'nav-below' ); ?>
      +
      +			<?php else : ?>
      +
      +				<?php get_template_part( 'no-results', 'search' ); ?>
      +
      +			<?php endif; ?>
      +
      +			</div><!-- #content .site-content -->
      +		</section><!-- #primary .content-area -->
      +
      +<?php get_sidebar(); ?>
      +<?php get_footer(); ?>
      \ No newline at end of file
      diff --git a/searchform.php b/searchform.php
      new file mode 100755
      index 0000000..6e6fe06
      --- /dev/null
      +++ b/searchform.php
      @@ -0,0 +1,13 @@
      +<?php
      +/**
      + * The template for displaying search forms in Symbol
      + *
      + * @package Symbol
      + * @since Symbol 1.0
      + */
      +?>
      +	<form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
      +		<label for="s" class="assistive-text"><?php _e( 'Search', 'symbol' ); ?></label>
      +		<input type="text" class="field" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" id="s" placeholder="<?php esc_attr_e( 'Search &hellip;', 'symbol' ); ?>" />
      +		<input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'symbol' ); ?>" />
      +	</form>
      diff --git a/sidebar.php b/sidebar.php
      new file mode 100755
      index 0000000..6929679
      --- /dev/null
      +++ b/sidebar.php
      @@ -0,0 +1,38 @@
      +<?php
      +/**
      + * The Sidebar containing the main widget areas.
      + *
      + * @package Symbol
      + */
      +?>
      +
      +<div class="snap-drawers" role="complementary">
      +	<div class="snap-drawer snap-drawer-left">
      +		<div id="secondary" class="widget-area" >
      +			<?php do_action( 'before_sidebar' ); ?>
      +			<?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
      +
      +				<aside id="search" class="widget widget_search">
      +					<?php get_search_form(); ?>
      +				</aside>
      +
      +				<aside id="archives" class="widget">
      +					<h1 class="widget-title"><?php _e( 'Archives', 'solar' ); ?></h1>
      +					<ul>
      +						<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
      +					</ul>
      +				</aside>
      +
      +				<aside id="meta" class="widget">
      +					<h1 class="widget-title"><?php _e( 'Meta', 'solar' ); ?></h1>
      +					<ul>
      +						<?php wp_register(); ?>
      +						<li><?php wp_loginout(); ?></li>
      +						<?php wp_meta(); ?>
      +					</ul>
      +				</aside>
      +
      +			<?php endif; // end sidebar widget area ?>
      +		</div><!-- #secondary -->
      +	</div>
      +</div>
      \ No newline at end of file
      diff --git a/single.php b/single.php
      new file mode 100755
      index 0000000..f12d03f
      --- /dev/null
      +++ b/single.php
      @@ -0,0 +1,30 @@
      +<?php
      +/**
      + * The Template for displaying all single posts.
      + *
      + * @package Symbol
      + * @since Symbol 1.0
      + */
      +
      +get_header(); ?>
      +
      +<?php while ( have_posts() ) : the_post(); ?>
      +
      +	<header id="begin">
      +	    <time datetime="<?php echo date('Y-m-d'); ?>" class="center-content" id="top_time"><?php the_time('F d, Y'); ?></time>
      +	</header>
      +	
      +	<?php get_template_part( 'content', 'single' ); ?>
      +
      +
      +	<?php
      +		// If comments are open or we have at least one comment, load up the comment template
      +		if ( comments_open() || '0' != get_comments_number() )
      +			comments_template( '', true );
      +	?>
      +
      +	<?php symbol_content_nav( 'nav-below' ); ?>
      +
      +<?php endwhile; // end of the loop. ?>
      +
      +<?php get_footer(); ?>
      \ No newline at end of file
      diff --git a/style.css b/style.css
      new file mode 100755
      index 0000000..121f73d
      --- /dev/null
      +++ b/style.css
      @@ -0,0 +1,637 @@
      +/*
      +Theme Name: Symbol
      +Theme URI: http://symbol.themeskult.com/
      +Github Theme URI: https://github.com/themeskult/symbol-theme
      +Author: Themes Kult
      +Author URI: http://themeskult.com/
      +Version: 1.4
      +Description: Symbol is a tight, visually clean and well-structured theme that allows you to focus on reading.
      +*/
      +/* Snap.js
      +----------------------------------------------- */
      +.snap-content {
      +  position: absolute;
      +  background: #fff;
      +  top: 0;
      +  right: 0;
      +  bottom: 0;
      +  left: 0;
      +  width: auto;
      +  height: auto;
      +  z-index: 2;
      +  overflow: auto;
      +  -webkit-overflow-scrolling: touch;
      +  -webkit-transform: translate3d(0, 0, 0);
      +  -moz-transform: translate3d(0, 0, 0);
      +  -ms-transform: translate3d(0, 0, 0);
      +  -o-transform: translate3d(0, 0, 0);
      +  transform: translate3d(0, 0, 0);
      +}
      +.snap-drawers {
      +  position: absolute;
      +  top: 0;
      +  right: 0;
      +  bottom: 0;
      +  left: 0;
      +  width: auto;
      +  height: auto;
      +}
      +.snap-drawer {
      +  position: absolute;
      +  top: 0;
      +  right: auto;
      +  bottom: 0;
      +  left: auto;
      +  width: 265px;
      +  height: auto;
      +  overflow: auto;
      +  -webkit-overflow-scrolling: touch;
      +  -webkit-transition: width 0.3s ease;
      +  -moz-transition: width 0.3s ease;
      +  -ms-transition: width 0.3s ease;
      +  -o-transition: width 0.3s ease;
      +  transition: width 0.3s ease;
      +}
      +.snap-drawer-left {
      +  left: 0;
      +  z-index: 1;
      +}
      +.snap-drawer-right {
      +  right: 0;
      +  z-index: 1;
      +}
      +.snapjs-left .snap-drawer-right,
      +.snapjs-right .snap-drawer-left {
      +  display: none;
      +}
      +.snapjs-expand-left .snap-drawer-left,
      +.snapjs-expand-right .snap-drawer-right {
      +  width: 100%;
      +}
      +/* =jQuery Pageslide
      +-------------------------------------------------------------- */
      +#myToggleButton {
      +  background: #333 url("images/open.png") center center no-repeat;
      +  display: block;
      +  width: 44px;
      +  height: 44px;
      +  top: 20px;
      +  left: 20px;
      +  position: fixed;
      +  right: 20px;
      +  text-indent: -10000em;
      +  z-index: 10000;
      +}
      +/* =General
      +-------------------------------------------------------------- */
      +html {
      +  -webkit-font-smoothing: antialiased;
      +}
      +body {
      +  font-family: "Helvetica Neue", "Arial";
      +  overflow-x: hidden;
      +  margin: 0;
      +  color: #4d4d4d;
      +}
      +h1,
      +h2,
      +h3,
      +h4,
      +h5 {
      +  font-weight: bold;
      +  color: #000;
      +}
      +h1 a,
      +h2 a,
      +h3 a,
      +h4 a,
      +h5 a {
      +  color: #000;
      +  text-decoration: none;
      +}
      +a {
      +  text-decoration: none;
      +  color: #000;
      +  outline: none !important;
      +}
      +a:hover {
      +  color: #333;
      +}
      +blockquote {
      +  border-left: 8px solid #feb83e;
      +  padding-left: 20px;
      +  margin-left: 0;
      +}
      +img {
      +  max-width: 100%;
      +}
      +/* =Header
      +-------------------------------------------------------------- */
      +header.site-header {
      +  background: #fff;
      +  position: fixed;
      +  top: 0;
      +  z-index: 10000;
      +  right: 12%;
      +  width: 150px;
      +}
      +header.site-header h1 {
      +  margin: 0;
      +  padding: 0;
      +}
      +header.site-header h1 a {
      +  background: #feb83e url("images/logo.png") center no-repeat;
      +  border: 1px solid rgba(0,0,0,0.1);
      +  border-top: 0;
      +  background-size: 70%;
      +  height: 150px;
      +  text-indent: -10000em;
      +  display: block;
      +}
      +header.site-header nav {
      +  display: block;
      +  width: 100%;
      +  color: #000;
      +  font-family: Menlo, Monaco, 'Lucida Console', monospace;
      +}
      +header.site-header nav ul {
      +  margin: 0;
      +  padding: 0;
      +}
      +header.site-header nav a {
      +  border: 1px solid #ccc;
      +  overflow: hidden;
      +  border-top: 0;
      +  background: #f9f9f9;
      +  display: block;
      +  padding: 10px 10px;
      +  line-height: 18px;
      +  font-size: 11px;
      +  color: #333;
      +}
      +header.site-header nav a i,
      +header.site-header nav a img {
      +  background: url("images/icon-page.png") center no-repeat;
      +  display: inline-block;
      +  opacity: 0.4;
      +  float: left;
      +  width: 18px;
      +  height: 18px;
      +  margin: auto;
      +}
      +header.site-header nav a img {
      +  display: block;
      +}
      +header.site-header nav a.current_page_item {
      +  background: #fff;
      +}
      +header.site-header nav a:hover {
      +  background: #eee;
      +}
      +header.site-header nav a:hover span {
      +  color: #000;
      +}
      +header.site-header nav a:hover i,
      +header.site-header nav a:hover img {
      +  opacity: 1;
      +}
      +body.admin-bar header.site-header,
      +body {
      +  border-top: 1px solid #fff;
      +}
      +#begin,
      +.site-navigation.post-navigation {
      +  border-bottom: 1px solid #ebebeb;
      +  padding: 32px 0;
      +}
      +#begin a,
      +.site-navigation.post-navigation a {
      +  color: #999;
      +}
      +#begin time,
      +.site-navigation.post-navigation time {
      +  color: #999;
      +  font-weight: bold;
      +}
      +.site-main {
      +  position: relative;
      +}
      +/* =Article
      +-------------------------------------------------------------- */
      +.site-navigation.post-navigation div div {
      +  width: 50%;
      +  float: left;
      +}
      +.site-navigation.post-navigation div div.nav-next {
      +  text-align: right;
      +  float: right;
      +}
      +.center-content {
      +  max-width: 580px;
      +  margin: 0 100px 0 140px;
      +  display: block;
      +}
      +article.post,
      +article.page {
      +  padding: 50px 0;
      +  font-size: 18px;
      +  line-height: 30px;
      +/* Images */
      +}
      +article.post h1,
      +article.page h1 {
      +  font-size: 40px;
      +  line-height: 50px;
      +}
      +article.post p a,
      +article.page p a {
      +  color: #000;
      +  text-decoration: underline;
      +}
      +article.post p < code,
      +article.page p < code {
      +  width: 100%;
      +  display: none;
      +}
      +article.post code,
      +article.page code,
      +article.post pre,
      +article.page pre {
      +  border: none;
      +  border: 1px solid #d2d2d2;
      +  background-color: #f8f8f8;
      +  padding: 0 4px;
      +  font-size: 13px;
      +  width: auto;
      +  display: inline-block;
      +}
      +article.post code,
      +article.page code {
      +  border-radius: 4px;
      +}
      +article.post pre,
      +article.page pre {
      +  padding: 20px 30px;
      +  display: block;
      +  border-left: none;
      +  border-right: none;
      +}
      +article.page {
      +  border-bottom: 0;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks {
      +  margin: 0;
      +  padding: 0;
      +  list-style: none;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li {
      +  overflow: hidden;
      +  margin-bottom: 30px;
      +  border-bottom: 1px solid #eee;
      +  padding-bottom: 30px;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li .track {
      +  float: left;
      +  width: 60%;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li span.track-album {
      +  width: 50px;
      +  display: inline-block;
      +  float: left;
      +  margin-right: 20px;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li span.track-album img {
      +  width: 100%;
      +  background: #eee;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li span.track-album i.cover {
      +  padding: 40px 0;
      +  background: #eee;
      +  color: #999;
      +  display: block;
      +  text-align: center;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li span.track-name {
      +  font-size: 18px;
      +  margin-bottom: 4px;
      +  display: block;
      +  font-weight: bold;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li span.track-artist {
      +  font-size: 14px;
      +  color: #999;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li span.space {
      +  display: none;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li span.track-date {
      +  float: right;
      +  color: #999;
      +  font-size: 11px;
      +}
      +body.page-template-page-lastfm-php .last-fm-tracks li span.track-date i {
      +  font-weight: bold;
      +  color: #008000;
      +  font-size: 14px;
      +}
      +/* =Pagination
      +-------------------------------------------------------------- */
      +nav.paging-navigation,
      +#nav-below {
      +  overflow: hidden;
      +  display: block;
      +  padding: 30px 0;
      +}
      +nav.paging-navigation a,
      +#nav-below a {
      +  display: inline-block;
      +  border: 1px solid #ebebeb;
      +  padding: 20px 20px;
      +  font-weight: bold;
      +  text-transform: uppercase;
      +  font-size: 12px;
      +}
      +nav.paging-navigation a:hover,
      +#nav-below a:hover {
      +  border-color: #333;
      +}
      +nav.paging-navigation .nav-continue,
      +#nav-below .nav-continue {
      +  float: right;
      +}
      +nav.paging-navigation .nav-left,
      +#nav-below .nav-left {
      +  float: left;
      +}
      +/* =Sidebar
      +-------------------------------------------------------------- */
      +.widget-area {
      +  padding: 20px;
      +  padding-right: 30px;
      +  padding-top: 20px;
      +  color: #ccc;
      +  font-size: 12px;
      +  background: #222;
      +}
      +.widget-area h1.widget-title {
      +  color: #fff;
      +  font-size: 18px;
      +  margin-bottom: 10px;
      +}
      +.widget-area a {
      +  color: #a5afb3;
      +  font-weight: bold;
      +}
      +.widget-area a:hover {
      +  color: #fff;
      +}
      +.widget-area ul {
      +  padding: 0;
      +  padding-left: 18px;
      +  margin: 0;
      +}
      +.widget-area ul li {
      +  list-style: square;
      +  margin-bottom: 10px;
      +}
      +.widget-area .widget_search label {
      +  font-weight: bold;
      +  margin-bottom: 10px;
      +  display: none;
      +}
      +.widget-area .widget_search .submit {
      +  display: none;
      +}
      +.widget-area .widget_search #s {
      +  border: 0;
      +  width: 92%;
      +  padding: 4%;
      +  background-color: #666;
      +  color: #1a1d22;
      +  font-size: 14px;
      +}
      +.widget-area .widget_search #s:focus {
      +  outline: none;
      +  color: White;
      +  box-shadow: none;
      +}
      +/* =Comments
      +-------------------------------------------------------------- */
      +#disqus_thread {
      +  margin-top: 50px;
      +}
      +.comments-area {
      +  padding-top: 40px;
      +}
      +.comments-area h2 {
      +  margin-top: 0;
      +}
      +.comments-area ol.commentlist {
      +  list-style: none;
      +  margin: 0;
      +  padding: 0;
      +  max-width: 500px;
      +}
      +.comments-area ol.commentlist li.comment {
      +  border-bottom: 1px solid #e7e7e7;
      +  line-height: 24px;
      +  margin: 0 0 24px 0;
      +  padding: 0 0 24px 60px;
      +  position: relative;
      +}
      +.comments-area ol.commentlist li:last-child {
      +  border-bottom: none;
      +  margin-bottom: 0;
      +}
      +.comments-area ol.commentlist .avatar {
      +  position: absolute;
      +  border-radius: 100px;
      +  top: 4px;
      +  left: 0;
      +}
      +.comments-area ol.commentlist .comment-author {
      +  font-weight: bold;
      +  font-size: 13px;
      +}
      +.comments-area ol.commentlist .comment-author cite {
      +  color: #000;
      +  font-style: normal;
      +  font-weight: bold;
      +}
      +.comments-area ol.commentlist .comment-author .says {
      +  font-style: italic;
      +}
      +.comments-area ol.commentlist .comment-meta {
      +  font-size: 12px;
      +  margin: 0 0 18px 0;
      +}
      +.comments-area ol.commentlist .comment-meta a:link,
      +.comments-area ol.commentlist .comment-meta a:visited {
      +  color: #888;
      +  text-decoration: none;
      +}
      +.comments-area ol.commentlist .comment-meta a:active,
      +.comments-area ol.commentlist .comment-meta a:hover {
      +  color: #ff4b33;
      +}
      +.comments-area .reply {
      +  font-size: 12px;
      +  padding: 0 0 24px 0;
      +}
      +.comments-area .reply a,
      +.comments-area a.comment-edit-link {
      +  color: #888;
      +}
      +.comments-area .reply a:hover,
      +.comments-area a.comment-edit-link:hover {
      +  color: #ff4b33;
      +}
      +.comments-area .commentlist .children {
      +  list-style: none;
      +  margin: 0;
      +}
      +.comments-area .commentlist .children li {
      +  border: none;
      +  margin: 0;
      +}
      +.comments-area .nopassword,
      +.comments-area .nocomments {
      +  display: none;
      +}
      +.comments-area #comments .pingback {
      +  border-bottom: 1px solid #e7e7e7;
      +  margin-bottom: 18px;
      +  padding-bottom: 18px;
      +}
      +.comments-area .commentlist li.comment+li.pingback {
      +  margin-top: -6px;
      +}
      +.comments-area #comments .pingback p {
      +  color: #888;
      +  display: block;
      +  font-size: 12px;
      +  line-height: 18px;
      +  margin: 0;
      +}
      +.comments-area #comments .pingback .url {
      +  font-size: 13px;
      +  font-style: italic;
      +}
      +.comments-area input[type=submit] {
      +  color: #333;
      +}
      +.comments-area #respond {
      +  position: relative;
      +}
      +.comments-area #respond p {
      +  margin: 0;
      +}
      +.comments-area #respond .comment-notes {
      +  margin-bottom: 1em;
      +}
      +.comments-area .form-allowed-tags {
      +  line-height: 1em;
      +}
      +.comments-area .children #respond {
      +  margin: 0 48px 0 0;
      +}
      +.comments-area h3#reply-title {
      +  margin: 18px 0;
      +}
      +.comments-area #comments-list #respond {
      +  margin: 0 0 18px 0;
      +}
      +.comments-area #comments-list ul #respond {
      +  margin: 0;
      +}
      +.comments-area #cancel-comment-reply-link {
      +  font-size: 12px;
      +  font-weight: normal;
      +  line-height: 18px;
      +}
      +.comments-area article a.comment-reply-link {
      +  font-size: 13px;
      +  text-decoration: none;
      +  font-weight: bold;
      +}
      +.comments-area #respond .required {
      +  color: #ff4b33;
      +  font-weight: bold;
      +}
      +.comments-area #respond .comment-form-author label,
      +.comments-area #respond .comment-form-email label,
      +.comments-area #respond .comment-form-url label,
      +.comments-area #respond .comment-form-comment label {
      +  color: #888;
      +  font-size: 12px;
      +  width: 70px;
      +  display: inline-block;
      +}
      +.comments-area #respond .comment-form-comment label {
      +  padding: 0;
      +  text-align: left;
      +}
      +.comments-area #respond input[type="text"] {
      +  margin-bottom: 14px;
      +  padding: 4px;
      +  margin-right: 10px;
      +  border: 0;
      +  border-bottom: 1px solid #ccc;
      +}
      +.comments-area #respond input[type="text"]:focus {
      +  outline: 0;
      +  border-color: #333;
      +}
      +.comments-area .comment-form-comment label {
      +  display: block;
      +}
      +.comments-area #respond textarea {
      +  border-color: #ccc;
      +}
      +.comments-area #respond textarea:focus {
      +  outline: 0;
      +}
      +.comments-area .logged-in-as {
      +  font-size: 11px;
      +}
      +.comments-area ol.commentlist li.comment.byuser {
      +  margin-top: 30px;
      +}
      +.comments-area ol.commentlist li.comment.byuser #respond .form-submit {
      +  margin-left: 0;
      +}
      +.comments-area #respond #submit {
      +  margin: 0 0 9px;
      +  background: #000;
      +  border-radius: 5px;
      +  padding: 10px 20px;
      +  font-weight: bold;
      +  width: auto;
      +  border: 0;
      +  color: #fff;
      +  margin-bottom: 50px;
      +}
      +.comments-area #respond textarea {
      +  width: 96%;
      +  margin-bottom: 10px;
      +  padding: 2%;
      +}
      +.comments-area #respond .form-allowed-tags {
      +  color: #888;
      +  font-size: 12px;
      +  line-height: 18px;
      +}
      +.comments-area #respond .form-allowed-tags code {
      +  font-size: 11px;
      +}
      +.comments-area #respond .form-submit {
      +  margin: 12px 0 0 0;
      +}
      +.comments-area #respond .form-submit input {
      +  font-size: 14px;
      +  width: auto;
      +}
      +.comments-area .form-allowed-tags,
      +.comments-area .comment-notes {
      +  display: none;
      +}
      diff --git a/style.styl b/style.styl
      new file mode 100755
      index 0000000..605f6bf
      --- /dev/null
      +++ b/style.styl
      @@ -0,0 +1,371 @@
      +/*
      +Theme Name: Symbol
      +Theme URI: http://symbol.themeskult.com/
      +Github Theme URI: https://github.com/themeskult/symbol-theme
      +Author: Themes Kult
      +Author URI: http://themeskult.com/
      +Version: 1.4
      +Description: Symbol is a tight, visually clean and well-structured theme that allows you to focus on reading.
      +*/
      +
      +
      +/* Snap.js
      +----------------------------------------------- */
      +.snap-content {
      +  position: absolute;
      +  background: #fff;
      +  top: 0;
      +  right: 0;
      +  bottom: 0;
      +  left: 0;
      +  width: auto;
      +  height: auto;
      +  z-index: 2;
      +  overflow: auto;
      +  -webkit-overflow-scrolling: touch;
      +  -webkit-transform: translate3d(0, 0, 0);
      +     -moz-transform: translate3d(0, 0, 0);
      +      -ms-transform: translate3d(0, 0, 0);
      +       -o-transform: translate3d(0, 0, 0);
      +          transform: translate3d(0, 0, 0);
      +}
      +
      +.snap-drawers {
      +  position: absolute;
      +  top: 0;
      +  right: 0;
      +  bottom: 0;
      +  left: 0;
      +  width: auto;
      +  height: auto;
      +}
      +
      +.snap-drawer {
      +  position: absolute;
      +  top: 0;
      +  right: auto;
      +  bottom: 0;
      +  left: auto;
      +  width: 265px;
      +  height: auto;
      +  overflow: auto;
      +  -webkit-overflow-scrolling: touch;
      +  -webkit-transition: width 0.3s ease;
      +     -moz-transition: width 0.3s ease;
      +      -ms-transition: width 0.3s ease;
      +       -o-transition: width 0.3s ease;
      +          transition: width 0.3s ease;
      +}
      +
      +.snap-drawer-left {
      +  left: 0;
      +  z-index: 1;
      +}
      +
      +.snap-drawer-right {
      +  right: 0;
      +  z-index: 1;
      +}
      +
      +.snapjs-left .snap-drawer-right,
      +.snapjs-right .snap-drawer-left {
      +  display: none;
      +}
      +
      +.snapjs-expand-left .snap-drawer-left,
      +.snapjs-expand-right .snap-drawer-right {
      +  width: 100%;
      +}
      +
      +/* =jQuery Pageslide
      +-------------------------------------------------------------- */
      +#myToggleButton
      +	background: #333 url(images/open.png) center center no-repeat;
      +	display: block;
      +	width: 44px;
      +	height: 44px;
      +	top: 20px;
      +	left: 20px;
      +	position: fixed;
      +	right: 20px;
      +	text-indent: -10000em;
      +	z-index: 10000;
      +
      +
      +/* =General
      +-------------------------------------------------------------- */
      +html 
      +	-webkit-font-smoothing: antialiased;  
      +body
      +	font-family: "Helvetica Neue", "Arial"; overflow-x: hidden; margin: 0; color: #4d4d4d;
      +
      +h1,h2,h3,h4,h5
      +	font-weight: bold;
      +	color: black;
      +	a 
      +		color: black;
      +		text-decoration: none
      +a
      +	text-decoration: none; color: #000; outline: none !important;
      +	&:hover{color: #333;}
      +
      +blockquote
      +	border-left: 8px solid #feb83e; padding-left: 20px; margin-left: 0;
      +
      +img
      +	max-width: 100%;
      +
      +/* =Header
      +-------------------------------------------------------------- */
      +header.site-header
      +	background: #fff; position: fixed; top: 0; z-index: 10000; right: 12%; width: 150px; 
      +	h1 
      +		margin: 0; padding: 0;
      +		a{background: #feb83e url('images/logo.png') center no-repeat; border: 1px solid rgba(0,0,0,.1); border-top: 0; background-size:  70%; height: 150px; text-indent: -10000em; display: block;}
      +	nav
      +		display: block; 
      +		width: 100%;  
      +		color: black; 
      +		font-family:  Menlo, Monaco, 'Lucida Console', monospace;
      +		ul 
      +			margin: 0;
      +			padding: 0;
      +		a
      +			border: 1px solid #ccc; overflow: hidden; border-top: 0;  background: #f9f9f9;  display: block; padding: 10px 10px; line-height: 18px; font-size: 11px; color: #333;
      +			i, img{background: url('images/icon-page.png') center no-repeat; display: inline-block; opacity: .4; float: left; width: 18px; height: 18px;  margin: auto;}
      +			img{display: block;}
      +
      +			&.current_page_item
      +				background: white; 
      +			&:hover
      +				background: #eee; 
      +				span 
      +					color: black;
      +				i,img{opacity: 1;}
      +
      +body.admin-bar header.site-header, body
      +	border-top: 1px solid white;
      +
      +#begin, .site-navigation.post-navigation
      +	border-bottom: 1px solid #ebebeb; padding: 32px 0;
      +	a{color: #999;}
      +	time{ color: #999; font-weight: bold; }
      +
      +
      +.site-main
      +	position: relative;
      +
      +
      +/* =Article
      +-------------------------------------------------------------- */
      +.site-navigation.post-navigation div div
      +	width: 50%; float: left;
      +	&.nav-next{text-align: right; float: right;}
      +
      +.center-content
      +	max-width: 580px; margin: 0 100px 0 140px; display: block; 
      +
      +article.post, article.page
      +	padding: 50px 0;
      +	font-size: 18px;
      +	line-height: 30px;
      +	h1 
      +		font-size: 40px;
      +		line-height: 50px;
      +	p 
      +		a 
      +			color: black;
      +			text-decoration: underline
      +	p < code {width: 100%; display: none;}
      +	code,pre
      +		border: none;
      +		border: 1px solid #d2d2d2;
      +		background-color: #f8f8f8;
      +		padding: 0 4px;
      +		font-size: 13px;
      +		width: auto;
      +
      +		display: inline-block;
      +
      +	code
      +		border-radius: 4px;
      +	pre
      +		padding: 20px 30px;
      +		display: block;
      +		border-left: none;
      +		border-right: none;
      +
      +	/* Images */
      +
      +
      +article.page 
      +	border-bottom: 0;
      +
      +body.page-template-page-lastfm-php
      +	.last-fm-tracks
      +		margin: 0; padding: 0;
      +		list-style: none;
      +		li
      +			overflow: hidden
      +			margin-bottom: 30px;
      +			border-bottom: 1px solid #eee; padding-bottom: 30px;
      +
      +			.track
      +				float: left;
      +				width: 60%;
      +
      +			span.track-album
      +				width: 50px;
      +				display: inline-block;
      +				float: left;
      +				margin-right: 20px;
      +				img {width: 100%; background: #eee;}
      +				i.cover{padding: 40px 0; background: #eee; color: #999; display: block; text-align: center;}
      +			span.track-name
      +				font-size: 18px;
      +				margin-bottom: 4px;
      +				display: block;
      +				font-weight: bold;
      +			span.track-artist
      +				font-size: 14px; color: #999;
      +			span.space 
      +				display: none;
      +			span.track-date
      +				float: right;
      +				color: #999;
      +				font-size: 11px;
      +
      +				i 
      +					font-weight: bold; color: green; font-size: 14px;
      +
      +/* =Pagination
      +-------------------------------------------------------------- */
      +nav.paging-navigation, #nav-below
      +	overflow: hidden; display: block; padding: 30px 0;
      +	a
      +		display: inline-block; border: 1px solid #ebebeb; padding: 20px 20px; font-weight: bold; text-transform: uppercase; font-size: 12px;
      +		&:hover{border-color: #333;}
      +	.nav-continue{float: right;}
      +	.nav-left{float: left;}
      +
      +
      +/* =Sidebar
      +-------------------------------------------------------------- */
      +.widget-area 
      +	padding: 20px;
      +	padding-right: 30px;
      +	padding-top: 20px;
      +	color: #ccc;
      +	font-size: 12px;
      +	background: #222;
      +	h1.widget-title 
      +		color: white;
      +		font-size: 18px;
      +		margin-bottom: 10px;
      +
      +	a 
      +		color: #a5afb3;
      +		font-weight: bold;
      +		&:hover 
      +			color: white;
      +
      +	ul 
      +		padding: 0;
      +		padding-left: 18px;
      +		margin: 0;
      +		li 
      +			list-style:  square;
      +			margin-bottom: 10px;
      +
      +
      +	.widget_search
      +		label
      +			font-weight: bold;
      +			margin-bottom: 10px;
      +			display: none;
      +		.submit 
      +			display: none;
      +		#s 
      +			border: 0;
      +			width: 92%;
      +			padding: 4%;
      +			background-color: #666;
      +			color: #1a1d22;
      +			font-size: 14px;
      +			&:focus 
      +				outline: none;
      +				color: White;
      +				box-shadow: none;
      +
      +
      +/* =Comments
      +-------------------------------------------------------------- */
      +
      +#disqus_thread{margin-top: 50px;}
      +.comments-area
      +	padding-top: 40px;
      +	h2{margin-top: 0;}
      +	ol.commentlist
      +		list-style:none; margin:0; padding: 0; max-width: 500px; 
      +		li.comment{border-bottom:1px solid #e7e7e7; line-height:24px;  margin:0 0 24px 0; padding:0 0 24px 60px; position:relative}
      +		li:last-child{border-bottom:none; margin-bottom:0}
      +		.avatar{position:absolute; border-radius: 100px; top:4px; left:0}
      +		.comment-author{font-weight: bold; font-size: 13px}
      +		.comment-author cite{color:#000; font-style:normal; font-weight:bold}
      +		.comment-author .says{font-style:italic}
      +		.comment-meta{font-size:12px; margin:0 0 18px 0}
      +		.comment-meta a:link, 
      +		.comment-meta a:visited{color:#888; text-decoration:none}
      +		.comment-meta a:active, 
      +		.comment-meta a:hover{color:#ff4b33}
      +	.reply{font-size:12px; padding:0 0 24px 0}
      +	.reply a, 
      +	a.comment-edit-link{color:#888}
      +	.reply a:hover, 
      +	a.comment-edit-link:hover{color:#ff4b33}
      +	.commentlist .children{list-style:none; margin:0}
      +	.commentlist .children li{border:none; margin:0}
      +	.nopassword, .nocomments{display:none}
      +	#comments .pingback{border-bottom:1px solid #e7e7e7; margin-bottom:18px; padding-bottom:18px}
      +	.commentlist li.comment+li.pingback{margin-top:-6px}
      +	#comments .pingback p{color:#888; display:block; font-size:12px; line-height:18px; margin:0}
      +	#comments .pingback .url{font-size:13px; font-style:italic}
      +
      +	input[type=submit]{color:#333}
      +	#respond{position:relative; }
      +	#respond p{margin:0}
      +	#respond .comment-notes{margin-bottom:1em}
      +	.form-allowed-tags{line-height:1em}
      +	.children #respond{margin:0 48px 0 0}
      +	h3#reply-title{margin:18px 0}
      +	#comments-list #respond{margin:0 0 18px 0}
      +	#comments-list ul #respond{margin:0}
      +	#cancel-comment-reply-link{font-size:12px; font-weight:normal; line-height:18px}
      +	article a.comment-reply-link{font-size: 13px; text-decoration: none; font-weight: bold;}
      +	#respond .required{color:#ff4b33; font-weight:bold}
      +	#respond .comment-form-author label, #respond .comment-form-email label, #respond .comment-form-url label, #respond .comment-form-comment label{color:#888;  font-size:12px; width: 70px; display: inline-block;  }
      +	#respond .comment-form-comment label {padding: 0; text-align: left; }
      +	#respond input[type="text"]{margin-bottom:14px; padding:4px; margin-right:10px; border:0; border-bottom:1px solid #ccc}
      +	#respond input[type="text"]:focus{outline:0; border-color:#333}
      +
      +	.comment-form-comment label{display: block;}
      +	#respond textarea{border-color:#ccc}
      +	#respond textarea:focus{outline:0}
      +	.logged-in-as{font-size: 11px}
      +
      +	ol.commentlist li.comment.byuser{margin-top: 30px}
      +	ol.commentlist li.comment.byuser #respond .form-submit{margin-left: 0}
      +	#respond #submit{margin:0 0 9px; background:black; border-radius:5px; padding:10px 20px; font-weight:bold; width:auto; border:0; color:white; margin-bottom:50px}
      +	#respond textarea{width: 96%; margin-bottom:10px; padding: 2%}
      +	#respond .form-allowed-tags{color:#888; font-size:12px; line-height:18px}
      +	#respond .form-allowed-tags code{font-size:11px}
      +	#respond .form-submit{margin:12px 0 0 0}
      +	#respond .form-submit input{font-size:14px; width:auto}
      +	.form-allowed-tags, .comment-notes{display: none;}
      +
      +
      +
      +
      +
      +
      +
      diff --git a/translations/readme.txt b/translations/readme.txt
      new file mode 100755
      index 0000000..2f675c2
      --- /dev/null
      +++ b/translations/readme.txt
      @@ -0,0 +1,6 @@
      +Place your theme language files in this directory.
      +
      +Please visit the following links to learn more about translating WordPress themes:
      +
      +http://codex.wordpress.org/Translating_WordPress
      +http://codex.wordpress.org/Function_Reference/load_theme_textdomain