Add dynamycli parametr in CKEDITOR - ckeditor

I use CKEDITOR 4, in my ls:
CKEDITOR.replace('ae-textarea-text', {
filebrowserImageUploadUrl: '/Sites/UploadImgToSite?Site=' + $("#SiteName").val(),
height: 850,
width: 800
});
When I upload a images, parametr Site=' + $("#SiteName").val() - is empty, because
1) page open
2) CKEDITOR init with $("#SiteName").val() (now it empty)
3) user fill texbox #SiteName....

That parameter has to be available before CKEditor creation code is executed because it is no longer possible to change that parameter dynamically afterwards. It can only be set once when editor is created.
In your case you could try opening the page, getting siteName from user and only then creating the editor.

Related

Oracle Apex button click it will open new window

Oracle Apex 5.1, once click the button it will open new window its possible?, any one please provide the sample code
Use the below code
javascript:window.open('f?p=&APP_ID.:1:&SESSION.:::1:P1_ID:'+$v("P844_ID")+','_blank');
In dynamic action : create an on click DA that executes JS
var rowid= this.triggeringElement.id;
vUrl = apex.util.makeApplicationUrl({
//appId: $v("pFlowId"), // default is $v("pFlowId") - current app
pageId:10, // default is $v("pFlowStepId") - current page
//session: $v( "pInstance" ), // default is $v("pInstance") - current session
// request: 'TEST_REQUEST', // default is $v("pRequest") - current request
//debug: 'YES', // default is $v("pdebug") - debug YES/NO
itemNames:['P10_SHP_APPLICATIONS_TBL_ROWID'],
// item names array (no value by default)
itemValues:[rowid] // item values array (no value by default)
//printerFriendly: 'YES' // no value by default
});//console.log(vUrl);
window.open(vUrl);
LMGTFY - Did you try the following
APEX open URL in new window
javascript:window.open('f?p=&APP_ID.:3002:&SESSION.:::3002:P3002_CPY_ID,P3002_RPM_ID,P3002_ACM_ID, P3002_FORMAT,P3002_REPORT_PAGE_NO:'+$v("P1977_CPY_ID")+','+$v("P1977_RPM_ID")+','+$v("P1977_ACM_ID")+',VIEW,1977','_blank');
Use the above code
Click the button and create the dynamic action and select Execute Js and paste the query.. pass the parameter and page no everything.. then try
Flow below step
Go to Button
Go to button Behavior
Action : Redirect to URL
javascript:window.open('f?p=&APP_ID.:1:&SESSION.::NO:1:P1_PID:'+$v("P2_PID")+'');

How to expand math field in CKEditor

Math formula field is small.
This is default behavior of the Latex plugin. Can the field can be expanded? If yes, then how can I do that?
I have browse to fix this solution but none of them match with what I want. Anyone know how to expand it?
This is the screen shot:
UPDATED
return{title:b.title,minWidth:1000,minHeight:650,contents:[{id:"info",elements:[{id:"equation",type:"textarea",rows:10,label:b.dialogInput, ..
Note: I can expand the dialog display but I cannot expand the textfield formula form. It seem like the variable rows not functioning.
Should I declare the variable rows in other file?
You can edit the code that displays this dialog.
In your ckeditor folder, under the /plugins/mathjax/dialogs/ folder, open the mathjax.js file.
To make the dialog wider change the minWidth attributes. For example, to set the width to 750 pixels:
return {
title: lang.title,
minWidth: 750,
minHeight: 100,
contents: [
To add more lines to the formula textbox, add the rows attribute with the number of lines you want (the rows attribute is not there by default so add it). For example, to make the textbox 10 lines long:
elements: [
{
id: 'equation',
type: 'textarea',
rows: 10,
label: lang.dialogInput,
Here's a screenshot with the above changes:
Save the file and clear your cache before testing.

jQuery UI Multiselect Widget With Images (Eric Hynds Version)

The excellent dropdown jQuery UI Multiselect widget that supports styling via jQuery UI Themeroller still doesn't have support for including images within the drop down rows.
I didn't see any answers to this problem within Stackoverflow yet it seems to be asked regularly in various areas of the internet, so I am giving the answer to this question below..
(ALSO See my FIDDLE Example to see this in action,)
The following is based on an initial idea by 'pdlove' for introducing the use of images within this excellent UI Multiselect for jQuery.
Adding Image support for line items in check box text area is achieved by setting out the selector option rows html like this:
<option value="somevalue" image="yourimage.jpg" class="multSelktrImg">
normal visible text
</option>
I would also add a class control to your style sheet css file to set the image size being rendered in the option line items of the drop down, along with a couple of position settings for the image, label and span text.
In this example I use the class name 'multSelktrImg', so within the css file it would look something like this:
.multSelktrImg span{position: relative;top: 10px;vertical-align: middle;
display: inline-flex;}
.multSelktrImg input {vertical-align: -2px;}
.multSelktrImg img {position: relative;height: 30px;margin: 2px 6px;top: -10px;}
Now for the change in the src/jquery.multiselect.js file
Search for the following matching code around line 130 (depending on what version id of the script you are using):
// build items
el.find('option').each(function( i ){
var $this = $(this),
parent = this.parentNode,
title = this.innerHTML,
description = this.title,
....
ADD the following line above "title = this.innerHTML,":
image = this.getAttribute("image");
so that it looks like this:
// build items
el.find('option').each(function( i ){
var $this = $(this),
parent = this.parentNode,
image = this.getAttribute("image");
title = this.innerHTML,
description = this.title,
Now Search for the following matching code around line 180:
// add the title and close everything off
html += ' /><span>' + title + '</span></label></li>';
....
Replace the code line with the following to allow for rendering of your images:
// add the title and close everything off
html += ' /><span>';
if (image != null) {
html += '<img src="'+image+'" class="multSelktrImg">';
}
html += title + '</span></label></li>';
save the new version of the script src/jquery.multiselect.js file and now the images will appear in the multiselect drop down. Use the 'multSelktrImg' class value to control the size of the image displayed by altering the pixel size for the class in your css file.
In the FIDDLE version, I have altered the minimized version of the jQuery script, and created an initialisation of the Select object.

JQuery tabs add dynamically ajax

I am new to JQuery, and have been trying to implement a tabbed interface where the tabs are added dynamically and their contents loaded via Ajax. I am using JQuery-ui tabs. I have been trying to solve this problem for days, and have been googling all around and read all relevant threads here in SO. Right now, the interface works if I add only one tab - the tab is created, it is selected, and its content loaded via Ajax. However, when I add a second tab, its content seem to be properly loaded, but when I select the first tab, I see the contents of second tab appended to the contents of the first tab, then I am no longer able to switch between tabs.
I am working on Rails 3. The code is in Coffeescript, but I think it should be easy to read for any Javascript'er. Here are some notes:
$('a.edit') is my selector to add the tab. To avoid multiple firings, I first check if the selector has already been bound before biding the adding of the tab with the mouse click
the tab close works well
the urls and tab name are passed as attributes. The urls point to html forms (via partials in Rails)
in the generated html, when I add a tab, two ui-tab-panel's are created with ids "ui-tabs-1" and "ui-tabs-2". The tab has an href that points to the second. Only the first has ".ui-tabs-hide".
when I add the second tab, I'll have four ui-tab-panel's, with the tabs pointing to "ui-tabs-2" and "ui-tabs-4", but none of them have ".ui-tabs-hide".
Here is the code
$(->
if !($('a.edit').is('.bound'))
$('a.edit').on('click', ->
addTab($(this).attr('url'), $(this).attr('tag'))
)
$('a.edit').addClass('bound')
$tabs = $('#tabs').tabs
#$tabs.tabs
closable: true
cache: true
tabTemplate: '<li>#{label} <span class="ui-icon ui-icon-close">Remove Tab</span></li>'
add: (event, ui) ->
$tabs.tabs('select', '#' + ui.panel.id)
addTab = (url, tab_name)->
$tabs.tabs('add',url,tab_name)
$( "#tabs span.ui-icon-close" ).live(
"click", ->
index = $( "li", $tabs ).index( $( this ).parent() )
$tabs.tabs( "remove", index )
)
To fix the problem, I introduced some minor changes. The major one was to add the line $tabs = $('#tabs') so all the references and method calls to tab should refer to the selector itself. I am not sure why, but before I had $tabs = $('#tabs').tabs( ... ). Another change was one needed in the cases where the selector $('a.edit') was added dynamically. Because the selector may not exist when the page is initally loaded, I changed the binding from .on('click,-> ) to .live('click', ->), and changed the flag so a new '.bounded' class is added to #tabs to prevent multiple firing.
$(->
$tabs = $('#tabs')
if !($tabs.is('.bound'))
$('a.edit').live('click', ->
addTab($(this).attr('url'), $(this).attr('tag'))
)
$tabs.addClass('bound')
$tabs.tabs
closable: true
cache: true
tabTemplate: '<li>#{label} <span class="ui-icon ui-icon-close">Remove Tab</span></li>'
add: (event, ui) ->
$tabs.tabs('select', '#' + ui.panel.id)
addTab = (url, tab_name)->
$tabs.tabs('add',url,tab_name)
$( "#tabs span.ui-icon-close" ).live(
"click", ->
index = $( "li", $tabs ).index( $( this ).parent() )
$tabs.tabs( "remove", index )
)

jQuery wont load

Jquery wont load. I'm a noob, but have persisted, trawled this site & tried many things, permission settings, reloading java on my system & various syntax tweaks, but no joy. About to give up. Here's how it stands...
Using jquery on my hard drive, current version jquery-1.7.1 (also tried v1.7.1.min).
I have tried to use the following plugins - scrollTo-1.4.2-min, jqDock.min & jqDock, jtruncate (current) & jtruncate.pack. None work. I'm using IE8 and Chrome to check on local.
Debugging says...
(jquery-1.7.1.js) invalid character Line 1 (NB: line 1 is just the
beginning of the credit info greyed out text /*! )
(jquery.jtruncate.js) jQuery is undefined Line 1 (NB: line 1 is
(function(jQuery){ ) (my page name) Object doesnt support this
property or method Code 0 Line 17 Char 5 (NB: line 17 is $('').jTruncate({ )
My head code, (after meta's, UTF8 and title)...
$(document).ready(function(){
$('<div id="statement" />').jTruncate({
length: 200,
minTrail: 0,
moreText: "[more]",
lessText: "[less]",
ellipsisText: "(truncated)",
moreAni: "fast",
lessAni: 2000
});
});
Then theres some java generated by Dreamweaver, (Rollover image/swap image guff), then page specific CSS (see below) i also have site wide external css sheet.
#statement {
position:absolute;
left:285px;
right: 190px;
top:130px;
width: 607px;
height: 321px;
}
Then html body.
Can anyone help? Cress
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
$(document).ready(function(){
$('body').append('<div id="statement" />');
$('#statement').css({
length: 200,
minTrail: 0,
moreText: "[more]",
lessText: "[less]",
ellipsisText: "(truncated)",
moreAni: "fast",
lessAni: 2000
});
});

Resources