Lock orientation for custom tabs - chrome-custom-tabs

I would like to lock the orientation using Chrome Custom Tabs. Is this something I can do with the Low Level API or do I need to get a new method added for this functionality?
My use case is that I have an app that has custom tabs and I want it to always show the custom tab in portrait, never landscape.

Custom Tabs does not currently provide an API that allows the developer to lock the orientation.
As a best practice, developers should always think twice before forcing a specific orientation, as it may be annoying to force the user to use one.
Locking the orientation looks more like something that should be decided by the content being opened inside the Custom Tabs (using an API like this) than something to be handled by the Custom Tab itself.

Related

How do I disable the "Customize Toolbar" from the Quick Access toolbar in Microsoft Access

I have an application I am developing with Access 2010. In certain circumstances I have to limit the users to a very limited subset of the application. This implies a limited Ribbon - by setting a dbProperties to "AllowAllMenus" to false, and changing the File menu (using a Custom Backstage ribbon).
This blocks most off the holes that would allow the user to get back to full menus, and then have access to data I would rather he didn't.
However, there is a hole in this process. The quick access toolbar as a little drop down arrow on the end of it with a hover of "Customise Toolbar". Using it drops down a menu with "More Commands...". Clicking on that drops you into the same dialog box you get when you chose "Options" from the File Menu (disabling of which was the prime purpose of my Backstage Ribbon change).
I can of course do the following in VBA
DoCmd.ShowToolbar "Ribbon",acToolbarNo
but that hides all the menus and Quick Access Toolbar completely. I don't want that, because I still need to allow the user to set up filters and toggle them on an off from the data they do see.
I can't find any other reference to how to block up this security hole in the applcation. Does anyone have any ideas on how?
Assuming that you already have your custom ribbon, make sure that you have assigned: startFromScratch="true".
However, this will disable not only "More Commands..", but all the other options of QAT dropdown list as well, except "Show Below the Ribbon".

What is the purpose of Print device layout in Sitecore (or How do I use it properly)?

I have created a print button in my application that opens a new window that goes to print device layout by appending the current url with QueryString of Print device(?p=1 in my case) and onload it calls window.print() function. But this is useless because all the data user has entered will be lost when it opens a new window containing print device layout of the current page.
I can't think of a way by which I can use the print device layout and pre-populate the page with data user has entered. Can anyone help me with this?
Thanks in advance.
The point of the Print Device to be able to have a different set of Presentation components for display or print. Sometimes it is sufficient (and easier) to just use a print stylesheet, which hides/restyles certain elements: https://stackoverflow.com/a/12773239/19112
Obviously Devices works fine for non-form pages, or forms that have been posted and a confirmation page is shown (no input boxes, just text).
An alternative would be to use Rendering Parameters to set on each control, which could add a .print or .do-not-print class to then be used by the print stylesheet. You would then have to set the appropriate styles in the stylesheet to hide those elements. Note however that you cannot style the iframe content from the parent, you must link a separate stylesheet to the iframe src page if you want to style when printing.
You can append the user inputs to the print URL query string using javascript, for example:
var url = 'Current-Page-URL' + '?p=1' + '&input1=[INPUT1]'+ '&input2=[INPUT2]' etc..
Then in Page load event, you can set these inputs in the corresponding text/dropdown elements
Like mentioned above that device is a different set of presentation that can be used for many purpose. Early years when there weren’t responsive design, I used device to rendering different mobile device. You can use device to render rss feed or anything you want where you want to have different render set.
Another example if you have multi sites and want to rendering them differently you can use device as well.
Sitecore is very flexible that’s why I love it so much. There are always other ways to get same or similar results. From your context I don’t know what you are trying to achieve. If I want to have different set of presentation
here is some approach I will look into, Lavage rendering rules, tap into request pipeline, swap rendering controls in code, on item level specify style sheet…
If you can tell us what you are trying to achieve, I am sure someone will provide you their own solution. Then you will have more options to choose from and get the best fit to your project.
Hope this help.

Need an HTML view for chat window

My Qt project needs a chat window similar to Skype. Namely, the chat history window, not where the user inputs his text. I thought of using some kind of HTML view to programmatically add chat text as it comes in from the chat parties.
Some requirements:
It has to be formatted nicely, support for CSS I can apply to it..
I must have scroll control - e.g. autoscroll to the end of the chat when new chat lines come in, even if I'm currently scrolled up for some reason.
it has to allow a full mouse copy, just like skype.
Will QWebView do the hob? I did not see scroll control API, or being able to "append" new text lines. Will I have to re-create and re-submit the HTML using "setHTML" every time a new line comes through?
Any advice will be appreciated.
You may want to consider using either QTextEdit or QTextBrowser. Both of these widgets have support for HTML (though it may be somewhat limited). These widgets will allow you to append HTML line-by-line. They also inherit from QAbstractScrollArea, which provides you with access to their scroll bars. I'm not sure if they will support CSS, but they do support Qt's style sheets, which might work for you as an alternative if you can't get CSS to work. They also provide out-of-the-box copy, cut, paste, undo and redo (though you'll probably want to customize this for your case).

Is it possible to style the Facebook Like button shown faces to be inline

I'd like to show faces (data-show-faces="true") on my FB like button, but I'm using it in a panel that is very wide but where I can't afford to use a lot of vertical space. I would like to display the faces in the same row as the button, not in a new line.
Is there a way of either configuring the control to do this, or a safe way to do it in css?
As far as I know, there's no good way to do this. Facebook controls the iframe that gets rendered when you use fb:like and they don't make the users who like that object available to you for privacy reasons (those faces are personalized for the user who's viewing them).

How do I make a mobile-friendly popup on my website?

Is there a simple way to trigger a mobile OS's native pop-up/alert/etc. from some form of web code? I'm writing an ASP.NET mobile web page and I'd like to, for example, have the iPhone's UIAlertView appear.
EDIT: What I'm looking for is not the method with which to detect which mobile browser is accessing the site (I already know how to do that). If the code to trigger a pop-up that will look nice in an Android browser is different than the code to trigger a pop-up that will look nice in an iPhone browser, I can simply throw in a switch statement that redirects the user to the pop-up that corresponds with their browser. I'm trying to find the html/javascript/asp.net code which will create a mobile-friendly pop-up, either in general or for the various popular mobile web browsers specifically.
Don't know whether there is any pre-built functionality in .NET that can achieve this, but you can surely write one yourself.
You can write a method, that returns the code for your popup, based on the user OS (simple switch statement should do).
EDIT after taking a short nap:
I believe you should reconsider using popups. They are quite annoying even on desktop browsers and many people block them automatically. Probably every blog about accessibility will tell you, that you should keep mobile version of your website as simple as possible because of various compatibility issues that you can run into.
Instead, try to think about some interesting way to incorporate messages for users in a different and appealing way, that won't disturb anybody.
What I do is use a div popup (that floats ontop of the page) and eighter make a big close button or set at timeout to remove it.
jquery mobile is a good place to start.

Resources