UIAlertView with 3 buttons hides message in landscape mode - hide

My UIAlertView has a message and 3 buttons, my problem is the alert view display normally in portrait but it hides message in landscape mode as below screenshots. How to make the message appears? Thanks in advance.

I too got same problem,
But I solved this, with a small change. like add "\n\n" at the end of Title in the alertView
This is not a correct solution. but this will rectify that problem some what.
*Note : The Title and the Message should be of one line text.
Thanks,
Satya

By merging the Title String into the Message String you can fit two lines of landscaped text. Localization wise, this is a problem for many of us so I'm going to file a bug with Apple as it appears we aren't the only ones dealing with this problem.
Note: Any LS_ strings in my system are referenced from the Localizable.strings file.
So I went from:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(#"LS_Prompt_RateApp_Title", NULL)
message:(#"LS_Prompt_RateApp_Message", NULL)
delegate:self
cancelButtonTitle:NSLocalizedString(#"LS_Prompt_RateApp_Never", NULL)
otherButtonTitles:NSLocalizedString(#"LS_Prompt_RateApp_OK", NULL),
NSLocalizedString(#"LS_Prompt_RateApp_Cancel", NULL),
nil];
I have screenshots but it won't let me due to being a new account so here's a text version:
[ TITLE LINE 1 ]
[ ] ( message is clipped )
[ Button #1 ]
[ Button #2 ]
[ ]
[ Button Cancel]
to:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(#"LS_Prompt_RateApp_Prompt", NULL)
message:NULL
delegate:self
cancelButtonTitle:NSLocalizedString(#"LS_Prompt_RateApp_Never", NULL)
otherButtonTitles:NSLocalizedString(#"LS_Prompt_RateApp_OK", NULL),
NSLocalizedString(#"LS_Prompt_RateApp_Cancel", NULL),
nil];
I have screenshots but it won't let me due to being a new account so here's a text version:
[ TITLE LINE 1 ]
[ TITLE LINE 2 ] ( message == NULL )
[ Button #1 ]
[ Button #2 ]
[ ]
[ Button Cancel]

Related

docusign - radioGroupTabs not working (locked out) in a compositeTemplate

I am trying to add a pdf with form fields document to a docusign envelope using inlineTemplates, everything is good, docusign is able to parse the textTabs, signHereTabs etc, but the problem is radioGroupTabs, when I send the envelope, these fields are locked.
The only way I got those fields unlocked/fillable is by assigning first signer as defaultRecipient.
tabs: {
textTabs: [
{
tabLabel: `ESIG_ADVISORDOC_SIGNER1_\\*`,
},
],
radioGroupTabs: [
{
groupName: `ESIG_ADVISORDOC_SIGNER1_TCP_ADD_REM`, // didn't work
},
{
groupName: `ESIG_ADVISORDOC_SIGNER1_\\*`, // didn't work
}
]
}
I tried multiple things, example use tabLabel in place of groupName for the radioGroupTabs etc etc, nothing worked. Tried with a wildcard, tried with the exact fieldName, tried with both.
Can someone please suggest a solution?
Tabs have an optional field locked. I believe the default for that value should be false but you could try explicitly setting locked to false to force the tabs to be editable.
Finally after two days of trials and errors, found that we need to pass locked: false in the radios attribute.
tabs: {
textTabs: [
{
tabLabel: `ESIG_ADVISORDOC_SIGNER1_\\*`,
},
],
radioGroupTabs: [
{
groupName: `ESIG_ADVISORDOC_SIGNER1_\\*`,
radios: [
{ locked: 'false' }
]
}
]
}
Docusign should be better with their documentation.

I can't get GitBook mermaid plugin to work, what a, i doing wrong?

I'm new at Gitbook and can not get the mermaid plugin to work.
book.json
{
"plugins": ["mermaid-2"
],
"pluginsConfig": {
"mermaid-2": {
"theme": "forest"
}
} }
file.md : I put the code into fenced code block and tag it mermaid
mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
But it is not showing diagrams, it display as:
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
Please help me, why is this not working?
Since gitbook-plugin-mermaid-2 does not work as it is, you need to edit node_modules/gitbook-plugin-mermaid-2/index.js as below.(Around line 33)
js: [
'bower_components/mermaid/dist/mermaid.min.js',
'plugin.js'
]
then surround file.md with ```mermaid.

Why no 'tab' property in sender object received for chrome.runtime.sendMessage from a sub frame?

EDIT: Simplified question with MCVE and screenshot of stack.
My MCVE Extension json:
{
"manifest_version": 2,
"name": "TEST SO",
"version": "0.1",
"permissions": [ "<all_urls>", "tabs" ],
"background": { "scripts": ["background.js"] },
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"],
"all_frames": true
}
]
}
My MCVE content.js:
console.log( "content.js Started for Document at " + document.URL );
window.addEventListener('unload', function(event) {
chrome.runtime.sendMessage( "'unload' Event for Document at " + document.URL );
});
My MCVE background.js:
console.log("background.js Started");
chrome.runtime.onMessage.addListener(
function( message, sender ) {
try {
console.log( "The 'message' arg is : " + JSON.stringify(message) );
console.log( "The 'sender' TAB is : " + sender.tab.id );
} catch ( e ) {
console.log( "Exception in OnMessage Listener : " + e.message );
}
}
);
When I navigate from one site with 3 frames (one main frame and 2 subframes, say for exemple https://developer.chrome.com/extensions/messaging#native-messaging-host) to a simple site with one single frame, my background script receives 3 "messages": one for each "unload" event.
Unfortunately, only the first one (corresponding to the "unloading" of the main frame) contains a "sender" argument with a 'tab' property. The two others have no 'tab' property.
Documentation states, if I correctly read it, that the 'tab' propertie should be there.
Is that by design, a bug, or bad code on my side?
Stack showing that the sender argument has NO tab property.
Note: You may, at the beginning of the test, be able to have correct sender object, but if you then just go back and forth between the 2 sites, you quickly won't be able to have a a tab property (for the messages coming from the unload in the 2 sub frames)
Chrome 48.0.2564.82 m
Windows Seven 64 bits.

How to make the application layout control dynamic in Xpages

I have been working on making the applicationLayout Custom Control more dynamic, so I can more build and extend Xpages apps more easily.
To that end I am now using the switch facet, which helps immensely.
I also want to soft code the Application Links, Title Links, and Navigation Entries.
I think I can build a data structure in which I just put the values I want and the majority of the app layout is loaded from this.
So I will have an array of appliances in a scope variable, like so:
“App 1”, “App 2”,”App 3” etc.
Then for the Title’s I will have to have something like this:
“App 1”,”Title Bar 1”,”Title Bar 2”,”Title Bar 3”,
“App 2”,”Title Bar 1”,”Title Bar 2”,”Title Bar 3”,”Title Bar 4"
“App 2”,”Title Bar 1”,
So the first Application Link will three title bars, the second 4, etc.
Then for the nav:
“App 1”,”Title Bar 1”,”Nav 1,”Nav 2"
“App 1”,”Title Bar 1”,”Nav 1,”Nav 2”,”Nav 3"
and so on.
If I do this then it will be very easy I think to layout an app.
My question is what data structure is best to use? And should I use three arrays or on 3-dimensial array?
===================================================================
Knut's answer is great, but I cannot seem to loop through the array.
var lenArr:Integer = sessionScope.apps.length;
for (i=0; i < lenArr;++i)
{sessionScope.apps[i].app}
When I do a length on the session.Scope variable it returns a 3, but when I loop through the array it returns null when i=2. There are only 2 items in my array, at least there should be. Here is my code for the sessionScope.
<?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core"
rendered="false"
viewState="nostate"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.afterPageLoad><![CDATA[#{javascript:sessionScope.apps =
[
{ app: "xpApp1",
titleBars: [
{titleBar: "ccApp1Title1",
navs: ["ccNavApp11Title1Nav1"]
},
{titleBar: "ccApp1Title1",
navs: ["ccNavApp11Title1Nav2"]
}
]
},
{ app: "xpApp2",
titleBars: [
{titleBar: "ccApp2Title1",
navs: ["ccNavApp21Title1Nav1"]
},
{titleBar: "ccApp2Title2",
navs: ["ccNavApp21Title2Nav1"]
}
{titleBar: "ccApp2Title3",
navs: ["ccNavApp21Title3Nav1"]
}
]
},
];
//Now set the selected values
sessionScope.appSelected = "xpApp1";
sessionScope.titleSelected = "ccApp1Title1";
sessionScope.navSelected = "ccNavApp11Title1Nav1";
var uAgent = context.getUserAgent().getUserAgent();
if((uAgent.match("iPhone") !== null || param.platform=="iphone") ||
(uAgent.match("Android") !== null || param.platform=="android") ||
uAgent.match("iPad") !== null){
context.redirectToPage("/mobile.xsp", true);
}else{
context.redirectToPage("/xpApp1.xsp", true);
} }]]></xp:this.afterPageLoad>
</xp:view>
What am I doing wrong?
Use JavaScript's arrays and objects to define your application structure
sessionScope.apps =
[
{ app: "App 1",
titleBars: [
{titleBar: "Title Bar 1",
navs: ["Nav 1", "Nav 2", "Nav 3"]
},
{titleBar: "Title Bar 2",
navs: ["Nav 4", "Nav 5", "Nav 6"]
}
]
},
{ app: "App 2",
titleBars: [
{titleBar: "Title Bar 3",
navs: ["Nav 31", "Nav 32", "Nav 33"]
},
{titleBar: "Title Bar 4",
navs: ["Nav 41", "Nav 42"]
}
]
}
];
You can access the first app with
sessionScope.apps[0].app
the first app's first titleBar with
sessionScope.apps[0].titleBars[0].titleBar
and first app's first titleBar's second nav with
sessionScope.apps[0].titleBars[0].navs[1]
Use a for loop or forEach to get all elements of an array.

Render context menu depending on selection

I want to display a different menu option depending on whether a number or text is selected.
I've tried playing with content scripts but I can't get them to work in gmail which is where I need it to work. Here is what I have, it works on sites other than gmail (is it a https thing?)
Background.html
<script src="driver.js"></script>
content_script.js
document.addEventListener("mousedown", function(event){
if(event.button == 2) {
var selection = window.getSelection().toString();
chrome.extension.sendRequest({cmd: selection});
}
}, true);
driver.js
chrome.extension.onRequest.addListener(function(request) {
alert(request.cmd);
});
manifest.json
{
"name": "Context Menu Search",
"description": "Opens the selected text as keyword in a new window",
"version": "0.1",
"permissions": ["contextMenus"],
"content_scripts": [
{
"matches": ["http://*/*","https://*/*"],
"js": ["content_script.js"]
}
],
"background_page": "background.html"
}
Selection type changes context menu using chrome extension
You will have to set a listener for mouse down. There is no other way to get the selected text before the menu is created.
See this SO question:
chrome extension context menus, how to display a menu item only when there is no selection?
Here is part of the code the rest is at the link.
document.addEventListener("mousedown", function(event){
//right click
if(event.button == 2) {
if(window.getSelection().toString()) {
chrome.extension.sendRequest({cmd: "createSelectionMenu"});
} else {
chrome.extension.sendRequest({cmd: "createRegularMenu"});
}
}
}, true);

Resources