Django CkEditor Load Custom Plugin - Not Working - django

I'm creating a custom CkEditor for Django. I followed https://ckeditor.com/docs/ckeditor4/latest/guide/plugin_sdk_sample_1.html and tried to load the plugin but it doesn't. When I put other plugins into my static folder (lib/static/ckeditor/ckeditor/plugins/MYPLUGIN) and try to load them, it works.
Maybe someone can help me.
Console error:
ckeditor.js:98 GET http://127.0.0.1:8000/lib/static/ckeditor/ckeditor/plugins/utils/plugin.js?t=I3I8 net::ERR_ABORTED 404 (Not Found)
ckeditor.js:255 Uncaught Error: [CKEDITOR.resourceManager.load] Resource name "utils" was not found at "http://127.0.0.1:8000/lib/static/ckeditor/ckeditor/plugins/utils/plugin.js?t=I3I8".
at CKEDITOR.resourceManager.<anonymous> (ckeditor.js:255)
at e (ckeditor.js:250)
at Array.z (ckeditor.js:250)
at y (ckeditor.js:250)
at ckeditor.js:251

Problem solved
I accidentally named plugin.js plugins.js (with s).

Related

ember-electron application start (code hierarchy)

I'm trying to move a very old 2.x ember-electron application to new electron with ember-electron and got application window with blank screen and error in console:
(node:9061) electron: Failed to load URL: serve://dist/ with error: ERR_FILE_NOT_FOUND
The calling file ../new-ember-electron/electron-app/src/index.js has lines from old applications:
const emberAppLocation = 'serve://dist';
mainWindow.loadURL(emberAppLocation);
File ../new-ember-electron/app/router.js has:
this.route('index', { path: '/' }, function() {}
Files ../new-ember-electron/app/routes/index.js, ../new-ember-electron/app/controllers/index.js and ../new-ember-electron/app/templates/index.hbs also exist.
So, it's unclear what exactly is not found and how to find a more detailed error (application developer console doesn't have errors). But if to change the mentioned 2 lines in ../new-ember-electron/electron-app/src/index.js to:
const emberAppLocation = '../app/index.html';
mainWindow.loadFile(emberAppLocation);
then application shows content of the correct file, despite nothing working in it, even <LinkTo>...</LinkTo> is not treated as a link.
Would you please help me to understand how an ember-electron application should be structured and which way is called for the recent versions?
Used versions: node - 16.14.0, electron: 17.0.1, ember-cli: 3.28.5, ember-electron: 3.1.0, OS: darwin x64.
Thank you.
Thank you, jacobq, I've looked at your example and used emberAppUrl to start from ember-dist/index.html file. After few more changes related to require/requireNode (fixed with webPreferences options in mainWindow) the app rendered index.html file. But a problem with app location happens again right on {{ content-for "body" }} in index.html: "Uncaught Error: Cannot find module 'app-name/app'" where app-name is the application name set up as 'name' in /package.json and as 'modulePrefix' in config/environment.js. The error itself comes from /node-modules/ember-cli/lib/utilities/ember-app-utils.js, 'contentFor' function called with 'app-boot'. The ember-cli itself constructs the /app-name/app path. So, the question now is what exactly ember-cli expects to find during the boot with the new structure? Or maybe some config variable should be added to let know Ember about the /app-name/app location?
Edited:
jacobq, yes, the only difference in index.html is application name: "testapp". RootURL is set in ../testapp/config/environment.js:
podModulePrefix: 'testapp/pods',
environment,
modulePrefix: 'testapp',
rootURL: process.env.EMBER_CLI_ELECTRON ? '' : '/',
locationType: process.env.EMBER_CLI_ELECTRON ? 'hash' : 'auto',
The full error:
It happens when testapp.js file is called from index.html, on code included from ember-cli:
if (!runningTests) {
require("testapp/app")["default"].create({"LOG_TRANSITIONS":true,"LOG_TRANSITIONS_INTERNAL":true});
}
First thing I'd like to plug is joining the #topic-desktop channel on the Ember.js community Discord server: https://discord.com/channels/480462759797063690/488735754139336714
(it's often easier to work things out by chatting there as there's lower latency than typically found with forum post/reply platforms)
Secondly, there are lots of breaking (but good) changes between ember-electron 2.x and 3.x, so I'd encourage you to work through the upgrade guide here: https://ember-electron.js.org/docs/guides/upgrading
That said, I suspect that the problem you're seeing is related to the change from serve:// to file://. Have a look at the demo app I just spun up here:
https://github.com/jacobq/ember-electron-demo
You can see the new emberAppURL here:
https://github.com/jacobq/ember-electron-demo/blob/cf7c5dee2cd975f8c67ed1dfc61eb717461f5b7d/electron-app/src/index.js#L13
Basically, ember-electron v3.x puts the usual dist output from ember build into <project_root>/electron-app/ember-dist/ now.
FWIW, I'm actually stuck on 3.0.0-beta.2 in my application because I am using IndexedDB and don't have migration code to deal with origin-related issues of switching to file:// scheme. I don't recommend that you use that version, but you could try it if you wanted to see if that changes the error you're encountering (because that beta still uses electron-protocol-serve).

How to resolve error #95313 when building a gatsby site?

