Skip to content

Commit

Permalink
menu simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Rauch committed Mar 27, 2013
1 parent 6ad0fa7 commit 3e5faf0
Show file tree
Hide file tree
Showing 12 changed files with 373 additions and 37 deletions.
39 changes: 39 additions & 0 deletions wp-content/plugins/wp-svbtle-editor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~
*.sass-cache

# OS or Editor folders
.DS_Store
Thumbs.db
.cache
.project
.settings
.tmproj
*.esproj
nbproject
*.sublime-project
*.sublime-workspace

# Dreamweaver added files
_notes
dwsync.xml

# Komodo
*.komodoproject
.komodotools

# Folders to ignore
.hg
.svn
.CVS
intermediate
.idea
cache
110 changes: 110 additions & 0 deletions wp-content/plugins/wp-svbtle-editor/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
=== Plugin Name ===
Contributors: username1, username2 (this should be a list of wordpress.org userid's)
Donate link: http://example.com/
Tags: comments, spam
Requires at least: 3.3.1
Tested up to: 3.3.1
Stable tag: 4.3

Here is a short description of the plugin. This should be no more than 150 characters. No markup here.

== Description ==

This is the long description. No limit, and you can use Markdown (as well as in the following sections).

For backwards compatibility, if this section is missing, the full length of the short description will be used, and
Markdown parsed.

A few notes about the sections above:

* "Contributors" is a comma separated list of wp.org/wp-plugins.org usernames
* "Tags" is a comma separated list of tags that apply to the plugin
* "Requires at least" is the lowest version that the plugin will work on
* "Tested up to" is the highest version that you've *successfully used to test the plugin*. Note that it might work on
higher versions... this is just the highest one you've verified.
* Stable tag should indicate the Subversion "tag" of the latest stable version, or "trunk," if you use `/trunk/` for
stable.

Note that the `readme.txt` of the stable tag is the one that is considered the defining one for the plugin, so
if the `/trunk/readme.txt` file says that the stable tag is `4.3`, then it is `/tags/4.3/readme.txt` that'll be used
for displaying information about the plugin. In this situation, the only thing considered from the trunk `readme.txt`
is the stable tag pointer. Thus, if you develop in trunk, you can update the trunk `readme.txt` to reflect changes in
your in-development version, without having that information incorrectly disclosed about the current stable version
that lacks those changes -- as long as the trunk's `readme.txt` points to the correct stable tag.

If no stable tag is provided, it is assumed that trunk is stable, but you should specify "trunk" if that's where
you put the stable version, in order to eliminate any doubt.

== Installation ==

This section describes how to install the plugin and get it working.

e.g.

1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Place `<?php do_action('plugin_name_hook'); ?>` in your templates

== Frequently Asked Questions ==

= A question that someone might have =

An answer to that question.

= What about foo bar? =

Answer to foo bar dilemma.

== Screenshots ==

1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
the directory of the stable readme.txt, so in this case, `/tags/4.3/screenshot-1.png` (or jpg, jpeg, gif)
2. This is the second screen shot

== Changelog ==

= 1.0 =
* A change since the previous version.
* Another change.

= 0.5 =
* List versions from most recent at top to oldest at bottom.

== Upgrade Notice ==

= 1.0 =
Upgrade notices describe the reason a user should upgrade. No more than 300 characters.

= 0.5 =
This version fixes a security related bug. Upgrade immediately.

== Arbitrary section ==

You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
"installation." Arbitrary sections will be shown below the built-in sections outlined above.

== A brief Markdown Example ==

Ordered list:

1. Some feature
1. Another feature
1. Something else about the plugin

Unordered list:

* something
* something else
* third thing

Here's a link to [WordPress](http://wordpress.org/ "Your favorite software") and one to [Markdown's Syntax Documentation][markdown syntax].
Titles are optional, naturally.

[markdown syntax]: http://daringfireball.net/projects/markdown/syntax
"Markdown is what the parser uses to process much of the readme file"

Markdown uses email style notation for blockquotes and I've been told:
> Asterisks for *emphasis*. Double it up for **strong**.

`<?php code(); // goes in backticks ?>`
1 change: 1 addition & 0 deletions wp-content/plugins/wp-svbtle-editor/css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This stylesheet is used to style the admin option form of the widget. */
1 change: 1 addition & 0 deletions wp-content/plugins/wp-svbtle-editor/css/display.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This stylesheet is used to style the public view of the plugin. */
6 changes: 6 additions & 0 deletions wp-content/plugins/wp-svbtle-editor/js/admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(function ($) {
"use strict";
$(function () {
// Place your administration-specific JavaScript here
});
}(jQuery));
6 changes: 6 additions & 0 deletions wp-content/plugins/wp-svbtle-editor/js/display.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(function ($) {
"use strict";
$(function () {
// Place your public-facing JavaScript here
});
}(jQuery));
17 changes: 17 additions & 0 deletions wp-content/plugins/wp-svbtle-editor/lang/plugin.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
msgid ""
msgstr ""
"Project-Id-Version: WordPress Plugin Boilerplate\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-07-11 12:22-0500\n"
"PO-Revision-Date: 2011-07-11 12:22-0500\n"
"Last-Translator: \n"
"Language-Team: Tom McFarlin <tom@tommcfarlin.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-Language: English\n"
"X-Poedit-Country: UNITED STATES\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-SearchPath-0: ..\n"
190 changes: 190 additions & 0 deletions wp-content/plugins/wp-svbtle-editor/plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<?php
/*
Plugin Name: wp-svbtle editor
Plugin URI: http://wp-svbtle-editor.themeskult.com/
Description: Simple markdown editor for Wordpress.
Version: 1.0
Author: Themes Kult
Author URI: http://themeskult.com
Author Email: themeskult@gravityonmars.com
License:
Copyright 2012 Themes Kult (themeskult@gravityonmars.com)
*/

