Skip to content

Commit

Permalink
ready to ship
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardBock committed Oct 22, 2020
1 parent 4f0c090 commit 2542f66
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 42 deletions.
2 changes: 1 addition & 1 deletion js/dist/grid-editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/grid-editor.map

Large diffs are not rendered by default.

81 changes: 42 additions & 39 deletions js/grid_htmlbox_ckeditor_config.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*/
header('Content-Type: application/javascript');
?>
/*
if(typeof CKEDITOR !== typeof undefined){
/*
CKEDITOR.stylesSet.add( 'grid_styles',
[
// Block-level styles
Expand All @@ -19,53 +20,53 @@
{ name : 'Marker: Yellow', element : 'span', styles : { 'background-color' : 'Yellow' } }
]);
*/
CKEDITOR.stylesSet.add( 'grid_styles',
CKEDITOR.stylesSet.add( 'grid_styles',
[
// Block-level styles
<?php
$tmp=array();
foreach($styles as $style)
{
$tmp[]=json_encode($style);
}
echo implode(",", $tmp);
?>
//{ name : 'Fett', element : 'h2', attributes : { 'class' : 'emm-headline-bold' } },
//{ name : 'Mittel' , element : 'p', attributes : { 'class' : 'emm-medium' } }
// Block-level styles
<?php
$tmp=array();
foreach($styles as $style)
{
$tmp[]=json_encode($style);
}
echo implode(",", $tmp);
?>
//{ name : 'Fett', element : 'h2', attributes : { 'class' : 'emm-headline-bold' } },
//{ name : 'Mittel' , element : 'p', attributes : { 'class' : 'emm-medium' } }
]);
<?php
$items=array();
if(count($styles)>0)
{
<?php
$items=array();
if(count($styles)>0)
{
$items[]="Styles";
}
if(count($formats)>0)
{
}
if(count($formats)>0)
{
$items[]="Format";
}
if(!in_array("p",$formats))
{
}
if(!in_array("p",$formats))
{
$formats[]="p";
}
}

/**
* add external ckeditor plugins
*/
foreach($ckeditor_plugins as $slug => $path){
/**
* add external ckeditor plugins
*/
foreach($ckeditor_plugins as $slug => $path){
echo "CKEDITOR.plugins.addExternal('$slug', '$path');";
}
?>
}
?>

CKEDITOR.editorConfig = function( config ) {
CKEDITOR.editorConfig = function( config ) {
config.language = 'de';
config.toolbar = [
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike'] },
{ name: 'links', items: ['Link', 'Unlink', 'Anchor']},
{ name: "format", items: <?=json_encode($items)?>},
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike'] },
{ name: 'links', items: ['Link', 'Unlink', 'Anchor']},
{ name: "format", items: <?=json_encode($items)?>},

{ name: 'blockstyles', items: [ 'NumberedList','BulletedList', 'Blockquote' ] },
{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
{ name: 'document', items: [ 'Source' ] }
{ name: 'blockstyles', items: [ 'NumberedList','BulletedList', 'Blockquote' ] },
{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
{ name: 'document', items: [ 'Source' ] }
];

config.allowedContent = true;
Expand All @@ -80,9 +81,11 @@
*load external plugins for ckeditor
*/
foreach($ckeditor_plugins as $slug => $path){
echo "config.extraPlugins = '$slug';";
echo "config.extraPlugins = '$slug';";
}
?>

};
};


}
4 changes: 3 additions & 1 deletion src/grid-editor/frameworks/GridICanHaz.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Changed line 521
// if (script && script.innerHTML && script.id && (script.type === "text/html" || script.type === "text/x-icanhaz"))
// if (script && script.innerHTML && script.id && (script.type === "text/html" || script.type === "text/x-icanhaz"))
// To
// if (script && script.innerHTML && script.id && ( script.type === "text/grid-icanhaz")) {
// Because of Wordpress issues
Expand Down Expand Up @@ -554,5 +554,7 @@ var Mustache = function () {
}
}

window.ich = ich;

})();
})();

0 comments on commit 2542f66

Please sign in to comment.