FCKeditor is not working with codeigniter - codeigniter

I am new to Codeigniter. I am developing an application; for that I need to integrate FCKEditor with codeigniter. I tried it but it is not working. I am getting the an error like this - please help me. I tried as said in http://bagoesseptian.blogspot.in/2009/07/make-fckeditor-plugin-in-codeigniter.html
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$Fckeditor
Filename: admin/events.php
Line Number: 5
Fatal error: Call to a member function Create() on a non-object

This doesn't seems to be a good way. Try this way:
Steps:
1.Download CKEditor from http://ckeditor.com/download
2.unzip it in index directory of codeigniter
3.Use this syntax in header:
<script type="text/javascript" src="<?php echo $this->config->item('base_url'); ?>/ckeditor/ckeditor.js"></script>
4.Use this in body where you want to place editor:
<textarea name="n_notification" id="n_notification"></textarea>
5.Use this to initiate:
<script>
$(document).ready(function() {
CKEDITOR.replace( 'n_notification');
}
</script>
You can refer http://dwij.co.in/ckeditor-ckfinder-integration-using-php/ to integrate CKEditor with CKFinder(File Browser) if you want image uploader.

Related

How to fix ckeditor error after php artisan make:auth

I am working on a Laravel project using ckeditor. All was working fine with the editor and no errors in the console until I ran:
php artisan make:auth
The project login/register then worked but the editor was not displaying with the error in the console:
Uncaught TypeError: a.ui.space(...) is null
I tracked it down to the line added to the app.blade.php file during the auth build:
<script src="{{ asset('js/app.js') }}" defer></script>
If I remove defer the editor comes back but I now get the console error:
[Vue warn]: Cannot find element: #app
I have seen quite a number of posts regarding the editor error but they not helping me get the root of the issue. Any ideas how to fix the error correctly?
I think the problem is that the script is executed before the DOM element is loaded in the DOM. Or you've placed it before the target element and then when the script calls, it cant find the element.
So you could place the script in a load event handler, something like this:
window.onload = function () {
// your script here
}
window.addEventListener('load', function () {
// your script here
}

sweetalet2 commonJS basic example

I struggle to make a very simple commonJS usage:
const Swal = require('sweetalert2');
Swal.fire('Hello world!');
What's wrong with it?
if I run the code, nothing happens, no error it thrown either.
You cannot use require() on browser/client-side JavaScript.
You need to grab SweetAlert2 from jsdelivr CDN by adding the following in your index.html
<script src="//cdn.jsdelivr.net/npm/sweetalert2#10"></script>
Then you can just run your JS
Swal.fire('Hello world!');
CodePen:
https://codepen.io/ahandsel/pen/QWGrOya
Reference:
Client on Node.js: Uncaught ReferenceError: require is not defined

How to use vuejs with laravel after removing public from laravel Url?

I have removed public from my Laravel project url. But now my Vue.js is not working.
If I remove public from src file it's not recognizing that project has Vue.js, but if I add public it's recognizing that this project has Vue.js. But it's not showing that component on my Blade page, instead of it it's giving me this error:
[Vue warn]: Unknown custom element: <app-some> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
My Blade file:
<div id="app">
<app-some> </app-some>
</div>
<script src="{{asset('public/js/app.js')}}"></script>
app.js file:
Vue.component('appSome', require('./components/some.vue').default);
"[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option."
It occurs when components are not registered within the "app.js" file. In the Vue instance, try adding this
new Vue({
components: {
appSome: some
}
});
Of course you also have to import the component.

Uncaught Highcharts error #16: www.highcharts.com/errors/16

I am using highcharts.js lib in my project,I am getting the error as Uncaught Highcharts error #16: www.highcharts.com/errors/16.
I know that the error comes due to lib is loaded twice,but I need help that how I avoid this situation.
Basically I am using ajax request for getting the html response from .jsp file.
Scenario:
1.I have tree from d3.js where I am clicking on the tree node at that time I am sending the ajax request and getting whole page of html response,in that I have included the highchars.js lib
2.Right now I am on my product dashboard page,and right now I am clicking on back button which having ajax request,and after that again I am clicking on tree node which gives me my product dashboard page in this situation I am getting error as
Uncaught Highcharts error #16: www.highcharts.com/errors/16.
can anybody help me to overcome this situation.
Thanks,
Nandu.
This error happens the second time Highcharts or Highstock is loaded in the same page.
It means you should not include/load highchart.js file again.
I have simple solution over this, and this is working fine for me.
while sending ajax request pass some variable like 'call'
$.ajax({
url: "http://www.YourUrlHere.php?key=234&call=ajax",
success: function(result){
$('body').html(result);
}
});
And while you include/load highchart.js files check if this variable is set or not, if it is set then don't include/load this files again.
(belove example is for PHP)
<?php if(empty($_GET['call'])){ ?>
<script src="assets/Highcharts/code/highcharts.js" type="text/javascript"></script>
<script src="assets/Highcharts/code/modules/exporting.js" type="text/javascript"></script>
<?php } ?>

Cannot install converseJS properly in Laravel 5

I am working on an application where I am trying to get the chat feature working by using the ConverseJS XMPP client on the front end and Openfire RTC on the back end.
I am working with Laravel 5 on the back end, and being the naive developer I am, I placed the files in the public folder and linked the JS and CSS file to the webpage.
<link rel="stylesheet" type="text/css" media="screen" href="/converse/css/converse.min.css">
<script src="/converse/builds/converse.min.js"></script>
It is working in Firefox and I can see the chat pluigin but in Chrome. The error I see in the console is:
Uncaught Error: See almond README: incorrect module build, no module
name
I am not sure what is causing this. Placing the files in the public folder and linking it to the pages, is this the right way? Or do I have to do something extra in Laravel 5 to get it running?
You receive this error because conversejs uses Almond as a AMD loader and it cannot handle modules without a name.
For example this will trow the error you mentioned:
$(function(){
...
});
So you should use something like this instead:
jQuery(function($){
...
});
More info here
Try to put the conversejs script last and wrap the code for jQuery plugins as mentioned before.

Resources