context menu demo app not working crossrider - contextmenu

I am generating context menu when user selects some text and right click it. I tried implementing it, problem is even sample application is not working.
http://crossrider.com/apps/10565/ide
appAPI.contextMenu.add("key1", "Display data object", function (data) {
var sAlertText = 'pageUrl: ' + data.pageUrl + '\r\n' +
'linkUrl: ' + data.linkUrl + '\r\n' +
'selectedText:' + data.selectedText + '\r\n' +
'srcUrl:' + data.srcUrl;
alert(sAlertText);
}, ["all"]);
Only data.pageUrl is available rest of all are "undefined". I want selectedText.

Disclaimer: I work at Crossrider.
Indeed there was an issue with the contextMenu due to a change in the Chrome API.
We've fixed this and now the demo app works.
Thank you for reporting this and please feel free to let us know if you encounter any issues!
Amir

Related

Qt: how to apply a shortcut( Key_Comma + Key_Return) to action

I tried to set a shortcut by the following code, but it doesn't work. If I change it to ALT + Comma or ALT + Return, it will be fine. but the request is Comma + Return. Does anyone know how to set this special shortcut on Qt?
#shotcut = Qt::Shortcut.new(Qt::KeySequence.new(Qt::Key_Comma +
Qt::Key_Return), self, SLOT('save_by_shortcut()'))
#shotcut.setEnabled(true)
Any help would be appreciated!
You can create it by using the multiple arguments constructor for QKeySequence.
like this:
auto ac = new QAction(this);
ac->setShortcut(Qt::Key_Comma + Qt::Key_Return);

Twilio IP messaging: Why am I getting error - WebSocket is already in CLOSING or CLOSED state