I have finished working on my gatsby project, but I have problem when trying to build. I got this #95313 error. I do not have any errors in project.
ERROR
Page data from page-data.json for the failed page "/success/": {
"componentChunkName": "component---src-pages-success-index-tsx",
"path": "/success/",
"result": {
"pageContext": {}
},
"staticQueryHashes": []
}
failed Building static HTML for pages - 1.268s
ERROR #95313
Building static HTML failed for path "/success/"
See our docs page for more info on this error: https://gatsby.dev/debug-html
WebpackError: TypeError: Cannot read property 'store' of null
- useSelector.js:126
[my-gatsby-site]/[react-redux]/es/hooks/useSelector.js:126:1
- index.tsx:13
webpack:/my-gatsby-site/src/pages/success/index.tsx:13:42
- static-entry.js:286
webpack:/my-gatsby-site/.cache/static-entry.js:286:22
- stylis.esm.js:74
[my-gatsby-site]/[#emotion]/stylis/dist/stylis.esm.js:74:1
How can I resolve it? Thank you for your help.
I guess the problem is that you are using wrapRootElement wrapper in your gatsby-browser.js while you need also to use it in the gatsby-ssr.js because it's a shared API.
Note: There is an equivalent hook in Gatsby’s SSR API. It is
recommended to use both APIs together. For example usage, check out
Using redux.
I've made a PR that should fix it: https://github.com/Dovtutis/playEverywhere/compare/main...fbuireu:patch-1

Lucee- invalid component definition for custom tag

I'm working on a Lucee application that makes heavy use of custom tags.
My structure is as follows:
Calling app file - C:\lucee\tomcat\webapps\web-portal\web-champs\index.cfm
Location of file I'm calling - C:\lucee\tomcat\webapps\empportal\Champs\CFC\invoice.cfc
I've defined a custom tag in the Lucee admin with a name of empportal and resource of C:\lucee\tomcat\webapps\empportal\ (also tried without a trailing \). I restarted the server after adding the custom tag.
Error message
invalid component definition, can't find component [empportal.Champs.CFC.invoice]
Stacktrace
The Error Occurred in
C:\lucee\tomcat\webapps\web-portal\web-champs\dsp_outstandingInvoices.cfm: line 1
1: <cfinvoke component="empportal.Champs.CFC.invoice" method="getOutstandingItems" org_ID="#session.orgID#" returnvariable="getOutstandingItems" />
I also tried creating the component using new empportal.Champs.CFC.invoice() and same issue.
In Lucee you need to place files in the ROOT\ folder so tomcat can load them. In my case moving the folders to C:\lucee\tomcat\webapps\ROOT\ instead of C:\lucee\tomcat\webapps\ and restarting fixed the issue.

QWebView - Error 400 when giving url

I'm trying to build a little application that needs to run the url that is generated by the script at this link: http://blogs.aws.amazon.com/security/post/Tx70F69I9G8TYG/How-to-enable-cross-account-access-to-the-AWS-Management-Console
The application is build with Qt4 and Pyqt4. I create a QWebView and want to load the url that is generated at the end of the script in the link inside the webview.
url = QUrl(ConnectionScript.generateURL())
self.webView.load(url)
self.webView.show()
but this code gives me a "HTTP Status 400 - BadRequest" error. I've tried to change the "load" with "setUrl" but there is no change.
The useful code is only this, other lines are just setting up the GUI (and it's doing fine). Any suggestion about how to fix this and what might the problem be? I think it's something very easy to fix but i can't do it right...
Edit1: i forgot to mention that when i open the generated link in a web browser (like chrome or firefox) all goes well and it gives me no such error
Found out that the problem was this line of code:
request_parameters += urllib.quote_plus("https://console.aws.amazon.com/")
The quote_plus encoded : / so the webView load couldn't process the url in the right way.
Just don't use the urllib.quote_plus method and everything will go as expected.

Weird conflict with deploy of django project with django_assets

recently I've tried to add webassets to my django project. All goes without any problem in development (with django runserver). All js and css are beign compressed when I set the settings var ASSETS_DEBUG to False.
The problem arises when I browse my project from my deployed structure (apache + mod_wsgi). An exception is raised from django_assets giving me the following message:
RegisterError: Another bundle is already registered as "js_all": ], contents=('js/jquery-1.6.3.min.js', 'js/jquery-ui-1.8.16.custom.min.js', 'js/jquery-ui-timepicker-addon.js', 'js/ui.datepicker-es.js', 'js/tiny_mce/tiny_mce.js', 'js/tiny_mce_config.js', 'js/public.js')>
Can't find the reason for this exception, not thrown in development. Following is my assets file:
from django_assets import Bundle, register
js = Bundle(
'js/jquery-1.6.3.min.js',
'js/jquery-ui-1.8.16.custom.min.js',
'js/jquery-ui-timepicker-addon.js',
'js/ui.datepicker-es.js',
'js/tiny_mce/tiny_mce.js',
'js/tiny_mce_config.js',
'js/public.js',
filters='yui_js',
output='js/gen/packed.js'
)
register('js_all', js)
css = Bundle(
'css/smoothness/jquery-ui-1.8.16.custom.css',
'css/jquery_ui_fixes.css',
'css/public.css',
'css/forms.css',
filters='yui_css',
output='css/gen/packed.css',
)
register('css_all', css)
Webassets version used is the one in pip repository:
version = (0, 6)
I hope that somebody will be able to help me.
Isaac
Because of some silliness with Django, your settings.py file can be imported twice. Thus registration will occur twice. Read:
http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html
for all the horrible details of this issue.