Chat window visible even after setting minimized="true" - facebook

I am using FB Customer Chat plugin on my site and have set the minized option to true. It was working fine and now all of a sudden the chat window appears by default and I am not able to close the chat window. This is causing my content to be hidden behind the chat window.
Below is the code from my implementation:
<div class="fb-customerchat help-page" page_id=<<my-page-id>> minimized="true" logged_in_greeting="Hi! How may I help you today?"
logged_out_greeting="Thank you">

The minimized attribute has been deprecated (see the documentation). Instead, use the greeting_dialog_display attribute (applying greeting_dialog_display="hide" to the element should have the same effect as minimized=true did prior to deprecation).

remove the "" your attribute
minimized=true

Related

Property additionalActions of NSUserNotification seems not working?

To understand NSUserNotification better, I wrote a little test app playing with this class.
So far so good, except that no matter how hard I tried to feed the additionalActions property with array of NSUserNotificationAction objects, it never showed any difference but only one action button and a close one.
My expectation for this property is that the notification would show a pull-down menu containing the additional buttons I offer as it does in the Mac App Store update notifications.
Am I missing something? Or are you having the same problem, since it is a bug awaiting Apple to tackle?
Can you please try to click and hold down the action button in your notification? Does it show a drop-down menu of additionalActions?
Update
As it turns out, you can show the little chevron next to the action button by setting a true value for the private _alwaysShowAlternateActionMenu key on the notification. In Swift 3, it would look like this:
notification.setValue(true, forKey: "_alwaysShowAlternateActionMenu")
However, as I mentioned this is a private API and I strongly advise against using it if you want to distribute your App through the Mac App Store.
It is probably a bug. Setting up additionalActions will create the list, but not the little arrow icon. Holding down on actionButton will show the menu with the number of actions you set.
Besides setting additionalActions will cause several other problems. I will save this for another question.
Refer to another question.
show NSUserNotification additionalActions on click
P.S. I am using El Capitan APIs

How to disable back button on report?

I am accessing report using URL like in example:
http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=%2Freports%2Finteractive&reportUnit=%2Freports%2Finteractive%2FCustomersReport
I have also added custom theme to hide JasperServer decorators by folowing link: http://community.jaspersoft.com/wiki/embedding-ad-hoc-http-api
The only problem I am facing is when user click on Back button, they are exiting the report and they can see list of reports in repository. I would like to disable that behavior so that Back button just does nothing in that case. I have tried to customize the behavior as described in: http://community.jaspersoft.com/wiki/setting-default-flow-action-back-button but I can't find the proper value to replace the default action:
<end-state id="done" view="flowRedirect:searchFlow?lastMode=true" />
I have tried replacing it with
<end-state id="done" view="json:none" />
but that gave me some crazy error.
Hiding button by CSS is not a option since I need the back button to work when user is viewing sub-reports.
I did this issue for Input Control form button.
Under "...\apache-tomcat\webapps\jasperserver\WEB-INF\jsp\modules\viewReport" directory, in ViewReport.jsp file, I searched for "ICDialog" text and deleted related statements with ICDialog. Then I restarted the jasperserver by "servicerun.bat" and "servicerun.bat START" commands.
I think, this will work for back button and the others.
How about setting up the roles/users so the logged in user can only view reports allowed by that user. This would be a better solution than trying to circumvent the browser functionality. Alternatively if you have an application you are trying to embed jasper in you could use the web services to just download the report required by the user and not enable them to access the server webpage.
Simply add &decorate=no at the end of the URL.
Now the url like this {url_for_jasper_report}&decorate=no
Adding this query parameter you can hide the back button as well as the footer and header

Addon SDK way to make a dialog