I can't get why my browser console shows an error from time to time. As I can see this error doesn't break anything.
media.twiliocdn.com/sdk/rtc/js/ip-messaging/releases/0.10.6/twilio-ip-messaging.js:22423
WebSocket is already in CLOSING or CLOSED state.
Also I noticed that after some time of inactivity in chat window, I get 'messageAdded' event with a huge latency (it's take around 5+ seconds after message was sent), but Typing event works fine. Why is this happens?
Closed socket errors indicate an issue with the local network and Chrome - can you confirm if you are going through a proxy? Could you also test using Firefox if possible?
If not, can you uncheck "automatically detect settings" in the network part of the Chrome Settings? Clear the cache and then update to the latest version and try again.
As far as the messageAdded event is concerned, what does your code look like?
Adding event listeners for IP Messaging:
//set up listeners for events for the active channel
activeChannel.on('messageAdded', addMessageToHistory);
And the messageAdded method I've seen used without issue:
function addMessageToHistory(message) {
console.log('Message added, adding a message to the history, sid:' + message.sid);
//get a handle to the chat history wrapper
var $messageHistory = $('#chat-history');
//process the message elements
var $messageEntry = $('<div id="' + message.sid + '" class="chat-message clearfix"/>');
var $messageContent = $('<div class="chat-message-content clearfix"/>');
var $messageTime = $('<span id="time_' + message.sid + '" class="chat-time"/>').text(formatDate(message.timestamp));
var $messageAuthor = $('<h5/>').text(message.author);
var $messageBody = $('<p id="msgbody_" ' + message.sid + '" />').text(message.body);
var $messageSeparator = $('<hr/>');
//build the message content
$messageTime.appendTo($messageContent);
$messageAuthor.appendTo($messageContent);
$messageBody.appendTo($messageContent);
//build the message entry
$messageContent.appendTo($messageEntry);
$messageSeparator.appendTo($messageEntry);
//ad the message entry to the history
$messageEntry.appendTo($messageHistory);
//scroll to end
$messageHistory.scrollTop($('#chat-history')[0].scrollHeight);
activeChannel.updateLastConsumedMessageIndex(message.index);
}
If your problem persists, then I'd suggest you contact support where we can take a closer look.

R-Studio error "> " signs became "+"

We have a homework on R-studio and while applying steps I've got an error, as shown below:
+ +library(simpleaffy)
+ +>hist(dat)
+ +plotAffyRNAdeg(RNAdeg, col=cols)
+ +end()
+ +options(error = expression(NULL))
+ +>hist(prostate)
+ +>hist(prostate)
+ +source('~/.active-rstudio-document')
These are just some random codes which I wrote while trying to dispose pluses
They must be > to run the steps, but I can't run because of this error.
You have to omit both > and + at the beginning of the lines. Your code has to look like this:
library(simpleaffy)
hist(dat)
plotAffyRNAdeg(RNAdeg, col=cols)
end()
options(error = expression(NULL))
hist(prostate)
hist(prostate)
source('~/.active-rstudio-document')
You probably want to ask programming questions on StackOverflow.
A line starting with + means R is expecting more input. It usually occurs because you haven't closed a parenthesis.

How to call a console program from an action

I am building an MVC application that includes an asynchronous image upload so each image, once uploaded, calls the action. Image uploading can be cpu intensive and require time so we are trying to avoid in-action processing.
I have read about using async actions, but we are also processing images at other times, so we have opted to handle image processing through a console application.
What is the proper method for calling a console application from an MVC action asynchronously? Basically we just want to pass the console app some parameters, and tell it start without waiting for any kind of response from the console.
Our program file is an exe.
Speed is our main concern here.
Thanks so much for your help!
EDIT
As per Brian's suggestion here is what we added:
Process pcx = new System.Diagnostics.Process();
ProcessStartInfo pcix = new System.Diagnostics.ProcessStartInfo();
pcix.FileName = "C:\\utils_bin\\fileWebManager\\ppWebFileManager.exe";
pcix.Arguments = WrkGalId.ToString() + " " + websiteId.ToString() + "" + " " + "19" + " \"" + dFileName + "\" ";
pcix.UseShellExecute = false;
pcix.WindowStyle = ProcessWindowStyle.Hidden;
pcx.StartInfo = pcix;
pcx.Start();
You would use Process.Start to execute an external application, e.g.:
Process.Start(#"C:\\path\to\my\application.exe");

Removing "undefined" in pre populated url form link (from Modified Google Expense Report script)

I've modified the standard google drive expense report system to use it as a competency and experience matrix where the manager can approve/reject a form.
The problem i'm encountering is when a form is rejected by the manager it sends a link back to the employee with a link to a form pre-populated by the url.
However if the employee didn't enter a value in the original form the url populates it as "undefined".
Question, can I pre-populate a form via url removing or replacing the "undefined" values?
Perhaps the code will explain better than I can.
+ "<P><b>" + 'Please re-submit your form <a href=' + USER_FORM_URL +
'&entry_2=' + encodeURIComponent(row.forename) + '&entry_3=' +
encodeURIComponent(row.surname) + '>here</a></b>'
Any help would be much appreciated, struggled to find a solution "out there".
Tom
image link http://s11.postimage.org/dyd1olkoz/url_stack.jpg as i'm a new poster.
Looks like the getObjects() function in the script may skip adding a value to the row object, later used in sendReportToManager(), if the value is empty in the expense report spreadsheet. So, later trying to append something like row.bananas (or something empty in sheet and thus not defined on object) will result in 'undefined' being appended to the string instead. If you look at your querystring for the form with the 'undefined' values, you should see 'undefined' in the url's querystring.
You can avoid this by wrapping your encodeURIComponent(row.XXXX) calls for potentially empty columns to be something like this: row.XXXX ? encodeURIComponent(row.XXXX) : ""
So, replace the likes of:
+ "<P><b>" + 'Please re-submit your form <a href=' + USER_FORM_URL +
'&entry_2=' + encodeURIComponent(row.forename) + '&entry_3=' +
with
+ "<P><b>" + 'Please re-submit your form <a href=' + USER_FORM_URL +
'&entry_2=' + (row.forename ? encodeURIComponent(row.forename) : "") + '&entry_3=' +

Resources