Skip to content

Instantly share code, notes, and snippets.

View ryandemmer's full-sized avatar

Ryan Demmer ryandemmer

View GitHub Profile
@ryandemmer
ryandemmer / gist:13f2ca3a9835a79695ad
Created October 6, 2014 16:33
Move editor buttons
$editor = $this->_displayButtons($id, $buttons, $asset, $author);
$editor .= '<label for="' . $id . '" style="display:none;" aria-visible="false">' . $id . '_textarea</label><textarea id="' . $id . '" name="' . $name . '" cols="' . $col . '" rows="' . $row . '" style="width:' . $width . ';height:' . $height . ';" class="wfEditor mce_editable source" wrap="off">' . $content . '</textarea>';
@ryandemmer
ryandemmer / gist:477ccdf27f538dc29889
Created October 7, 2014 12:25
Convert braces to named entities
(function() {
tinyMCE.onAddEditor.add(function(mgr, ed) {
ed.onPostProcess.add(function(ed, o) {
o.content = o.content.replace(/\{/g, '&lcub;').replace(/\}/g, '&rcub;');
});
});
})();
@ryandemmer
ryandemmer / gist:3ebfae1f54fa81c6563b
Created February 19, 2015 13:30
Dynamically add TinyMCE editor
if (typeof tinymce !== "undefined") {
tinyMCE.execCommand('mceAddControl',false,'textarea_id');
}
@ryandemmer
ryandemmer / gist:46ff99c9e05cea2fea75
Last active August 29, 2015 14:17
Example WFCustomFileSystem extension
<?php
/**
* @package JCE
* @copyright Copyright (c) 2009-2015 Ryan Demmer. All rights reserved.
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
@ryandemmer
ryandemmer / search-joomla.php
Created March 30, 2015 14:31
JCE 3.0 Search Plugin Example
<?php
/**
* @package JCE
* @copyright Copyright (c) 2009-2014 Ryan Demmer. All rights reserved.
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
@ryandemmer
ryandemmer / link-joomla.php
Created March 30, 2015 14:32
Joomla Link Plugin Example for JCE 3.0
@ryandemmer
ryandemmer / gist:7e2d36ae93e9349742bc
Created April 27, 2015 15:12
Popup dynamic class
(function($) {
$(document).ready(function() {
$('a.jcepopup').click(function() {
var self = this;
window.setTimeout(function() {
$('#jcemediabox-popup-page').addClass('popup-' + $(self).index());
}, 100);
});
});
@ryandemmer
ryandemmer / gist:4634415
Created January 25, 2013 13:25
CSS3 Spinner
.spinner {
background : url(spinner.png) no-repeat center;
width :16px;
height :16px;
display :block;
-webkit-animation: spinner 1s infinite linear; /* Safari 4+ */
-moz-animation: spinner 1s infinite linear; /* Fx 5+ */
-o-animation: spinner 1s infinite linear; /* Opera 12+ */
animation: spinner 1s infinite linear; /* IE 10+ */
@ryandemmer
ryandemmer / gist:5185962
Last active December 15, 2015 02:19
Ninjaboard to EasyDiscuss converter Based on the Ninjaboard to Kunena converter from AmmoniteNetworks - https://github.com/AmmoniteNetworks/Ninjaboard-To-Kunena-Converter/blob/master/cli/ninjaboardToKunena.php
<?php
// Make sure we're being called from the command line, not a web interface
if (array_key_exists('REQUEST_METHOD', $_SERVER))
die();
// Set flag that this is a parent file.
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
@ryandemmer
ryandemmer / plg_content_example.php
Last active January 20, 2017 09:32
OnContentBeforeSave example
<?php
class PlgContentExample extends JPlugin
{
public function onContentBeforeSave($context, $article, $isNew)
{
if ($context != 'com_content.form') {
return true;
}