Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Added Styling to TinyMCE #24 PR #243 from EkoJr/sc-button-styling #243

Open
wants to merge 3 commits into
base: shortcode-button
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions classes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public function __construct() {
add_action( 'admin_notices', array( $this, 'admin_notices' ) );

// Add a button to the TinyMCE console
add_action( 'admin_head', array( &$this, 'register_shortcode_button' ) );
add_action( 'edit_form_after_title', array( &$this, 'register_shortcode_button' ) );
}

/**
* This method adds a button that helps the user insert a shortcode intstead of having to memorize it
* This method adds a button that helps the user insert a shortcode instead of having to memorize it
*
* @since 2.5.1
*/
Expand Down
2 changes: 1 addition & 1 deletion inc/js/shortcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(function ($) {
tinymce.PluginManager.add('simplemap_button', function(editor, url) {
editor.addButton('simplemap_button', {
icon : 'simplemap',
icon : 'simplemap dashicons-before dashicons-location-alt',
tooltip : simple_map_js_array.i10n['title_button'],
onclick : function (e) {
editor.windowManager.open( {
Expand Down
25 changes: 25 additions & 0 deletions inc/styles/shortcode.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
i.mce-i-simplemap:before {
content: "\f231";
}

.sm-mce-shortcode {
width: 94%;
margin: 2% 3%;
}

.sm-mce-shortcode fieldset {
margin-bottom: 9px;
}

.sm-mce-shortcode fieldset > *:first-child {
float: left;
display: block;
width: 25%;
}

.sm-mce-shortcode fieldset > div {
float: left;
width: 75%;
}

.sm-mce-shortcode fieldset > div > label {
float: left;
width: 25%;
}
14 changes: 8 additions & 6 deletions inc/templates/shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$tags = get_terms( array( 'taxonomy' => 'sm-tag', 'hide_empty' => false, 'fields' => 'id=>name' ) );
?>

<div id="simplemap-button-modal">
<div id="simplemap-button-modal" class="sm-mce-shortcode">
<form id="simple_map_shortcode">
<fieldset>
<label for="simplemap_category"><?php _e( 'Category', 'SimpleMap' );?></label>
Expand Down Expand Up @@ -57,11 +57,13 @@
<label for="simplemap_list_hide"><?php _e( 'Hide', 'SimpleMap' );?></label>
<input type="radio" id="simplemap_list_hide" name="hide_list" value="true">
</fieldset>
<fieldset>
<label for="default_lat"><?php _e( 'Default Lat', 'SimpleMap' );?></label>
<input type="text" id="default_lat" name="default_lat">
<label for="default_lon"><?php _e( 'Default Lon', 'SimpleMap' );?></label>
<input type="text" id="default_lon" name="default_lon">
<fieldset><legend><?php _e( 'Default Location', 'SimpleMap' );?></legend>
<div>
<label for="default_lat"><?php _e( 'Latitude', 'SimpleMap' );?></label>
<input type="text" id="default_lat" name="default_lat" style="margin-bottom: 5px;"><br>
<label for="default_lon"><?php _e( 'Longitude', 'SimpleMap' );?></label>
<input type="text" id="default_lon" name="default_lon">
</div>
</fieldset>
</form>
</div>