How to use bootstrap accordion in fullpage.js - accordion

I wanna use an accordion inside a fullpage.js section
but it doesn't work
$('#fullpage').fullpage({
navigation: true,
navigationPosition: 'right',
responsiveSlides: false,
//does not work
lockAnchors: true,
});
//strange, it works but I get a js error -> fullpage_api is not defined
fullpage_api.setLockAnchors(true);

Related

Adding Placeholder

tinymce.init({
mode: "exact",
elements: "Grievance",
forced_root_block: "",
theme: "advanced",
paste_text_sticky: true,
paste_text_sticky_default: true,
plugins: "wordcount,paste,autolink,advlink,contextmenu,fullscreen,nonbreaking,template,inlinepopups,style",
//plugins: "wordcount,paste,autolink,advlink,fullscreen,nonbreaking,template,inlinepopups,style",
// Theme options
//theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,undo,redo,|,justifyleft,justifycenter,justifyfull,|,link,unlink,|,fullscreen",
//theme_advanced_buttons2: "cut,copy,paste,|,cleanup,removeformat,|,bullist,numlist,outdent,indent,hr,charmap",
//theme_advanced_buttons1: "cut,copy,paste,removeformat,|,undo,redo,|,bullist,numlist,outdent,indent,|,formatselect,bold,italic,underline,forecolor,backcolor,|,justifyleft,justifycenter,justifyfull,|,link,unlink,|,fullscreen",
theme_advanced_buttons1: "cut,copy,paste,removeformat,|,undo,redo,|,bullist,numlist,outdent,indent,|,bold,italic,underline,|,fullscreen",
//theme_advanced_blockformats: 'p,h1,h2,h4,h4,h5,h6',
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
//theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing: true,
theme_advanced_path: false,
content_css: "/css/admin.css",
selector: 'textarea', // change this value according to your HTML
setup: function (editor) {
editor.on('init', function(){
if (tinymce.get('Text').getContent() == ''){
tinymce.get('Text').setContent("<p id='#Grievance'>Please put Case Information here</p>");
}
});
//and remove it on focus
editor.on('focus',function(){
$('iframe').contents().find('#Grievance').remove();
});
}
});
I am trying to add a Placeholder but I am getting "editor.on is not a function" so how do I add a place holder please without going to version 5 as that seems to be completely different. Thanks
I managed it in the end using Blur and Focus. Thanks

Multiple TinyMCE Instances - Unable to Use "Get" Method

I have initiated two instances of the TinyMCE editor on the same webpage...shown below.
tinymce.init({
selector: '#post-content',
placeholder: 'Type your post here...',
elementpath: false,
resize: false,
plugins: '',
toolbar: '',
menubar: '',
});
tinymce.init({
selector: '.post-comment-form-input',
placeholder: 'Type your comment here...',
elementpath: false,
resize: false,
height: "100",
plugins: '',
toolbar: '',
menubar: '',
});
When I execute a command on the first instance, it all goes just fine (shown below).
$('btn').click(function() {
tinyMCE.get('post-content').setContent('');
});
However, when I execute a command on the second instance, I get the following "Cannot read property 'setContent' of null".
$('btn').click(function() {
tinyMCE.get('post-comment-form-input').setContent('');
});
Both TinyMCE editors show just fine on the webpage, so I know they are initializing properly. It's just when I try to use a command on that second instance it doesn't work. I have tried including a period in the 2nd function since it's a class, but that doesn't work either.
Thank you.
The tinymce.get() requires you to pass the ID of the HTML element. Based on your init() sections the second selector is using a CLASS which is not valid for the tinymce.get() API.

ngJsTree Checkbox is not visible

I use ngJSTree first time.
I cannot see checkboxes. In Browser I see style as follows when examine html element:
<a class="jstree-anchor jstree-clicked" href="#" tabindex="-1" id="21_anchor">
<i class="jstree-icon jstree-checkbox" role="presentation"></i>...
Controller uses checkbox plugin:
plugins : ['types','themes', 'checkbox'],
checkbox : {
"override_ui": true,
"real_checkboxes": true,
"keep_selected_style" : false,
"visible": true
}
I use css from jstree.dist.themes.default.
JsTree should be easy to use.
Do I miss some part of configuration?
Problem was in my build environment. Just add file 32px.png to the same folder as the file style.css. Then it worked.

How to allow custom uppercase tags in TinyMCE

Does anyone know how to allow having custom uppercase tags in TinyMCE? It seems that TinyMCE doesn't like uppercase tags, even though they have been declared as valid. Here is my TinyMCE config:
tinyMCE.init({
mode: "specific_textareas",
theme: "advanced",
language: "en",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_buttons1: "bold,italic,|,sub,sup,|,charmap,|,table,|,code",
theme_advanced_path: false,
theme_advanced_resizing: true,
plugins: "fullscreen,paste,table",
paste_auto_cleanup_on_paste : true,
relative_urls: false,
width: "300",
height: "300",
theme_advanced_resizing_min_height : "10",
force_br_newlines : true,
force_p_newlines : false,
forced_root_block : '',
entity_encoding: "raw",
valid_elements : "B/strong,I/em,SUP/sup,SUB/sub",
extended_valid_elements: "CUSTOM"
})
Typing something like
<CUSTOM>this is a custom tag</CUSTOM>
doesn't work because <CUSTOM> gets stripped off.
If I change the init script to extended_valid_elements: "custom", then it works fine - I can type
<custom>this is a custom tag</custom>
and the <custom gets preserved.
Doesn't anyone know any workaround?
Thanks!
Here is a description of how to do that (the reverse works analogue): http://www.codingforums.com/archive/index.php/t-148450.html
You should use the tinymce onInit event and to change the tags back to Uppercase use onSubmit or onSave (alternatively you may change the content back before submitting your content on any other suitable location of code).
To add this handlers use the tinymce setup configuration parameter
setup : function(ed) {
ed.onInit.add(function(ed, evt) {
$(ed.getBody()).find('p').addClass('headline');
// get content from editor source html element
var content = $(ed.id).html();
// tagname to lowercase
content = content.replace(/< *\/?(\w+)/g,function(w){return w.toLowerCase()});
ed.setContent(content);
});
ed.onSubmit.add(function(ed, evt) {
$(ed.getBody()).find('p').addClass('headline');
// get content from edito
var content = ed.getContent();
// tagname to toUpperCase
content = content.replace(/< *\/?(\w+)/g,function(w){return w.toUpperCase()});
// write content to html source element (usually a textarea)
$(ed.id).html(content );
});
},

fancy box doesnt work when clicked second time

here is the code i used
eventClick: function(event) {
$.fancybox({
'transitionIn': 'none',
'transitionOut': 'none',
'href': event.url,
});
return false;
},
............
when i click it for the first time it opens fine in a fancybox but when i click again it moves to a new page (event.url).Also there is tooltip being used and it goes null after the fancybox is opened for the first time
Use the following code to open Fancybox with url. It should work.
$('a.yourAnchor').fancybox({
'overlayColor': '#fff',
'autoDimensions': true,
'hideOnContentClick': false,
'scrolling': false
});