Set link dialog to open in blank by default - wordpress

I'm trying to find a way to set the link option to open in a new window by default. I found this clever plugin but it is outdated.
https://github.com/whyisjake/new-tab-always/blob/master/new-tab-always.php
I attempted to update it myself but it seems that the id's and classes aren't very consistent so doing it with JS might not be the best route.
Is there a hook or something available?

Related

Adding a button on web debug tool bar symfony2 createbundle

I want to add a new button on the top web debug toolbar. I would be using that button to create a copy of that particular page and save it with another name.
I have been searching but couldnt find a solution. It seems that its possible but i haven't had any success yet.
Thanks
I don't really know what you want to do with that "button" and why you need it, but it is written in the doku, how the create a custom datacollector
http://symfony.com/doc/current/cookbook/profiler/data_collector.html

Adobe Extendscript Photoshop Guides Visibility

Is there a way via extendscript (jsx) to get the visibility status of Photoshop' guides?
The code to show and hide the guides is the same code as it 'toggles' the guides on or off so it must know the status when this code is executed, but how do I get at it?
I appreciate this could be done via a preference switch but that seems an awkward hack for something this simple, especially as something somewhere must be accessing this 'property' during execution of the 'toggle' code.
What would be great is to have activeDocument.guides.visible property, returning either true or false. Is there anything like that?
EDIT:
OK. Further investigation reveals that creating a guide using guides.add does not automatically toggle guides ON, however, using the code generated via the scriptListener does.
I would rather use guides.add as its only one line of code compared to fourteen so in order to toggle the guides to ON I thought I could run a function that created and then deleted a guide using the scriptListener code during the onLoad of the HTML.
This works great, except getting this function to run only when a document is opened is now the new problem.
documentAfterActivate is supposed to be the code to do this except it doesn't work unless a flash panel such as kuler is opened first.
So the question now is really what part of the flash code is allowing documentAfterActivate to work properly and how can I use it in my code instead of opening a flash panel I don't need?
It doesn't look like you've got a direct toggle option. You'd need to record the position of the guides somewhere and use script listener code to clear them when you wanted to toggle them off and use the add method on the Guides object to re-add them.
Keep in mind that even getting to the guide position via the photoshop DOM wasn't avail before CS4 I think? maybe CS5.
And i realised I just mis-read your question quite a bit. Anyway, this way you'd also know if the guides were visible based on whether or not they are there :) But yes, it isn't as nice as it could be.
The solution:
As stated, the workaround is to create and delete a guide with the fourteen lines of code from the scriptListener.
This toggles the guide visibility to ON regardless of its current state.
I can then save this status as a preference using putCustomOptions.
A function to do this is fired during the onLoad of the HTML but only when a document is opened otherwise guide creation fails.
documentAfterActivate does not work as expected unless a further flash panel (such as Kuler) is also opened beforehand.
An alternative to documentAfterActivate is to register the open event using CSevent instead.
The code can be found HERE.

plonetruegallery: Download link or button, so users can download a viewed image?

I use collective.plonetruegallery for image galleries within Plone and I like it. However, what I miss is a "download" button or a simple "link" in order to let users actually download a image. The "Galleria" display view of plonetruegallery does seem to offer such a link/button -- does any of the other display views? Or any other solution whithout having to hack the plonetruegallery addon myself?
I know that you can right click and then choose "download image" among several other options within your preferred browser -- however, for a dumb user to cumbersome ;)
I have added an option to collective.ptg.contactsheet (1.1.2) that let you choose between going to the content or downloading it.
Espen
There's not a built-in "feature" to do this. You can see which of the gallery views might have this; looks like you've already found one. I'm sure you could easily customize another one to include such a link, simply by following the example in Galleria.
This is quite easy to make. The url to download the image would probably be:
/path/to/image/download
One option could be to just add an action.
If you want to have this for a specific gallery, I can probably fix it.
(go to https://github.com/collective/collective.ptg.contactsheet or whatever gallerytype you want it for and add an "Issue"
Espen

Open a URL in a certain browser tab/window

From within my Qt application, I would like to open URLs repeatedly in the same browser tab/window. (Kind of "refreshing" this tab programmatically)
Using
QDesktopServices::openUrl(QUrl("http://www.domain.tld"));
opens a new tab/window for every call. Is there a possibility to add a "target=" parameter somewhere?
What you are asking for is impossible to do in the way you imagine it. openUrl() uses the operating system to specify the program to open the argument as mentioned in its documentation.
There might be some workarounds, but none of them will work well, or work on all browsers. It's just that this kind of fine-grained control is likely to be impossible for you.
If you want control of a tab in a browser, you could find the window represented by that tab and close it right before opening the new one. This solution is kind of hacky.
Another hacky solution is to find the HWND of the edit box holding the URL, and to try changing its text using SendMessage(). This won't work on Chrome, however, as it does not use a separate control for the URL window. It might work on Firefox or IE.
The better solution is to make your own web browser you control using the Qt WebKit. It is pretty easy to render a page in it and change the url viewed. The QWebView is an easy to use implementation of the QtWebKit.
Maybe you will found this usefull:
You can open the webpage and the reload the active tab.
If you supply the name of the browser as an argument, it'll find and reload the current page
https://unix.stackexchange.com/questions/37258/refresh-reload-active-browser-tab-from-command-line

How to change the included CSS files on button click?

I would like to implement the application where user can include the different CSS files when clicked on different buttons. Please let me know how this can be achieved. I don't want to use the theme feature.
I am trying to change the CSS but I have noticed the ungly behaviour as follows:
When using mozilla i see the source
code for page i see code for latest
CSS.
But its not getting downloaded/ tried using the tamper data request to download CSS is not getting sent.
When I inspect the elements style is still the old file
Any idea what could be causing this? Please let me know how to get this working. Desperately looking for a solution.
Can this be done nicely using the ScriptManager control ?
To change styles on the client-side, you need to programmably change the reference to the stylesheet, which would work. However, you wouldn't see this changed in the view source... view source isn't a running document, inspecting all the changes made by JavaScript... so that can be a pain.
Firebug is pretty good, but again, even with Firefox/FireBug, IE dev tools, certain things don't get updated, depending on what you are doing.
So did you write some code and you are not seeing the changes directly, or you see the changes but you can't verify them?
HTH.
In this case I would use xmlHttpRequest with GET verb in order to obtain the needed CSS file from a dedicated handler. Pass the name of the style sheet that you need to request as a query string argument. I suggest that you fire the request dynamically, on click of the button who should download the respective CSS file.

Resources