[TYPO3-dam-devel] RFC Bugfix: 5681: Link Popup javascript error when changing DAM directory in File selection
Michiel Roos
michiel at netcreators.com
Mon May 5 21:35:39 CEST 2008
excellent!
+1
:-)
On May 4, 2008, at 1:14 AM, Benjamin Mack wrote:
> Hey all,
>
> take 2. I changed the JS check to proper Javascript after discussing
> with a JS expert.
>
> before: if (!jumpToUrl)
> after: if (jumpToUrl == undefined)
>
> See [1] for more information.
>
> BTW: The first patch works as well :)
>
> [1] http://saladwithsteve.com/2008/02/javascript-undefined-vs-
> null.html
>
> --
> greetings,
> benni.
> -SDG-
> Index: lib/class.tx_dam_scbase.php
> ===================================================================
> --- lib/class.tx_dam_scbase.php (revision 9058)
> +++ lib/class.tx_dam_scbase.php (working copy)
> @@ -466,10 +466,20 @@
> var script_ended = 0;
> var changed = 0;';
>
> - $this->doc->JScodeArray['jumpToUrl'] = '
> - function jumpToUrl(URL) {
> - document.location.href = URL;
> - }';
> + // we first want to check if jumpTourl was set already,
> + // and check this twice (in case rtehtmlarea decides to use
> + // JScodeArray as well later on, we don't want to react again)
> + // the second check is done in javascript to not define jumpToUrl
> + // twice (= overriding the initial function)
> + if (!isset($this->doc->JScodeArray['jumpToUrl'])) {
> + $this->doc->JScodeArray['jumpToUrl'] = '
> + if (jumpToUrl == undefined) {
> + function jumpToUrl(URL) {
> + document.location.href = URL;
> + }
> + }
> + ';
> + }
>
> $this->doc->JScodeArray['jumpExt'] = '
> function jumpExt(URL,anchor) {
> @@ -1981,4 +1991,4 @@
> include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dam/lib/
> class.tx_dam_scbase.php']);
> }
>
> -?>
> \ No newline at end of file
> +?>
> _______________________________________________
> Before posting to this list, please have a look to the posting rules
> on the following websites:
>
> http://typo3.org/teams/core/core-mailinglist-rules/
> http://typo3.org/development/bug-fixing/diff-and-patch/
> _______________________________________________
> TYPO3-team-dam mailing list
> TYPO3-team-dam at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-dam
Met vriendelijke groet,
Michiel Roos
Netcreators BV :: creation and innovation
www.netcreators.com
Interesse in werken bij Netcreators?
http://www.netcreators.com/bedrijf/vacatures/
More information about the TYPO3-team-dam
mailing list