How do you automatically set focus on a form field using yui - interface

I currently have an issue where I want text field to be automatically selected when the user visits my webpage, I currently do this by Javascript but would, ideally, like to use YUI. After searching the web, i found this command,
YAHOO.util.Dom.get("first_element").focus();
and
YAHOO.util.Dom.get("text1t").focus();
but have had very little luck getting it to work, one suggestion was to use a setTimeout fnction, but this seems a rather ugly way of doing it.
If anyone has any suggstions I would be very grateful.
Thanks,

Try using onAvailable
YAHOO.util.Event.onAvailable("elementId", function(me) { me.focus(); }, YAHOO.util.Dom.get("elementId"));
You may need to use a later event, like onContentReady or even onDOMReady if that doesn't work.

Related

How to check if the text in an editor has focus when developing an extension?

Same to editorTextFocus, but I want to check this condition when developing an extension, what's the API for that?
I've tried the following:
if (window.activeTextEditor) {
// ...
}
But the result is not the same as using editorTextFocus.
So I've wanted something like a getContext API which is the corollary to setContext API, in this case, I would use it like getContext('editorTextFocus').
After a lot of searchings, I ended up in this Add getContext command PR, but it got rejected due to these reasons, basically saying getContext API is not the solution for this type of issues. I guess we'll have to wait until the VSCode team come up with a better API for this, let's hope it won't take too long.

Setting up Dynamic Links in Firebase with Wordpress site

I am really struggling here... All I actually want to achieve is that I can get the Generate-Strong-Password function inside my app but that is actually harder than I thought.
I learned that I should go with Firebase Dynamic Links because I have a Wordpress-Website from All-Inkl.com.
I followed this Tutorial and there is actually an Apple-Site-Association-File at the moment. But I can't access my Website anymore as it looks like this:
Inside my Firebase Project I am getting this error which says that there not all the necessary "A-Files" are inside my Website:
My DNS-Settings:
I've been struggling for weeks now to get this done so if anyone has any idea how I can fix it I would be extremely grateful!! (btw, I am a total newbie when it comes to websites; I know my way around Swift though)
It seems that different domain providers accept different values for DNS entries ('A records' = 'A-Datensätze', in this case).
Try editing the entries for the Host field (which currently hold your website's URL) to one of the 'common inputs' listed here: https://firebase.google.com/docs/hosting/custom-domain?hl=de#domain-key
As the URL to your site doesn't seem to be what your provider accepts, I would suggest you try replacing it with the next option, i.e. replacing it with # .
Hope this helps solving your issue!

appAPI.notifier.show sometimes not work

i have a problem with Crossrider code.
I want to display notifier with this code:
appAPI.notifier.show({
'name':'my-notification-name',
'title':'Title',
'body':body_popUp,
'theme':'facebook',
'position':'bottom-left',
'close':false,
'sticky':true,
'fadeAfter':1,
'width':'700px',
'closeWhenClicked':false
});
but sometimes work, sometimes not work.
Do you have an idea? I have to write any instructions before call .show()?
Thanks in advance, Mattia
You don't show what body_popUp is set to but, assuming it's valid HTML and it's placed in the extension,js file, the code look fine.
In general, note that the notification is smart and only appears when it detects user movement in the browser. This algorithm is used as a way to ensure that the notification is seen, as it assumes the user is looking when activity is detected.
[Disclosure: I am a Crossrider employee]

Concrete5 isEditMode()-like handler to get Information about active editing or publishing

So my question is if there is a Concrete 5 handler/listener instead of
isEditMode()
that tells if the user is in active Editing mode or if he just has published his Edit?
Something like
isPublished() or isEditModeActive()
Thx yall
thanks for your interest!
So i tried the Eventhandler in the way it is decumented in the second example:
1. i created site_events.php in the /config
2. i added
<?PHP Events::extendPageType('inhalt', 'on_page_version_approve');?>
i added to the site.php
define('ENABLE_APPLICATION_EVENTS', true);
on the reffered inhalt.php pagetype i added
function on_page_version_approve() {
echo "page published";
}
... nothing happens.
In the description it is written, that the refferring inhalt.php has to exist in /controllers. However, this is not the case. I actually dont quite understand the structure of the Eventhandling. It would be great if you could help me out there...
Thanks in advance anyways :)
It sounds like you want what concrete5 calls Events (http://www.concrete5.org/documentation/developers/system/events/).
As per the docs, you'll get the Page as arguments to the functions you register.
There is nothing quite as specific as what you're looking for, but:
For published, use on_page_version_approve.
For editing, try on_before_render. It's a bit generic (ie, it'll be getting called far more than you're interested), but you can do something like if ($page->getCollectionCheckedOutUserID()). You should experiment a bit with this, though. For example, if you check out the home page for editing, and then someone else loads the live version, the event will probably get called again, and the Page will probably show "checked out". But maybe you can check ->isEditMode(), which should check it against the logged in user...

Periodically calling TinyMCE's triggerSave function

If anyone knows TinyMCE well, do you know if it has built-in support for periodically calling its triggerSave function?
(This function copies it's content to its "parent" textarea. I want to observe said textarea for changes so I can implement autosave.)
Thanks
Don't try autosave, trust me on this one. triggerSave is buggy and when it fails it fails silently so you think that your content got posted, but in reality it didn't. After it fails once it will no longer work for the rest of the session, as in until the page is manually reloaded and tinymce does another full init().
Just got bit by this one badly, again. Never again trust triggerSave.
You could easily do this yourself by using JavaScript's setTimeout() function.
See http://www.w3schools.com/js/js_timing.asp.