-
-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1176 from Fabacks/develop
- Loading branch information
Showing
7 changed files
with
175 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
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,76 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Indent plugin | Trumbowyg</title> | ||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'> | ||
<link rel="stylesheet" href="../../css/main.css"> | ||
</head> | ||
<body class="documentation-body"> | ||
<div class="main main-demo-inner"> | ||
<section class="wrapper section"> | ||
<h2 class="section-title">Indent plugin</h2> | ||
|
||
<div class="feature"> | ||
<h3>Basic usage</h3> | ||
<p> | ||
This plugin allow you to indent or oudent into your page creating vibrante documents. | ||
</p> | ||
|
||
<a href="../../documentation/plugins/#plugin-indent" class="button button-demo">Read insert indent plugin documentation</a> | ||
|
||
<div id="editor"> | ||
<h2>You can make me come alive!</h2> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus, aliquam, minima fugiat placeat provident | ||
optio nam reiciendis eius beatae quibusdam! | ||
</p> | ||
<p> | ||
The text is derived from Cicero's De Finibus Bonorum et Malorum (On the Ends of Goods and Evils, or | ||
alternatively [About] The Purposes of Good and Evil ). The original passage began: Neque porro quisquam est | ||
qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit (Translation: "Neither is there | ||
anyone who loves grief itself since it is grief and thus wants to obtain it"). | ||
</p> | ||
</div> | ||
|
||
<h3>The code</h3> | ||
<pre><code class="js-code-to-eval javascript"> | ||
$('#editor') | ||
.trumbowyg({ | ||
btns: ['indent', 'outdent'] | ||
}); | ||
</code></pre> | ||
</div> | ||
|
||
<div class="feature"> | ||
<h3>Setup</h3> | ||
|
||
<h4>In head tag</h4> | ||
<pre><code class="html loading-head"> | ||
</code></pre> | ||
<h4>At the end of body</h4> | ||
<pre><code class="html loading-body"> | ||
<!-- Import jQuery --> | ||
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | ||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.3.1.min.js"><\/script>')</script> | ||
</code></pre> | ||
</div> | ||
</section> | ||
</div> | ||
|
||
|
||
<!-- Import jQuery --> | ||
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | ||
<script>window.jQuery || document.write('<script src="../../js/vendor/jquery-3.3.1.min.js"><\/script>')</script> | ||
|
||
<!-- DO NOT COPY THESE LINES IN YOUR PROJECT, THEY ARE THERE JUST FOR THE EXAMPLE PAGE PURPOSE --> | ||
<script src="../js/loader.js"></script> | ||
<script> | ||
loadStyle('dist/ui/trumbowyg.min.css'); | ||
loadScript('dist/trumbowyg.min.js', 'Import Trumbowyg'); | ||
loadScript('dist/plugins/indent/trumbowyg.indent.min.js', 'Import all plugins you want AFTER importing jQuery and Trumbowyg'); | ||
</script> | ||
<script src="../js/runExampleCode.js"></script> | ||
<script src="../js/highlight.js"></script> | ||
</body> | ||
</html> |
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
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
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,56 @@ | ||
|
||
/* =========================================================== | ||
* trumbowyg.indent.js v1.0 | ||
* Indent or Outdent plugin for Trumbowyg | ||
* http://alex-d.github.com/Trumbowyg | ||
* =========================================================== | ||
* Author : Fabacks | ||
* Website : https://github.com/Fabacks | ||
*/ | ||
|
||
(function ($) { | ||
'use strict'; | ||
|
||
$.extend(true, $.trumbowyg, { | ||
langs: { | ||
en: { | ||
indent: 'Indent', | ||
outdent: 'Outdent' | ||
}, | ||
fr: { | ||
indent: 'Augmenter le retrait', | ||
outdent: 'Diminuer le retrait' | ||
} | ||
} | ||
}); | ||
|
||
// Adds the extra button definition | ||
$.extend(true, $.trumbowyg, { | ||
plugins: { | ||
paragraph: { | ||
init: function (trumbowyg) { | ||
var indentBtnDef = { | ||
fn: 'indent', | ||
title: trumbowyg.lang.indent, | ||
isSupported: function () { | ||
return !!document.queryCommandSupported && !!document.queryCommandSupported('indent'); | ||
}, | ||
ico: 'indent' | ||
}; | ||
|
||
var outdentBtnDef = { | ||
fn: 'outdent', | ||
title: trumbowyg.lang.outdent, | ||
isSupported: function () { | ||
return !!document.queryCommandSupported && !!document.queryCommandSupported('outdent'); | ||
}, | ||
ico: 'outdent' | ||
}; | ||
|
||
trumbowyg.addBtnDef('indent', indentBtnDef); | ||
trumbowyg.addBtnDef('outdent', outdentBtnDef); | ||
} | ||
} | ||
} | ||
}) | ||
})(jQuery); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.