Drupal - Load CKeditor with Simplified Toolbar on dynamically created page element - drupal

Drupal 6 ckeditor 3.6.4
I have page that loads the text area dynamically, so I am using
CKEDITOR.replace('textarea-id');
Which works, but it is bringing in the full toolbar. I would prefer that the simplified toolbar is used, but it would also be acceptable to use the toolbar I have defined if loading the simplified is not possible. Least desirable would be to hard-code the toolbar, but I consider that a last resort. How do I accomplish this?
I have tried
CKEDITOR.replace('textarea-id',
{
toolbar : 'myprofile'
});
Which throws js error: Type x is undefined , I think related to the fact that it cant load the profile. Suggestions?

For better or worse, this is how I did it:
http://joe-riggs.com/blog/2012/11/drupal-ckeditor-load-configuration-settings-on-dynamic-page/

Related

Ace Editor does not work in Iframe (react-frame-component)

tl;dr Demo of Issue
I'm attempting to integrate Ace Editor in an iframe via React 16. I am using the react-ace component library, though this issue exists if I implement the editor natively as well.
Although everything mostly works when I wrap the editor in react-frame-component, I cannot select highlight text which makes the editor unusable. I suspect this may have to do with the fact that react-frame-component is implemented with Portals, but I'm not sure exactly what the issue is.
I've replicated the issue here. I don't think this problem exists if I loaded the component with a regular <iframe src /> from another domain.
react-frame-component keeps the code in the parent window, and adds elements into an iframe, which confuses mouse handling code in ace to add event listeners to a wrong document
adding var document = el.ownerDocument before
https://github.com/ajaxorg/ace/blob/v1.4.10/lib/ace/lib/event.js#L111 would help.

Edit is missing and Add Item not working in 2sxc 9.32.1 on DNN EVOQ BASIC v. 09.01.01

Just upgraded to DNN EVOQ BASIC v. 09.01.01 (113) and 2sxc 9.32.1
After placing the Content module on a page, some of our templates do not have Edit options and some of them that have an Add Item option doesn't do anything after clicked.
When I click on Add Item, I get this error:
Uncaught SyntaxError: Unexpected token T in JSON at position 0
at JSON.parse (<anonymous>)
at Object.t.showDetailedHttpError (ToSic.Sxc.Instance.ts:73)
at fire (jquery.js?cdv=209:1037)
at Object.fireWith [as rejectWith] (jquery.js?cdv=209:1148)
at done (jquery.js?cdv=209:8076)
at XMLHttpRequest.callback (jquery.js?cdv=209:8598)
This sounds like a skin / container compatibility issue, the "content module" you mention, is this the core text / html module or something else?
As a test, change the page skin and or module container to one that comes with the core 9.1.1 install and retest
DC
I don't know for sure what's happening, but let me give you a bit of background. When an editor is on the page, 2sxc adds some configuration information as json in the html-attributes, which the UI the needs to know what you were clicking on etc.
To me it sound like something is breaking this - either because a server-side filter is changing the HTML (not likely, but possible), or another javascript is running which changes the DOM, resulting in removed or broken attributes.
To get this resolved, pls verify that you can find these jsons in the html-tags (they are very obvious) by looking at the html-source. If they are there and look ok, it's not the server that's breaking it.
Then check if they are still there in Chrome-Debugger (F12) which doesn't show you the source as the server sent it, but the source as the browser currently has it. I'm pretty sure it will be off somehow, because maybe a neat jQuery mangles the HTML.
Love from Switzerland,
iJungleboy

resource.id doesn't contain a definition for button and Layout

I created an Android project on Xamarin and added a button in the layout but I'm having this error of Resource.Id doesn't contain a definition for Button when i create the button using FindViewById in the Activity. Despite giving the an id to the button and layout using (android:id="#+id/btnShow"), I'm still having the error. I checked the Resource.Designer but could not find the aapt for the button.
Another issue that I faced is when I created a layout, gave it and defined it in an activity but the Resource.layout doesn't contain a definition for the layout.
However, other buttons and layouts can be defined in my activities
Actually this problem occurs when your ResourceDesigner.cs file has not yet mapped the file that you added to your resource directory(Xamarin Bug). The easiest way i would suggest to handle this situation is you comment the code you are trying to write and clean build your project and it will work like a charm. Good luck!

Lightbox Display Loading Box at End of Page

I'm using Lightbox for the first time, and it's working for my images. However, for some reason, I get a strange box at the end of my page that shows the loading icon, even though there shouldn't be an image there.
The image: http://i.imgur.com/ACImB.png
Upon inspecting the element, I get the following HTML code.
<div id="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image"><div class="lb-nav"><a class="lb-prev"></a><a class="lb-next"></a></div><div class="lb-loader"><a class="lb-cancel"><img src="/z/styles/images/loading.gif"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"><img src="/z/styles/images/close.png"></a></div></div></div></div>
The strange part about this code is that I didn't make that div, it seems to have just been inserted by the script. Does anyone know what this might be and how to get rid of it?
This could easily be a problem with your css or script path.
If you look at the lightbox2 demo it displays that loading page you see and then removes it to display the loaded image. When either the javascript or stylesheets are not correctly linked it will not work properly.
Lightbox2 site: http://lokeshdhakar.com/projects/lightbox2/
You can try using (in chrome, for firefox there's firebug) right-click inspect element, go to the resources tab and expand the frames boxes until you see all the images, scripts and style sheets in a list. It'll let you know if one of them can't be found.
I had the same issue when I integrated Lightbox with an MVC site. The issue was I had referred both lightbox.js and lightbox.min.js files. I fixed the issue by removing one reference.

Increase size of Facebook Like Button

I am developing a feature where I want to increase the size(width and height) of Facebook Like button which is getting rendere on my page.
I have tried overidding the css but it is not working as my css is loading very late.
Help required.
Are you sure you're using the correct overrides in your CSS? If I'm not mistaken, it doesn't matter when the CSS is loaded, just that it is loaded.
Be sure to check your CSS includes in the header file to make sure you're using the latest version. Also double check the classes or ids you need to override.
Perhaps you could post the code containing the like button you're trying to manipulate. If you're loading it in via Javascript you can use Firebug or other Web Inspectors to find out the actual HTML that gets inserted.
First of all, the css MUST be interpreted by the browser before the html element it refers to is loaded...
Second, the reason you can't select the button through CSS directly, is because it is rendered inside an iFrame that is controlled by the Facebook framework (you can check this out with firebug or any other inspector).
I'm not sure if it's feasible, but you have two possible ways to do it:
use javascript and the DOM to access inside that iFrame, select the button and style it.
create a button yourself, and give it the same href as the one generated originally, thus losing the fan-counter capabilities and whatever else is part of their framework

Resources