knockout-froala
Advanced tools
Comparing version 2.9.3 to 2.9.4-1
{ | ||
"name": "knockout-froala", | ||
"version": "2.9.3", | ||
"version": "2.9.4-1", | ||
"homepage": "https://github.com/froala/knockout-froala", | ||
@@ -38,4 +38,4 @@ "authors": [ | ||
"dependencies": { | ||
"froala-wysiwyg-editor": "2.9.3", | ||
"knockout": "~3.3.0" | ||
"froala-wysiwyg-editor": "2.9.4", | ||
"knockout": "~3.5.0" | ||
}, | ||
@@ -42,0 +42,0 @@ "resolutions": { |
{ | ||
"name": "knockout-froala", | ||
"version": "2.9.3", | ||
"version": "2.9.4-1", | ||
"description": "Knockout.js binding for Froala WYSIWYG HTML Rich Text Editor", | ||
@@ -5,0 +5,0 @@ "main": "src/knockout-froala.js", |
@@ -60,2 +60,60 @@ # Knockout Froala WYSIWYG HTML Editor | ||
## How to use with require js | ||
In order to use knockout-froala with require js, you require code snippet similar to following: | ||
// 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', | ||
'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min', | ||
'froala_editor': '../../../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 = { | ||
'froala_editor': {deps: ['jquery']} | ||
}; | ||
for (var i = 0; i < fe_plugins.length; i++) { | ||
shim['fe_' + fe_plugins[i]] = { | ||
deps: ['froala_editor'] | ||
} | ||
} | ||
// Init RequireJS. | ||
requirejs.config({ | ||
'baseUrl': 'js/lib', | ||
'paths': paths, | ||
shim: shim | ||
}); | ||
// Load the main app module to start the app | ||
requirejs(["knockout"],function(ko) | ||
{ | ||
window.ko=ko; | ||
requirejs(["knockout-froala"],function(knockout_froala) | ||
{ | ||
requirejs(["app"]); | ||
}) | ||
}) | ||
Where: | ||
1.fe_plugins denote list of froala plugins. | ||
2.paths variable defines the path of all resources. | ||
3.shim variable defines dependencies among js files. | ||
4.knockout.debug.js is loaded first because it returns a object(ko) required for accessing knockout variables and methods. | ||
This variable is made global. | ||
5.knockout-froala is loaded next because it defines the froala bindings required by main app. | ||
6.Finally app.js is loaded which contains the logic of your app. | ||
A Requirejs demo app is included in the repository. You can refer it for more details. | ||
## License | ||
@@ -62,0 +120,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential security risk
Supply chain riskAI has determined that this package may contain potential security issues or vulnerabilities.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37822
13
175
124
3
3
2