concrete5 ccm_activateTabBar() not defined when not logged in - javascript

I have a specific question, I did build a component with tabs in concrete5 v8 with this tutorial:
Creating tabbed panels in concrete5
It worked just fine, as long as I was logged in into concrete5, as soon as I am not logged in I get the following error in the console, and therefor I'm not able to click on the different tabs:
Uncaught ReferenceError: ccm_activateTabBar is not defined
at HTMLDocument. (entsorgung-von-abfaellen:84)
at j (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at Function.ready (jquery.js:2)
at HTMLDocument.J (jquery.js:2)
The error references to this part of the line 84:
<script type="text/javascript">$(function() { ccm_activateTabBar($('#ccm-tabs-1077221103'));});</script>
which follows directly after the ul element and seems to got generated by concrete5.
I was not able to find anything related at all, I guess it has something to do with missing assets that are only loaded when logged in as administrator.
I'm currently only loading the following assets when not logged in:
$u = new User();
if(!$u->isLoggedIn()) {
$this->requireAsset('javascript', 'jquery');
$this->requireAsset('jquery/ui');
}
Maybe someone already worked with the concrete5 tabs and can help me with this error.

Ass suggested by Michele Locati, you should probably use jquery/ui or bootstrap components to build you tab component.
But if you find yourself in the same situation as I was, a very simple fix is to copy the tabs.js from
concrete/js/build/core/app/tabs.js
to your theme folder and include it if the user is not logged in.
For example like this:
<?php
$u = new User();
if(!$u->isLoggedIn()) : ?>
<script src="<?php echo $view->getThemePath(); ?>/js/c5_tabs/tabs.js"></script>
<?php endif; ?>
The tabs.js is part of app.js which is quite big, so I only used tabs.js, which only contains the needed function I was missing.
Credits for this information to MrKDilkington from the concrete5 forum:

Related

react-monaco-editor blackout... TypeError: Cannot read property 'pushUndoStop' of undefined

I use "react-monaco-editor" for my project.
import { MonacoDiffEditor } from 'react-monaco-editor';
...
<MonacoDiffEditor
width="1140"
height="520"
language="javascript"
theme="vs-dark"
original={this.props.original}
value={this.props.current}
options={{
renderSideBySide: true,
}}
editorDidMount={this.editorDidMount}
/>
This error can only be viewed after deploy my server.
simpleWorker.js:25 Could not create web worker(s). Falling back to
loading web worker code in main thread, which might cause UI freezes.
Please see https://github.com/microsoft/monaco-editor#faq el #
simpleWorker.js:25 simpleWorker.js:28 You must define a function
MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker el #
simpleWorker.js:28 react-dom.production.min.js:5058 TypeError: Cannot
read property 'pushUndoStop' of undefined
at l.value (diff.js:283)
at ls (react-dom.production.min.js:5163)
at react-dom.production.min.js:6408
at t.unstable_runWithPriority (scheduler.production.min.js:309)
at Ui (react-dom.production.min.js:2816)
at Cl (react-dom.production.min.js:6204)
at cl (react-dom.production.min.js:5895)
at react-dom.production.min.js:2851
at t.unstable_runWithPriority (scheduler.production.min.js:309)
at Ui (react-dom.production.min.js:2816) rs # react-dom.production.min.js:5058
I test in local with nginx, but only serviceWorker warnings logged.
I think that ServiceWorker warnings are http environment in my server.
What is pushUndoStop... I really don't know this error.
help me...
Not sure if you fixed this issue or not by now, since it has been a while, but in case anyone else lands here, I got this issue too. I had v0.20.0 of monaco-editor and v0.35.0 react-monaco-editor which worked fine. Then I updated to v0.23.0 and I ran into this issue as a regression. I then tried v0.25.2 with no change. After that I tried updating react-monaco-editor to the v0.43.0 and the problem stopped happening! I'm thinking it is an issue where they made a change in monaco-editor and if you didn't update react-monaco-editor to a newer version it would break with that error.

For WordPress element editor frontend.min.js And jquery.min.js conflict

For WordPress element editor frontend.min.js And jquery.min.js conflict.
Error message:
Uncaught TypeError: e.elementorWaypoint is not a function
at Frontend.waypoint (frontend.min.js:2)
at Counter.onInit (frontend.min.js:2)
at Counter.Module.trigger (frontend-modules.min.js:2)
at Counter.e.each.r.<computed> [as trigger] (frontend-modules.min.js:2)
at init (frontend-modules.min.js:2)
at Counter.Module (frontend-modules.min.js:2)
at Counter.child [as constructor] (frontend-modules.min.js:2)
at new child (frontend-modules.min.js:2)
at Counter._createSuperInternal (frontend.min.js:2)
at new Counter (frontend.min.js:2)
Introduce and introduce local via Google CDN jQuery.js It's not all right.It also tried to replace $JQ with JQ, which did not help.I need help and time is running out.
error message images

Uncaught Error: Graph container element not found

I saw answer "JavaScript's code gets executed before the DOM contains #annual element. Put the javascript after the div or use jQuery.ready()" But I don't know to put after what div?
<script src="/bower_components/morris.js/morris.min.js"></script> this is script include?
enter image description here
error:
Uncaught Error: Graph container element not found
at d [as constructor] (morris.min.js:6)
at d.c [as constructor] (morris.min.js:6)
at new d (morris.min.js:6)
at HTMLDocument.<anonymous> (dashboard.js:129)
at j (jquery.min.js:2)
at k (jquery.min.js:2)
If you are using adminLte template in an angular project, you have to delete the import dashboard.js from the scripts array in angular.json file.
i confirm resolution :
im using AdminLTE in angular :
delete the import dashboard.js from the scripts array in angular.json file.

Including Angular-UI-Validate in my project

The project uses Angular 1.3 (from a CDN, links removed below) and I'm trying to install Angular-UI-Validate. I have included both in script tags, and in the inspector, I can see that they're both getting retrieved correctly. Still, it seems as if I'm missing something:
Error: [$injector:unpr] http://errors.angularjs.org/1.3.10/$injector/unpr?p0=ui.validateProvider%20%3C-%20ui.validate%20%3C-%20app.runtimeStackAdminController
at Error (native)
at https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:6:417
at https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:38:307
at Object.d [as get] (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:36:308)
at https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:38:381
at d (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:36:308)
at e (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:37:64)
at Object.g.instantiate (https://l***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:37:213)
at b.$get (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:76:318)
at $route.link (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular-route.js:981:26) <div id="ng-view-wrapper" class="container-fluid ng-scope" ng-view="" autoscroll="true">
Am I missing a library that I have to include? Thanks in advance!
You need to load the ui.validate module.
See https://github.com/angular-ui/ui-validate#usage for all instructions.

Issues Integrating ACE Editor with Keystonejs App

It says here(http://ace.c9.io/#nav=embedding) just copy one of src* subdirectories somewhere into your project
I have put it in mykeystoneapp/public/js(my default home is mykeystoneapp/public)
Here are the errors I get:
1.Uncaught TypeError: $.cookie is not a function(ui.js:8)
2.Uncaught Error: Missed anonymous define() module: function …(require.js:141)
http://requirejs.org/docs/errors.html#mismatch
Here is my Jade code:
script(src='/js/ace/demo/kitchen-sink/require.js')
script.
require.config({paths: {ace: "/js/ace/build/src"}});
define('testace', ['ace/ace'],
function(ace, langtools) {
console.log("This is the testace module");
var editor = ace.edit("editor_container");
editor.setTheme('eclipse');
editor.session.setMode('javascript');
require(["/js/ace/lib/ace/requirejs/text!src/ace"], function(e){
editor.setValue(e);
})
});
require(['testace']);
Secondly if I put debugger in EventEmitter(https://github.com/ajaxorg/ace-builds/blob/master/src/ace.js#L3300)
I can see it’s properly reaching EventEmitter._dispatchEvent with
eventName=‘changeMode’ but it returns without any operation as there are no !listeners or defaultHandler
editor.session.setMode('javascript'); is wrong, it should be editor.session.setMode('ace/mode/javascript'); instead. Same for theme which is supposed to be ace/theme/eclipse.
error in ui.js is not related to ace, since ace doesn't have a file named ui.

Categories

Resources