-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b660338
Showing
9 changed files
with
616 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
featherbb/config.php | ||
.idea/ | ||
nbproject/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) 2015-2016 FeatherBB | ||
* based on code by (C) 2008-2012 FluxBB | ||
* and Rickard Andersson (C) 2002-2008 PunBB | ||
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher | ||
*/ | ||
|
||
namespace FeatherBB\Plugins; | ||
|
||
use FeatherBB\Core\Plugin as BasePlugin; | ||
|
||
class BbcodeToolbar extends BasePlugin | ||
{ | ||
|
||
public function run() | ||
{ | ||
// Add language files into javascript footer block | ||
$this->feather->hooks->bind('view.alter_data', [$this, 'addLanguage']); | ||
// Support default actions | ||
$this->hooks->bind('controller.post.create', [$this, 'addToolbar']); | ||
$this->hooks->bind('controller.post.edit', [$this, 'addToolbar']); | ||
$this->hooks->bind('controller.topic.display', [$this, 'addToolbar']); | ||
// Support PMs plugin | ||
$this->hooks->bind('conversationsPlugin.send.preview', [$this, 'addToolbar']); | ||
$this->hooks->bind('conversationsPlugin.send.display', [$this, 'addToolbar']); | ||
} | ||
|
||
public function addLanguage($data) | ||
{ | ||
load_textdomain('bbcode-toolbar', dirname(__FILE__).'/lang/'.$this->feather->user->language.'/bbeditor.mo'); | ||
$lang_bbeditor = array( | ||
'btnBold' => __('btnBold', 'bbcode-toolbar'), | ||
'btnItalic' => __('btnItalic', 'bbcode-toolbar'), | ||
'btnUnderline' => __('btnUnderline', 'bbcode-toolbar'), | ||
'btnColor' => __('btnColor', 'bbcode-toolbar'), | ||
'btnLeft' => __('btnLeft', 'bbcode-toolbar'), | ||
'btnRight' => __('btnRight', 'bbcode-toolbar'), | ||
'btnJustify' => __('btnJustify', 'bbcode-toolbar'), | ||
'btnCenter' => __('btnCenter', 'bbcode-toolbar'), | ||
'btnLink' => __('btnLink', 'bbcode-toolbar'), | ||
'btnPicture' => __('btnPicture', 'bbcode-toolbar'), | ||
'btnList' => __('btnList', 'bbcode-toolbar'), | ||
'btnQuote' => __('btnQuote', 'bbcode-toolbar'), | ||
'btnCode' => __('btnCode', 'bbcode-toolbar'), | ||
'promptImage' => __('promptImage', 'bbcode-toolbar'), | ||
'promptUrl' => __('promptUrl', 'bbcode-toolbar'), | ||
'promptQuote' => __('promptQuote', 'bbcode-toolbar') | ||
); | ||
$data['jsVars']['bbcodeToolbar'] = json_encode($lang_bbeditor); | ||
return $data; | ||
} | ||
|
||
public function addToolbar() | ||
{ | ||
$this->feather->template->addAsset('css', 'plugins/bbcode-toolbar/style/bbeditor.css', array('type' => 'text/css', 'rel' => 'stylesheet')); | ||
$this->feather->template->addAsset('css', 'plugins/bbcode-toolbar/style/colorPicker.css', array('type' => 'text/css', 'rel' => 'stylesheet')); | ||
$this->feather->template->addAsset('js', 'plugins/bbcode-toolbar/style/bbeditor.js', array('type' => 'text/javascript')); | ||
$this->feather->template->addAsset('js', 'plugins/bbcode-toolbar/style/colorPicker.js', array('type' => 'text/javascript')); | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "bbcode-toolbar", | ||
"title": "BBCode Toolbar", | ||
"description": "Add a default toolbar to format BBCode in your posts.", | ||
"version": "0.1.0", | ||
"author": { | ||
"name": "beaver" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"Project-Id-Version: FeatherBB\n" | ||
"POT-Creation-Date: \n" | ||
"PO-Revision-Date: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: FeatherBB <[email protected]>\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Language: en\n" | ||
"X-Generator: Poedit 1.8.4\n" | ||
"X-Poedit-SourceCharset: UTF-8\n" | ||
|
||
msgid "btnBold" | ||
msgstr "Bold" | ||
|
||
msgid "btnItalic" | ||
msgstr "Italic" | ||
|
||
msgid "btnUnderline" | ||
msgstr "Underline" | ||
|
||
msgid "btnColor" | ||
msgstr "Color" | ||
|
||
msgid "btnLeft" | ||
msgstr "Left" | ||
|
||
msgid "btnRight" | ||
msgstr "Right" | ||
|
||
msgid "btnJustify" | ||
msgstr "Justify" | ||
|
||
msgid "btnCenter" | ||
msgstr "Center" | ||
|
||
msgid "btnLink" | ||
msgstr "Insert URL Link" | ||
|
||
msgid "btnPicture" | ||
msgstr "Insert Image" | ||
|
||
msgid "btnList" | ||
msgstr "Unordered List" | ||
|
||
msgid "btnQuote" | ||
msgstr "Quote" | ||
|
||
msgid "btnCode" | ||
msgstr "Code" | ||
|
||
msgid "promptImage" | ||
msgstr "Enter the Image URL:" | ||
|
||
msgid "promptUrl" | ||
msgstr "Enter the URL:" | ||
|
||
msgid "promptQuote" | ||
msgstr "Please enter the username quoted (or leave blank):" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.toolbar { | ||
/*width: 400px;*/ | ||
/*height: 150px;*/ | ||
} | ||
.toolbar-icon { | ||
cursor: pointer; | ||
max-width: 26px; | ||
max-height: 26px; | ||
/*border: 1px solid #ccc;*/ | ||
-webkit-border-radius: 4px; | ||
-moz-border-radius: 4px; | ||
border-radius: 4px; | ||
padding: 1.5px; | ||
/*margin: 1px;*/ | ||
/*padding: 2px;*/ | ||
} | ||
.toolbar-icon:hover { | ||
background-color: #abccdf; | ||
color: rgb(43, 37, 42); | ||
} | ||
.toolbar-separator { | ||
margin-right: 8px; | ||
} |
Oops, something went wrong.