-
Notifications
You must be signed in to change notification settings - Fork 18
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
Showing
9 changed files
with
305 additions
and
39 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,93 @@ | ||
<!doctype html> | ||
<html class="no-js" lang=""> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<title>Knockout Froala Demo</title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<!-- Froala files --> | ||
|
||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/froala_editor.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/froala_style.min.css" /> | ||
|
||
<!-- Froala plugin stylesheets, remove what you don't need --> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/char_counter.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/code_view.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/colors.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/draggable.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/emoticons.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/file.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/fullscreen.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/image.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/image_manager.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/line_breaker.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/quick_insert.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/table.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/video.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/themes/gray.min.css" /> | ||
|
||
|
||
</head> | ||
|
||
<body> | ||
<div id="app"> | ||
<h3> Editor </h3> | ||
<textarea data-bind="value: html, froala: html, froalaOptions: options"></textarea> | ||
<div id="edit"></div> | ||
|
||
<br> | ||
<h3> Preview Output </h3> | ||
|
||
<hr> | ||
<pre data-bind="html: html"></pre> | ||
<hr> | ||
|
||
<br> | ||
</div> | ||
|
||
<script data-main="js/app" src="js/lib/require.js"></script> | ||
|
||
<script> | ||
// Froala Editor plugins list. | ||
var fe_plugins = ['align', 'char_counter', 'code_view', 'colors', 'draggable', 'emoticons', | ||
'entities', 'file', 'font_family', 'font_size', 'fullscreen', | ||
'image_manager', 'image', 'inline_style', 'line_breaker', | ||
'link', 'lists', 'paragraph_format', 'paragraph_style', 'quote', | ||
'save', 'table', 'url', 'video'] | ||
// Define paths. | ||
var paths = { | ||
'app': '../app', | ||
'FroalaEditor': '../../../bower_components/froala-wysiwyg-editor/js/froala_editor.min', | ||
'knockout':'../../../bower_components/knockout/dist/knockout.debug', | ||
'knockout-froala':'../../../src/knockout-froala' | ||
}; | ||
// Add Froala Editor plugins to path. | ||
for (var i = 0; i < fe_plugins.length; i++) { | ||
paths['fe_' + fe_plugins[i]] = '../../../bower_components/froala-wysiwyg-editor/js/plugins/' + fe_plugins[i] + '.min'; | ||
} | ||
var shim = { | ||
|
||
}; | ||
for (var i = 0; i < fe_plugins.length; i++) { | ||
shim['fe_' + fe_plugins[i]] = { | ||
deps: ['FroalaEditor'] | ||
} | ||
} | ||
// Init RequireJS. | ||
requirejs.config({ | ||
'baseUrl': 'js/lib', | ||
'paths': paths, | ||
'shim': shim | ||
|
||
}); | ||
|
||
// Load the main app module to start the app | ||
|
||
requirejs(["app"]); | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
|
||
requirejs(["knockout"],function(ko) | ||
{ | ||
window.ko=ko; | ||
requirejs(["FroalaEditor"],function(FroalaEditor) | ||
{ | ||
window.FroalaEditor = FroalaEditor; | ||
requirejs(["knockout-froala"],function() | ||
{ | ||
|
||
|
||
requirejs(["fe_image","fe_char_counter"], function() { | ||
|
||
|
||
(function(){ | ||
var viewModel = { | ||
html: ko.observable( '' ), | ||
options: { | ||
|
||
enter: FroalaEditor.ENTER_DIV, | ||
theme: 'gray', | ||
charCounterMax:150 | ||
|
||
} | ||
} | ||
|
||
ko.applyBindings( viewModel, document.getElementById( 'app' ) ); | ||
})(); | ||
|
||
|
||
|
||
}) | ||
}) | ||
}) | ||
|
||
}) |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"name": "knockout-froala", | ||
"version": "2.7.5", | ||
|
||
"version": "3.1.0", | ||
|
||
"homepage": "https://github.com/froala/knockout-froala", | ||
"authors": [ | ||
"Anas Nakawa <[email protected]>", | ||
"Stefan Neculai <[email protected]>" | ||
"Anas Nakawa <[email protected]>" | ||
], | ||
"description": "Knockout.js binding for Froala WYSIWYG HTML Rich Text Editor", | ||
"main": "src/knockout-froala.js", | ||
|
@@ -36,11 +37,12 @@ | |
"tests" | ||
], | ||
"dependencies": { | ||
"froala-wysiwyg-editor": "^2.7.5", | ||
"knockout": "~3.3.0" | ||
|
||
"froala-wysiwyg-editor": "3.1.0", | ||
"font-awesome": "^4.7.0", | ||
|
||
"knockout": "~3.5.0" | ||
}, | ||
"resolutions": { | ||
"knockout": "2.3", | ||
"jquery": "1.11.0" | ||
} | ||
"knockout": "2.3" } | ||
} |
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 |
---|---|---|
|
@@ -27,6 +27,11 @@ | |
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/table.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/plugins/video.min.css" /> | ||
<link rel="stylesheet" href="../bower_components/froala-wysiwyg-editor/css/themes/gray.min.css" /> | ||
<!-- Include TUI CSS. --> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tui-image-editor.css"> | ||
<link rel="stylesheet" href="https://uicdn.toast.com/tui-color-picker/latest/tui-color-picker.css"> | ||
|
||
|
||
</head> | ||
|
||
<body> | ||
|
@@ -46,8 +51,6 @@ <h3> Preview Output </h3> | |
</div> | ||
|
||
|
||
<script src="../bower_components/jquery/dist/jquery.min.js"></script> | ||
|
||
<script src="../bower_components/froala-wysiwyg-editor/js/froala_editor.min.js"></script> | ||
|
||
<!-- Froala plugins, remove what you don't need --> | ||
|
@@ -79,8 +82,16 @@ <h3> Preview Output </h3> | |
<script src="../bower_components/froala-wysiwyg-editor/js/plugins/video.min.js"></script> | ||
|
||
<script src="../bower_components/knockout/dist/knockout.debug.js"></script> | ||
<!-- Include TUI JS. --> | ||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.6.7/fabric.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tui-code-snippet.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tui-image-editor.min.js"></script> | ||
|
||
<!-- Include TUI plugin. --> | ||
<script type="text/javascript" src="../bower_components/froala-wysiwyg-editor/js/third_party/image_tui.min.js"></script> | ||
|
||
<script src="../src/knockout-froala.js"></script> | ||
<script src="app.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
Oops, something went wrong.