Feature #17003

Add the js openPic-function to core-js

Added by Georg Ringer about 14 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2007-02-17
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

the onclick-popup for Images in Extensions needs the function which is only in FE available if there are any content elements ("Image only", "text with image") present.

So I need to add this script to every extension where I need it

externalisation would also be fine, bug #0002857

function openPic(url,winName,winParams) {
var theWindow = window.open(url,winName,winParams);
if (theWindow) {theWindow.focus();}
}
(issue imported from #M5011)


Related issues

Related to TYPO3 Core - Bug #15816: openPic() and config.removeDefaultJS = externalClosed2006-03-13

Actions
Related to TYPO3 Core - Feature #15889: Clean up inline javascript in menu_layers.phpRejected2006-03-23

Actions
#1

Updated by Oliver Hader about 14 years ago

You could do this by using TypoScript. In your extension you can use $this->cObj->cObjGetSingle(...) or $this->cObj->cImage(...).

See the following specific example...
TypoScript:
plugin.tx_myext_pi1 {
image {
file {
maxW = 100
maxH = 100
}
imageLinkWrap < tt_content.image.20.1.imageLinkWrap
imageLinkWrap.enable >
imageLinkWrap.enable = 1
}
}

Plugin PHP:
$image = $this->cObj->cImage($uploadDir.$imageSrc, $conf['image.']);

#2

Updated by Oliver Hader about 14 years ago

Or if you just want the openPic, you can just call
$GLOBALS['TSFE']->setJS('openPic');
The JavaScript code will then be inserted automatically once.

#3

Updated by Georg Ringer about 14 years ago

Thanks Oliver for this code lesson! ;)

so if you don't see a need to include the function by default, then please close the bug

georg

#4

Updated by Clemens Riccabona about 14 years ago

Nice to now, thanx Oliver. But for me it is a general problem to have all these javascripts in the head of the html.

We should think about putting all this stuff to a global javascript file.

config.removeDefaultJS = external

works great, but badly just for the blur script. So a general solution for that problem would be nice. (with the layermenus i have a QD hack also published on my website -> riccabona.info probably there is someone around who wants to have a look at it, how to make it a better way ...).

But all in all these are missing features, an not bugs, I think. ;)

#5

Updated by Oliver Hader about 14 years ago

@Clemens: You're right... Putting them into a separate JS file would be nice. I could imagine a static JS object that could be configured using JSON.
Please open a new feature-request here in the bugtracker and describe the problem and also add your patch/hack for the layermenus.

#6

Updated by Clemens Riccabona almost 14 years ago

I reported the problem and included my quick and dirty solution a year ago! ;)

http://bugs.typo3.org/view.php?id=2970

#7

Updated by Alexander Opitz almost 8 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)
  • PHP Version deleted (4)

As this report is very old, is the handling in newer TYPO3 CMS Versions (like 6.0/6.1) more like you expect it?

#8

Updated by Alexander Opitz over 7 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Also available in: Atom PDF