Popup display not working with alfresco share? - alfresco-share

I have a problem with the following code:
this.widgets.boiteForm.setAJAXSubmit(true, {
successCallback: {
fn: function(){
Alfresco.util.PopupManager.displayMessage({
text: Alfresco.util.message(this.msg("message.send.success")),
displayTime: 2
});
YAHOO.lang.later(5000,this,Alfresco.util.navigateTo($siteURL("dashboard")) );
},
scope: this
},
failureMessage: this.msg("message.send.failure"),
failureCallback: {
fn: this.onFormSubmitFailure,
scope: this
},
obj: {attachementsRefs: this.attachementsRefs}
});
When the submit succeeds, The popup doesn't display but the navigate kicks in. I'm not able to figure out what could be causing this issue.

Related

tinymce.PluginManager.add no longer working in wordpress 4.7.2

Here is the example of the code
(function()
{
tinymce.PluginManager.add( 'custom_class', function( editor, url )
{
// Add Button to Visual Editor Toolbar
editor.addButton('custom_class', {
type: 'menubutton',
text: 'Text Layout',
icon: false,
menu: [{
text: 'Testimonial',
onclick: function()
{
tinyMCE.activeEditor.setContent('');
editor.insertContent('<strong>Menu item 1 here!</strong> ');
}
},
{
text: 'Large Header Line',
onclick: function()
{
tinyMCE.activeEditor.setContent('');
editor.insertContent('<h4>Header</h4><em>Menu item 2 here!</em> ');
}
},
{
text: 'Normal',
onclick: function()
{
tinyMCE.activeEditor.setContent('');
editor.insertContent('Menu item 3 here! ');
}
}]
//image: url + '/icon.png',
});
});
})();
After Wordpress upgrade from 4.7.1 to 4.7.2, I could not add tinymce buttons anymore.
I checked that javascript was definitely running. and it was working fine with wp 4.7.1
Anyone have ideas?
solution that worked in my case
run phpmyadmin (or any other database managment solution)
in table wp_options find can_compress_scripts and change value to 0

Fullcalendar event url - add class if url contains

Some of my Fullcalendar events have links. The links point to either public webpages, pdf documents or webpages which are restricted access.
I would like to add a class to format the links to add an icon, based on url string.
If the url contains:
"pdf" addclass "fc-pdf"
"restricted" addclass "fc-lock"
I assume it should be with and eventRender... but I'm having trouble find the right syntax. Can someone help me with this?
http://jsfiddle.net/lbriquet/oez9Ltym/
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'listDay,listWeek,month'
},
views: {
listDay: {
buttonText: 'list day'
},
listWeek: {
buttonText: 'list week'
}
},
defaultView: 'listDay',
defaultDate: '2016-09-12',
navLinks: true, // can click day/week names to navigate views
events: [{
title: 'Conference (website)',
start: '2016-09-11',
end: '2016-09-13',
url: "https://www.ted.com/talks"
}, {
title: 'Meeting (download document)',
start: '2016-09-12T10:30:00',
end: '2016-09-12T12:30:00',
url: "http://storage.ted.com/tedx/manuals/tedx_speaker_guide.pdf"
}, {
title: 'Lunch',
start: '2016-09-12T12:00:00'
}, {
title: 'Meeting (members only)',
start: '2016-09-12T14:30:00',
url: "http://www.dictionary.com/browse/restricted"
}, {
title: 'Happy Hour',
start: '2016-09-12T17:30:00'
}, {
title: 'Dinner',
start: '2016-09-12T20:00:00'
}],
eventRender: function eventRender(event, element, view) {
}
});
The way I got this to work was by adding a type to the events simply because I think it would be easier than dealing with regex that might not always work. So events don't need a type but they can have a type pdf, restricted or whatever else you need. In eventRender I added the following:
eventRender: function eventRender(event, element, view) {
if(typeof event.type !== 'undefined') {
if(event.type === 'pdf') {
element.addClass('fc-pdf');
} else if(event.type === 'restricted') {
element.addClass('fc-lock');
}
}
}
A check to see if the type is provided or not and then if statements for adding the class based on the type. I also had to make a small change to the css selector, changing a.fc-lock to .fc-lock a to allow it to display properly. Here is the JS Fiddle showing this.

Processing clicking only when show window