// wp-svbtle editor: rename this class to a proper name for your plugin
class WpSvbtleEditor {

/*--------------------------------------------*
* Constructor
*--------------------------------------------*/

/**
* Initializes the plugin by setting localization, filters, and administration functions.
*/
function __construct() {

// load plugin text domain
add_action( 'init', array( $this, 'textdomain' ) );

// Register admin styles and scripts
add_action( 'admin_print_styles', array( $this, 'register_admin_styles' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );

add_action('admin_bar_menu', 'add_items', 100);


// Register site styles and scripts
add_action( 'wp_enqueue_scripts', array( $this, 'register_plugin_styles' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'register_plugin_scripts' ) );

register_activation_hook( __FILE__, array( $this, 'activate' ) );
register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
register_uninstall_hook( __FILE__, array( $this, 'uninstall' ) );

/*
* TODO:
* Define the custom functionality for your plugin. The first parameter of the
* add_action/add_filter calls are the hooks into which your code should fire.
*
* The second parameter is the function name located within this class. See the stubs
* later in the file.
*
* For more information:
* http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
*/
add_action( 'wp-svbtle editor', array( $this, 'action_method_name' ) );
add_filter( 'wp-svbtle editor', array( $this, 'filter_method_name' ) );

} // end constructor

/**
* Fired when the plugin is activated.
*
* @params $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog
*/
public function activate( $network_wide ) {
// TODO define activation functionality here
} // end activate

/**
* Fired when the plugin is deactivated.
*
* @params $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog
*/
public function deactivate( $network_wide ) {
// TODO define deactivation functionality here
} // end deactivate

/**
* Fired when the plugin is uninstalled.
*
* @params $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog
*/
public function uninstall( $network_wide ) {
// TODO define uninstall functionality here
} // end uninstall

/**
* Loads the plugin text domain for translation
*/
public function textdomain() {
// TODO: replace "plugin-name-locale" with a unique value for your plugin
load_plugin_textdomain( 'plugin-name-locale', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
}

/**
* Registers and enqueues admin-specific styles.
*/
public function register_admin_styles() {

// TODO change 'plugin-name' to the name of your plugin
wp_enqueue_style( 'plugin-name-admin-styles', plugins_url( 'wp-svbtle-editor/css/admin.css' ) );

} // end register_admin_styles

/**
* Registers and enqueues admin-specific JavaScript.
*/
public function register_admin_scripts() {

// TODO change 'plugin-name' to the name of your plugin
wp_enqueue_script( 'plugin-name-admin-script', plugins_url( 'wp-svbtle-editor/js/admin.js' ) );

} // end register_admin_scripts

/**
* Registers and enqueues plugin-specific styles.
*/
public function register_plugin_styles() {

// TODO change 'plugin-name' to the name of your plugin
wp_enqueue_style( 'plugin-name-plugin-styles', plugins_url( 'wp-svbtle-editor/css/display.css' ) );

} // end register_plugin_styles

/**
* Registers and enqueues plugin-specific scripts.
*/
public function register_plugin_scripts() {

// TODO change 'plugin-name' to the name of your plugin
wp_enqueue_script( 'plugin-name-plugin-script', plugins_url( 'wp-svbtle-editor/js/display.js' ) );

} // end register_plugin_scripts

/*--------------------------------------------*
* Core Functions
*---------------------------------------------*/

/**
* Note: Actions are points in the execution of a page or process
* lifecycle that WordPress fires.
*
* WordPress Actions: http://codex.wordpress.org/Plugin_API#Actions
* Action Reference: http://codex.wordpress.org/Plugin_API/Action_Reference
*
*/
function action_method_name() {
// TODO define your action method here
} // end action_method_name

/**
* Note: Filters are points of execution in which WordPress modifies data
* before saving it or sending it to the browser.
*
* WordPress Filters: http://codex.wordpress.org/Plugin_API#Filters
* Filter Reference: http://codex.wordpress.org/Plugin_API/Filter_Reference
*
*/
function filter_method_name() {
// TODO define your filter method here
} // end filter_method_name



public function add_items($admin_bar)
{
global $post;

$args = array(
'id' => 'wp-svbtle-editor',
'title' => 'wp-svbtle editor',
'href' => '/wp-svbtle/wp-svbtle',
'meta' => array('title' => __('wp-svbtle editor'))
);

if (is_single() or is_page()) {
$args['href'] = get_bloginfo('url') . '/wp-svbtle/index.php?page=edit&id='.$post->ID;
$args['title'] = 'Edit post with wp-svbtle';
}

//This is where the magic works.
$admin_bar->add_menu( $args);
}

} // end class

// TODO: update the instantiation call of your plugin to the name given at the class definition
$plugin_name = new WpSvbtleEditor();
1 change: 1 addition & 0 deletions wp-content/plugins/wp-svbtle-editor/views/admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- This file is used to markup the administration form of the plugin.. -->
1 change: 1 addition & 0 deletions wp-content/plugins/wp-svbtle-editor/views/display.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- This file is used to markup the public facing aspect of the plugin. -->
Loading

0 comments on commit 3e5faf0

Please sign in to comment.