What is the proper way to use the SDK to make a dialog (which is not anchored to the add-on bar, etc. but shows centered on screen)? It doesn't seem like there is any API for this important capability. I do see windows/utils has open but I have two problems with that:
The dialog opening seems to require "chrome" privs to get it to be centered on the screen (and I'd be expectant of add-on reviewers complaining of chrome privs, and even if not, I'd like to try to stick to the SDK way).
While I can get the DOM window reference of the new window/utils' open() dialog, I'm not sure how to attach a content script so I can respond to user interaction in a way that prompts (and can respond to) privileged behavior ala postMessage or port.emit (without again, directly working with chrome privs).
Ok, this answer should have been pretty obvious for anyone with a little experience with the SDK. I realized I can just use a panel. In my defense, the name "panel" is not as clear as "dialog" in conjuring up this idea, and I am so used to using panels with widgets, that it hadn't occurred to me that I could use it independently!
Edit
Unfortunately, as per Bug 595040, these dialogs are not persistent, meaning if the panel loses focus, the "dialog" is gone... So panel looks like it is not a suitable candidate after all... :(
Edit 2
I've since moved on and have gotten things working mostly to my satisfaction with sdk/window/utils and openDialog on whose returned window I add a load listener and then call tabs.activeTab.on('ready', and then set tabs.activeTab.url to my add-on local HTML file so the ready event will get a tab to which I can attach a worker. There is still the problem with chrome privs I suppose, but at least the main communications are using SDK processes.
Update to Edit 2:
Code sample provided by request:
var data = require('sdk/self').data,
tabs = require('sdk/tabs');
var win = require('sdk/window/utils').openDialog({
// No "url" supplied here in this case as we add it below (in order to have a ready listener in place before load which can give us access to the tab worker)
// For more, see https://developer.mozilla.org/en-US/docs/Web/API/window.open#Position_and_size_features
features: Object.keys({
chrome: true, // Needed for centerscreen per docs
centerscreen: true, // Doesn't seem to be working for some reason (even though it does work when calling via XPCOM)
resizable: true,
scrollbars: true
}).join() + ',width=850,height=650',
name: "My window name"
// parent:
// args:
});
win.addEventListener('load', function () {
tabs.activeTab.on('ready', function (tab) {
var worker = tab.attach({
contentScriptFile: ....
// ...
});
// Use worker.port.on, worker.port.emit, etc...
});
tabs.activeTab.url = data.url('myHTMLFile.html');
});
if the panel loses focus, the "dialog" is gone...
It doesn't get destroyed, just hides, right? If so, depending on why it's getting hidden, you can just call show() on it again.
You'd want to make sure it's not being hidden for a good reason before calling show again. If there's a specific situation in which it's losing focus where you don't want it to, create a listener for that situation, then call if (!panel.isShown) panel.show();
For example, if it's losing focus because a user clicks outside the box, then that's probably the expected behaviour and nothing should be done. If it's losing focus when the browser/tab loses focus, just register a tab.on('activate', aboveFunction)
Simply adding ",screenX=0,screenY=0" (or any values, the zeroes seem to be meaningless) to the features screen seems to fix centerscreen.

avoid chrome popup extension to close

Is there a function that allow me to select text when the extension
stays open. Normally when I Use the extension popup and I Click outside the
extension the extension close. Is there a wat to avoid this.
Thank you so much
Unfortunately there is currently no way to keep the popup open once you focus out of it. This is by design.
If you would like to always show something while interacting with the page, perhaps the experimental Info bars or even Desktop Notifications would work?
Hope that helped!
The only way to keep it open is to right click over the extension icon (button) and select "Inspect popup" the extension popup then show up and remain open but of course the debugger window show and this not a fix obviously still it will maybe inspire a hack... if someone is skilled enough and share the solution with all of us.
I encountered the same problem and I've thought of a possible solution (though not tested it):
Use your background.html to store the content of the popup action and upon loading the popup, you fetch the content via the default messaging for chrome extensions.
When doing all kinds of other stuff, like XHR's or something, I think you should do that in background.html too, so the requests won't abort if you close and you can do something with the result. Then when a user re-opens the popup, he'll see the result of his previous action instead of the default screen.
Anyone tried something like did already?
As far as I know you can't persist a pop up menu but my workaround has been using a content script to append a menu on page load. After the menu is appended you can toggle the menu via messaging between the background script and the content script.
If you want to encapsulate the menu from the page it's deployed on you could wrap your menu in an iframe. This could add complexity to your project since you would have to deal with cross origin issues and permissions.
There is an alternative hack for this. You can make use of chrome local storage to store the metadata as needed. Upon restart you can read that metadata and render the desired content. You will also probably clear that metadata after you have completed performing the operations based on that.

open a pop up window without using javascript

how to open a pop up window in code behind(C#) without using javascript.
Besides the fact that popups piss off a lot of people, it is not really possible to do so (if you don't consider target="_blank") without using javascript. Code written in code behind only generates client side code (which can include javascript) or executes some serverside stuff.
There might be other workarounds using flash or silverlight but I'm not sure about that. Maybe if you clarify your goal a little bit more I can give a better solution to your problem.
That is impossible because of "The code behind runs on the server; you need the popup to appear on the client machine. Therefore your code behind can't trigger a popup".
Alternatively, you can show a panel in the page as pop-up window, by seting it's z-index and giving absolute position.
The code behind runs on the server; you need the popup to appear on the client machine. Therefore your code behind can't trigger a popup.
Also, if you use javascript you'll probably find that the client's popup blocker prevents the new window from appearing (unless the popup happens as a direct response to a click - without posting back - in which case you can use <a target="_blank"...> if you really don't like javascript).
I do not think that is possible . what you can do offcourse is to open a new window with defined small width/height and all menus are stripped...
Just add attributes to a link button or to a button in code behind. Try this code to page load or to the button event handler.
Button1.Attributes.Add("onclick","javascript: SP.UI.ModalDialog.showModalDialog
({ url: 'PopUp.aspx', title: 'Pop Up Window', width: 600, height: 500 }); return false;");