i am click button, when click "ENTER" on keyboard, but i am want processing clicking only when show window ('MyDesktop.Books').But when i am show window, and then close it, when i am click "ENTER", window ('MyDesktop.Books') showing again.
How to do: processing click "ENTER" on keyboard only when show window
Code:
Ext.define('MyDesktop.Books', {
extend: 'MyDesktop.BaseWindow',
id: 'books-win',
title: 'Book',
width: 700,
height: 400,
iconCls: 'small',
layout: 'fit',
items: [
{
xtype: 'bookwrap',
listeners: {
afterrender: function() {
var mapEnterNew = new Ext.KeyMap(document, {
key: 13,
fn: function(e) {
Ext.ComponentQuery.query('bookwrap button[name=createbook]')[0].getEl().dom.click();
}
});
}
}
}
],
});
I think you should either only initialize the window when it's needed for display and remove afterwards, or attach the event in field/form focus and remove it on blur.
I could give a better answer / example if I knew what xtype: "bookwrap" was.
You shouldn't really need to be using getEl().dom.click(), ExtJs can handle all your form submission needs with it's built in components, you can use use refs in your controller to get references to your buttons alot easier.
This code attaches the key event handling on render and removes it again when the window is closed/hidden:
There is also a Fiddle.
Ext.application({
name: 'Fiddle',
launch: function() {
Ext.define('Books', {
extend: 'Ext.window.Window',
id: 'books-win',
title: 'Book',
width: 700,
height: 400,
iconCls: 'small',
layout: 'fit',
items: [{
xtype: 'panel',
html: 'test'
}],
listeners: {
beforehide: function() {
this.mapEnterNew.destroy();
},
afterrender: function() {
this.mapEnterNew = new Ext.KeyMap(document, {
key: 13,
fn: function(e) {
console.log(e);
Ext.ComponentQuery.query('bookwrap button[name=createbook]')[0].getEl().dom.click();
}
});
}
}
});
Ext.create('Books').show();
}
});

Sencha Touch Panel Scrollability issue in Android tablets

I have a panel in Sencha touch which shows some htm file.
Ext.define('Project.view.eula.EulaPanel',{
extend:'Ext.Panel',
requires: ['Ext.Ajax','Ext.Panel'],
xtype:'eulaPanel',
id:'eulaPanel',
config:
{
scrollable:true,
padding:10,
listeners: {
activate: 'onActivate'
},
// Create a new configuration called `url` so we can specify the URL
url: 'resources/eula/EULA.htm',
items:[
{
xtype:'toolbar',
docked:'top',
items:[
{
xtype:'button',
text:'Accept',
action:'eulaAcceptBtn',
},
{
xtype:'button',
text:'Decline',
action:'eulaDeclineBtn',
},
]
}
]
},
onActivate: function(eulaPanel, container) {
Ext.Ajax.request({
url: this.getUrl(),
method: "GET",
success: function(response, request) {
eulaPanel.setHtml(response.responseText);
},
failure: function(response, request) {
eulaPanel.setHtml("failed -- response: " + response.responseText);
}
});
}
});
This panel is the first panel that gets displayed when the app is opened. But it cannot be scrolled. If you navigate to any other page or reopen the app again the panel becomes scrollable. Please let me know if anyone knows the fix.
Just try setting scrollable config in Panel as follows instead of true
scrollable : {
direction : 'vertical'
}

Extjs Alert doesn't work when button is pressed (Button Scope issue)

I am building an application and I am trying to keep it object oriented. The issue is that the alert box doesn't appear when the button is clicked. I believe it is an issue with the scope of the button. It could also be related to the way i am building my app. It is based off of an example provided by Sencha. I have searched, and tried many things, but I haven't come up with a solution. Here is my code:
Ext.require([
'Ext.grid.*',
'Ext.panel.*',
'Ext.msg.*'
]);
Ext.Loader.onReady(function() {
Ext.define('App.SimplePanel', {
extend: 'Ext.Panel',
alias: 'widget.SimplePanel',
width: 100,
height: 50,
initComponent: function() {
this.buttons = [{
text: 'Trigger Alert',
scope: this,
hander: function(){
Ext.Msg.alert('Title', 'TestAlert');
}
}];
this.callParent();
}
});
}, false);
Ext.onReady(function() {
// create an instance of the app
var simplePanel = new App.SimplePanel({
renderTo: document.body,
});
});
The issue is property should be called handler not hander
this.buttons = [{
text: 'Trigger Alert',
scope: this,
handler: function(){
Ext.Msg.alert('Title', 'TestAlert');
}
}];

Resources