| Index: trunk/phase3/maintenance/parserTests.txt |
| — | — | @@ -2946,7 +2946,7 @@ |
| 2947 | 2947 | !! input |
| 2948 | 2948 | [[Image:foobar.jpg]] |
| 2949 | 2949 | !! result |
| 2950 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img alt="Image:foobar.jpg" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 2950 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img alt="Image:foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 2951 | 2951 | </p> |
| 2952 | 2952 | !! end |
| 2953 | 2953 | |
| — | — | @@ -2955,7 +2955,7 @@ |
| 2956 | 2956 | !! input |
| 2957 | 2957 | [[Image:foobar.jpg|right]] |
| 2958 | 2958 | !! result |
| 2959 | | -<div class="floatright"><span><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title=""><img alt="" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></span></div> |
| | 2959 | +<div class="floatright"><span><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a></span></div> |
| 2960 | 2960 | |
| 2961 | 2961 | !! end |
| 2962 | 2962 | |
| — | — | @@ -2964,7 +2964,7 @@ |
| 2965 | 2965 | !! input |
| 2966 | 2966 | [[Image:foobar.jpg|right|Caption text]] |
| 2967 | 2967 | !! result |
| 2968 | | -<div class="floatright"><span><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></span></div> |
| | 2968 | +<div class="floatright"><span><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a></span></div> |
| 2969 | 2969 | |
| 2970 | 2970 | !! end |
| 2971 | 2971 | |
| — | — | @@ -2973,7 +2973,7 @@ |
| 2974 | 2974 | !! input |
| 2975 | 2975 | [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]] |
| 2976 | 2976 | !! result |
| 2977 | | -<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="This is a test image Main Page"><img alt="This is a test image Main Page" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> <div class="thumbcaption">This is a test image <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div> |
| | 2977 | +<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="This is a test image Main Page"><img alt="This is a test image Main Page" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div> |
| 2978 | 2978 | |
| 2979 | 2979 | !! end |
| 2980 | 2980 | |
| — | — | @@ -2993,7 +2993,7 @@ |
| 2994 | 2994 | !! input |
| 2995 | 2995 | [[Image:foobar.jpg|http://example.com]] |
| 2996 | 2996 | !! result |
| 2997 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="http://example.com"><img alt="http://example.com" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 2997 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="http://example.com"><img alt="http://example.com" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 2998 | 2998 | </p> |
| 2999 | 2999 | !! end |
| 3000 | 3000 | |
| — | — | @@ -3002,7 +3002,7 @@ |
| 3003 | 3003 | !! input |
| 3004 | 3004 | [[Image:foobar.jpg|thumb|http://example.com]] |
| 3005 | 3005 | !! result |
| 3006 | | -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="http://example.com"><img alt="http://example.com" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a></div></div></div> |
| | 3006 | +<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="http://example.com"><img alt="http://example.com" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" border="0" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a></div></div></div> |
| 3007 | 3007 | |
| 3008 | 3008 | !! end |
| 3009 | 3009 | |
| — | — | @@ -3011,7 +3011,7 @@ |
| 3012 | 3012 | !! input |
| 3013 | 3013 | [[Image:foobar.jpg|thumb|ISBN 1235467890]] |
| 3014 | 3014 | !! result |
| 3015 | | -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="ISBN 1235467890"><img alt="ISBN 1235467890" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="https://www.mediawiki.org/index.php?title=Special:Booksources&isbn=1235467890" class="internal">ISBN 1235467890</a></div></div></div> |
| | 3015 | +<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="ISBN 1235467890"><img alt="ISBN 1235467890" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" border="0" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="https://www.mediawiki.org/index.php?title=Special:Booksources&isbn=1235467890" class="internal">ISBN 1235467890</a></div></div></div> |
| 3016 | 3016 | |
| 3017 | 3017 | !! end |
| 3018 | 3018 | |
| — | — | @@ -3020,7 +3020,7 @@ |
| 3021 | 3021 | !! input |
| 3022 | 3022 | [[Image:foobar.jpg|thumb|This is RFC 12354]] |
| 3023 | 3023 | !! result |
| 3024 | | -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="This is RFC 12354"><img alt="This is RFC 12354" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a href="http://tools.ietf.org/html/rfc12354" class="external" title="http://tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div> |
| | 3024 | +<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="This is RFC 12354"><img alt="This is RFC 12354" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" border="0" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a href="http://tools.ietf.org/html/rfc12354" class="external" title="http://tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div> |
| 3025 | 3025 | |
| 3026 | 3026 | !! end |
| 3027 | 3027 | |
| — | — | @@ -3029,7 +3029,7 @@ |
| 3030 | 3030 | !! input |
| 3031 | 3031 | [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] |
| 3032 | 3032 | !! result |
| 3033 | | -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Please mailto:nobody@example.com"><img alt="Please mailto:nobody@example.com" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Please <a href="mailto:nobody@example.com" class="external free" title="mailto:nobody@example.com" rel="nofollow">mailto:nobody@example.com</a></div></div></div> |
| | 3033 | +<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Please mailto:nobody@example.com"><img alt="Please mailto:nobody@example.com" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" border="0" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Please <a href="mailto:nobody@example.com" class="external free" title="mailto:nobody@example.com" rel="nofollow">mailto:nobody@example.com</a></div></div></div> |
| 3034 | 3034 | |
| 3035 | 3035 | !! end |
| 3036 | 3036 | |
| — | — | @@ -3039,7 +3039,7 @@ |
| 3040 | 3040 | !! input |
| 3041 | 3041 | [[Image:foobar.jpg|thumb|<math>2+2</math>]] |
| 3042 | 3042 | !! result |
| 3043 | | -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="<math>2+2</math>"><img alt="<math>2+2</math>" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><math>2+2</math></div></div></div> |
| | 3043 | +<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="<math>2+2</math>"><img alt="<math>2+2</math>" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" border="0" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><math>2+2</math></div></div></div> |
| 3044 | 3044 | |
| 3045 | 3045 | !! end |
| 3046 | 3046 | |
| — | — | @@ -3050,7 +3050,7 @@ |
| 3051 | 3051 | !! input |
| 3052 | 3052 | [[Image:foobar.jpg|thumb|<math>2+2</math>]] |
| 3053 | 3053 | !! result |
| 3054 | | -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="2 + 2"><img alt="2 + 2" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><span class="texhtml">2 + 2</span></div></div></div> |
| | 3054 | +<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="2 + 2"><img alt="2 + 2" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" border="0" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><span class="texhtml">2 + 2</span></div></div></div> |
| 3055 | 3055 | |
| 3056 | 3056 | !! end |
| 3057 | 3057 | |
| — | — | @@ -3060,7 +3060,7 @@ |
| 3061 | 3061 | !! input |
| 3062 | 3062 | [[Image:foobar.jpg|text with a [[link]] in it]] |
| 3063 | 3063 | !! result |
| 3064 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 3064 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 3065 | 3065 | </p> |
| 3066 | 3066 | !! end |
| 3067 | 3067 | |
| — | — | @@ -3069,7 +3069,7 @@ |
| 3070 | 3070 | !! input |
| 3071 | 3071 | [[Image:foobar.jpg|text with a [[link]]foo in it]] |
| 3072 | 3072 | !! result |
| 3073 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="text with a linkfoo in it"><img alt="text with a linkfoo in it" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 3073 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="text with a linkfoo in it"><img alt="text with a linkfoo in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 3074 | 3074 | </p> |
| 3075 | 3075 | !! end |
| 3076 | 3076 | |
| — | — | @@ -3078,7 +3078,7 @@ |
| 3079 | 3079 | !! input |
| 3080 | 3080 | [[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]] |
| 3081 | 3081 | !! result |
| 3082 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="text with a MeatBall:Link in it"><img alt="text with a MeatBall:Link in it" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 3082 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="text with a MeatBall:Link in it"><img alt="text with a MeatBall:Link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 3083 | 3083 | </p> |
| 3084 | 3084 | !! end |
| 3085 | 3085 | |
| — | — | @@ -3087,7 +3087,7 @@ |
| 3088 | 3088 | !! input |
| 3089 | 3089 | [[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]] |
| 3090 | 3090 | !! result |
| 3091 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 3091 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 3092 | 3092 | </p> |
| 3093 | 3093 | !! end |
| 3094 | 3094 | |
| — | — | @@ -3096,7 +3096,7 @@ |
| 3097 | 3097 | !! input |
| 3098 | 3098 | [[Image:foobar.jpg|& < > "]] |
| 3099 | 3099 | !! result |
| 3100 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="& < > ""><img alt="& < > "" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 3100 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="& < > ""><img alt="& < > "" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 3101 | 3101 | </p> |
| 3102 | 3102 | !! end |
| 3103 | 3103 | |
| — | — | @@ -3105,7 +3105,7 @@ |
| 3106 | 3106 | !! input |
| 3107 | 3107 | [[Image:foobar.jpg|♀]] |
| 3108 | 3108 | !! result |
| 3109 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="♀"><img alt="♀" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 3109 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="♀"><img alt="♀" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 3110 | 3110 | </p> |
| 3111 | 3111 | !! end |
| 3112 | 3112 | |
| — | — | @@ -3123,7 +3123,7 @@ |
| 3124 | 3124 | !! input |
| 3125 | 3125 | [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] |
| 3126 | 3126 | !! result |
| 3127 | | -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="This is a caption with another Image:Icon.png inside it!"><img alt="This is a caption with another Image:Icon.png inside it!" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is a caption with another <a href="https://www.mediawiki.org/index.php?title=Special:Upload&wpDestFile=Icon.png" class="new" title="Image:Icon.png">Image:Icon.png</a> inside it!</div></div></div> |
| | 3127 | +<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="This is a caption with another Image:Icon.png inside it!"><img alt="This is a caption with another Image:Icon.png inside it!" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" border="0" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is a caption with another <a href="https://www.mediawiki.org/index.php?title=Special:Upload&wpDestFile=Icon.png" class="new" title="Image:Icon.png">Image:Icon.png</a> inside it!</div></div></div> |
| 3128 | 3128 | |
| 3129 | 3129 | !! end |
| 3130 | 3130 | |
| — | — | @@ -3133,7 +3133,7 @@ |
| 3134 | 3134 | [[Image:Foobar.jpg|This |
| 3135 | 3135 | *is some text]] |
| 3136 | 3136 | !! result |
| 3137 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="This *is some text"><img alt="This *is some text" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 3137 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="This *is some text"><img alt="This *is some text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 3138 | 3138 | </p> |
| 3139 | 3139 | !!end |
| 3140 | 3140 | |
| — | — | @@ -3143,7 +3143,7 @@ |
| 3144 | 3144 | !! input |
| 3145 | 3145 | [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]] |
| 3146 | 3146 | !! result |
| 3147 | | -<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="This caption has irc and Secure ext links in it."><img alt="This caption has irc and Secure ext links in it." longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This caption has <a href="irc://example.net" class="external text" title="irc://example.net" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" title="https://example.com" rel="nofollow">Secure</a> ext links in it.</div></div></div> |
| | 3147 | +<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="This caption has irc and Secure ext links in it."><img alt="This caption has irc and Secure ext links in it." src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" border="0" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This caption has <a href="irc://example.net" class="external text" title="irc://example.net" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" title="https://example.com" rel="nofollow">Secure</a> ext links in it.</div></div></div> |
| 3148 | 3148 | |
| 3149 | 3149 | !! end |
| 3150 | 3150 | |
| — | — | @@ -3503,7 +3503,7 @@ |
| 3504 | 3504 | !! input |
| 3505 | 3505 | http://example.com [[Image:foobar.jpg]] |
| 3506 | 3506 | !! result |
| 3507 | | -<p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a> <a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img alt="Image:foobar.jpg" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 3507 | +<p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a> <a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img alt="Image:foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 3508 | 3508 | </p> |
| 3509 | 3509 | !!end |
| 3510 | 3510 | |
| — | — | @@ -3512,7 +3512,7 @@ |
| 3513 | 3513 | !! input |
| 3514 | 3514 | http://example.com[[Image:foobar.jpg]] |
| 3515 | 3515 | !! result |
| 3516 | | -<p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img alt="Image:foobar.jpg" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| | 3516 | +<p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img alt="Image:foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a> |
| 3517 | 3517 | </p> |
| 3518 | 3518 | !!end |
| 3519 | 3519 | |
| — | — | @@ -4787,7 +4787,7 @@ |
| 4788 | 4788 | !!input |
| 4789 | 4789 | [[Image:foobar.jpg|thumbnail= ]] |
| 4790 | 4790 | !!result |
| 4791 | | -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title=""><img alt="" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div></div></div></div> |
| | 4791 | +<div class="thumb tright"><div class="thumbinner" style="width:1943px;">Error creating thumbnail: <div class="thumbcaption"></div></div></div> |
| 4792 | 4792 | |
| 4793 | 4793 | !!end |
| 4794 | 4794 | |
| — | — | @@ -6080,7 +6080,7 @@ |
| 6081 | 6081 | !! input |
| 6082 | 6082 | [[Image:foobar.jpg|centre]] |
| 6083 | 6083 | !! result |
| 6084 | | -<div class="center"><div class="floatnone"><span><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title=""><img alt="" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></span></div></div> |
| | 6084 | +<div class="center"><div class="floatnone"><span><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a></span></div></div> |
| 6085 | 6085 | |
| 6086 | 6086 | !!end |
| 6087 | 6087 | |
| — | — | @@ -6089,7 +6089,7 @@ |
| 6090 | 6090 | !! input |
| 6091 | 6091 | [[Image:foobar.jpg|none]] |
| 6092 | 6092 | !! result |
| 6093 | | -<div class="floatnone"><span><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title=""><img alt="" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></span></div> |
| | 6093 | +<div class="floatnone"><span><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" border="0" /></a></span></div> |
| 6094 | 6094 | |
| 6095 | 6095 | !!end |
| 6096 | 6096 | |
| — | — | @@ -6098,7 +6098,7 @@ |
| 6099 | 6099 | !! input |
| 6100 | 6100 | [[Image:foobar.jpg|640x480px]] |
| 6101 | 6101 | !! result |
| 6102 | | -<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title=""><img alt="" longdesc="/wiki/Image:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a> |
| | 6102 | +<p><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" border="0" /></a> |
| 6103 | 6103 | </p> |
| 6104 | 6104 | !!end |
| 6105 | 6105 | |
| — | — | @@ -6136,7 +6136,7 @@ |
| 6137 | 6137 | !! input |
| 6138 | 6138 | [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|¶m2=|x external] URL]] |
| 6139 | 6139 | !! result |
| 6140 | | -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="An external URL"><img alt="An external URL" longdesc="/wiki/Image:Foobar.jpg" class="thumbimage" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>An <a href="http://test/?param1=|left|&param2=|x" class="external text" title="http://test/?param1=|left|&param2=|x" rel="nofollow">external</a> URL</div></div></div> |
| | 6140 | +<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="image" title="An external URL"><img alt="An external URL" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" border="0" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>An <a href="http://test/?param1=|left|&param2=|x" class="external text" title="http://test/?param1=|left|&param2=|x" rel="nofollow">external</a> URL</div></div></div> |
| 6141 | 6141 | |
| 6142 | 6142 | !!end |
| 6143 | 6143 | |
| Index: trunk/phase3/includes/ImagePage.php |
| — | — | @@ -242,14 +242,13 @@ |
| 243 | 243 | $wgOut->addHTML( '<table class="multipageimage"><tr><td>' ); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | | - $imgAttribs = array( |
| 247 | | - 'border' => 0, |
| 248 | | - 'alt' => $this->img->getTitle()->getPrefixedText() |
| 249 | | - ); |
| 250 | | - |
| 251 | 246 | if ( $thumbnail ) { |
| | 247 | + $options = array( |
| | 248 | + 'alt' => $this->img->getTitle()->getPrefixedText(), |
| | 249 | + 'file-link' => true, |
| | 250 | + ); |
| 252 | 251 | $wgOut->addHTML( '<div class="fullImageLink" id="file">' . |
| 253 | | - $thumbnail->toHtml( $imgAttribs, $linkAttribs ) . |
| | 252 | + $thumbnail->toHtml( $options ) . |
| 254 | 253 | $anchorclose . '</div>' ); |
| 255 | 254 | } |
| 256 | 255 | |
| — | — | @@ -297,9 +296,9 @@ |
| 298 | 297 | if ($this->img->isSafeFile()) { |
| 299 | 298 | $icon= $this->img->iconThumb(); |
| 300 | 299 | |
| 301 | | - $wgOut->addHTML( '<div class="fullImageLink" id="file"><a href="' . $full_url . '">' . |
| 302 | | - $icon->toHtml() . |
| 303 | | - '</a></div>' ); |
| | 300 | + $wgOut->addHTML( '<div class="fullImageLink" id="file">' . |
| | 301 | + $icon->toHtml( array( 'desc-link' => true ) ) . |
| | 302 | + '</div>' ); |
| 304 | 303 | } |
| 305 | 304 | |
| 306 | 305 | $showLink = true; |
| Index: trunk/phase3/includes/Linker.php |
| — | — | @@ -566,33 +566,13 @@ |
| 567 | 567 | $thumb = false; |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | | - if ( $page ) { |
| 571 | | - $query = 'page=' . urlencode( $page ); |
| 572 | | - } else { |
| 573 | | - $query = ''; |
| 574 | | - } |
| 575 | | - $url = $title->getLocalURL( $query ); |
| 576 | | - $imgAttribs = array( |
| 577 | | - 'alt' => $fp['alt'], |
| 578 | | - 'longdesc' => $url |
| 579 | | - ); |
| 580 | | - |
| 581 | | - if ( isset( $fp['valign'] ) ) { |
| 582 | | - $imgAttribs['style'] = "vertical-align: {$fp['valign']}"; |
| 583 | | - } |
| 584 | | - if ( isset( $fp['border'] ) ) { |
| 585 | | - $imgAttribs['class'] = "thumbborder"; |
| 586 | | - } |
| 587 | | - $linkAttribs = array( |
| 588 | | - 'href' => $url, |
| 589 | | - 'class' => 'image', |
| 590 | | - 'title' => $fp['alt'] |
| 591 | | - ); |
| 592 | | - |
| 593 | 570 | if ( !$thumb ) { |
| 594 | 571 | $s = $this->makeBrokenImageLinkObj( $title ); |
| 595 | 572 | } else { |
| 596 | | - $s = $thumb->toHtml( $imgAttribs, $linkAttribs ); |
| | 573 | + $s = $thumb->toHtml( array( |
| | 574 | + 'desc-link' => true, |
| | 575 | + 'alt' => $fp['alt'], |
| | 576 | + 'valign' => isset( $fp['valign'] ) ? $fp['valign'] : false ) ); |
| 597 | 577 | } |
| 598 | 578 | if ( '' != $fp['align'] ) { |
| 599 | 579 | $s = "<div class=\"float{$fp['align']}\"><span>{$s}</span></div>"; |
| — | — | @@ -684,18 +664,10 @@ |
| 685 | 665 | $s .= htmlspecialchars( wfMsg( 'thumbnail_error', '' ) ); |
| 686 | 666 | $zoomicon = ''; |
| 687 | 667 | } else { |
| 688 | | - $imgAttribs = array( |
| | 668 | + $s .= $thumb->toHtml( array( |
| 689 | 669 | 'alt' => $fp['alt'], |
| 690 | | - 'longdesc' => $url, |
| 691 | | - 'class' => 'thumbimage' |
| 692 | | - ); |
| 693 | | - $linkAttribs = array( |
| 694 | | - 'href' => $url, |
| 695 | | - 'class' => 'internal', |
| 696 | | - 'title' => $fp['alt'] |
| 697 | | - ); |
| 698 | | - |
| 699 | | - $s .= $thumb->toHtml( $imgAttribs, $linkAttribs ); |
| | 670 | + 'img-class' => 'thumbimage', |
| | 671 | + 'desc-link' => true ) ); |
| 700 | 672 | if ( isset( $fp['framed'] ) ) { |
| 701 | 673 | $zoomicon=""; |
| 702 | 674 | } else { |
| Index: trunk/phase3/includes/filerepo/File.php |
| — | — | @@ -559,7 +559,7 @@ |
| 560 | 560 | $path = '/common/images/icons/' . $icon; |
| 561 | 561 | $filepath = $wgStyleDirectory . $path; |
| 562 | 562 | if( file_exists( $filepath ) ) { |
| 563 | | - return new ThumbnailImage( $wgStylePath . $path, 120, 120 ); |
| | 563 | + return new ThumbnailImage( $this, $wgStylePath . $path, 120, 120 ); |
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 | return null; |
| Index: trunk/phase3/includes/SpecialUpload.php |
| — | — | @@ -481,8 +481,8 @@ |
| 482 | 482 | $file->getName(), 'right', array(), false, true ); |
| 483 | 483 | } elseif ( !$file->allowInlineDisplay() && $file->isSafeFile() ) { |
| 484 | 484 | $icon = $file->iconThumb(); |
| 485 | | - $dlink2 = '<div style="float:right" id="mw-media-icon"><a href="' . $file->getURL() . '">' . |
| 486 | | - $icon->toHtml() . '</a><br />' . $dlink . '</div>'; |
| | 485 | + $dlink2 = '<div style="float:right" id="mw-media-icon">' . |
| | 486 | + $icon->toHtml( array( 'desc-link' => true ) ) . '<br />' . $dlink . '</div>'; |
| 487 | 487 | } else { |
| 488 | 488 | $dlink2 = ''; |
| 489 | 489 | } |
| — | — | @@ -498,8 +498,8 @@ |
| 499 | 499 | $nt_lc->getText(), 'right', array(), false, true ); |
| 500 | 500 | } elseif ( !$file_lc->allowInlineDisplay() && $file_lc->isSafeFile() ) { |
| 501 | 501 | $icon = $file_lc->iconThumb(); |
| 502 | | - $dlink2 = '<div style="float:right" id="mw-media-icon"><a href="' . $file_lc->getURL() . '">' . |
| 503 | | - $icon->toHtml() . '</a><br />' . $dlink . '</div>'; |
| | 502 | + $dlink2 = '<div style="float:right" id="mw-media-icon">' . |
| | 503 | + $icon->toHtml( array( 'desc-link' => true ) ) . '<br />' . $dlink . '</div>'; |
| 504 | 504 | } else { |
| 505 | 505 | $dlink2 = ''; |
| 506 | 506 | } |
| — | — | @@ -522,8 +522,8 @@ |
| 523 | 523 | $nt_thb->getText(), 'right', array(), false, true ); |
| 524 | 524 | } elseif ( !$file_thb->allowInlineDisplay() && $file_thb->isSafeFile() ) { |
| 525 | 525 | $icon = $file_thb->iconThumb(); |
| 526 | | - $dlink2 = '<div style="float:right" id="mw-media-icon"><a href="' . |
| 527 | | - $file_thb->getURL() . '">' . $icon->toHtml() . '</a><br />' . |
| | 526 | + $dlink2 = '<div style="float:right" id="mw-media-icon">' . |
| | 527 | + $icon->toHtml( array( 'desc-link' => true ) ) . '<br />' . |
| 528 | 528 | $dlink . '</div>'; |
| 529 | 529 | } else { |
| 530 | 530 | $dlink2 = ''; |
| Index: trunk/phase3/includes/media/Bitmap.php |
| — | — | @@ -58,7 +58,7 @@ |
| 59 | 59 | if ( $physicalWidth == $srcWidth && $physicalHeight == $srcHeight ) { |
| 60 | 60 | # normaliseParams (or the user) wants us to return the unscaled image |
| 61 | 61 | wfDebug( __METHOD__.": returning unscaled image\n" ); |
| 62 | | - return new ThumbnailImage( $image->getURL(), $clientWidth, $clientHeight, $srcPath ); |
| | 62 | + return new ThumbnailImage( $image, $image->getURL(), $clientWidth, $clientHeight, $srcPath ); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | if ( !$dstPath ) { |
| — | — | @@ -77,11 +77,11 @@ |
| 78 | 78 | if ( $scaler == 'client' ) { |
| 79 | 79 | # Client-side image scaling, use the source URL |
| 80 | 80 | # Using the destination URL in a TRANSFORM_LATER request would be incorrect |
| 81 | | - return new ThumbnailImage( $image->getURL(), $clientWidth, $clientHeight, $srcPath ); |
| | 81 | + return new ThumbnailImage( $image, $image->getURL(), $clientWidth, $clientHeight, $srcPath ); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | if ( $flags & self::TRANSFORM_LATER ) { |
| 85 | | - return new ThumbnailImage( $dstUrl, $clientWidth, $clientHeight, $dstPath ); |
| | 85 | + return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath ); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | if ( !wfMkdirParents( dirname( $dstPath ) ) ) { |
| — | — | @@ -201,7 +201,7 @@ |
| 202 | 202 | wfHostname(), $retval, trim($err), $cmd ) ); |
| 203 | 203 | return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err ); |
| 204 | 204 | } else { |
| 205 | | - return new ThumbnailImage( $dstUrl, $clientWidth, $clientHeight, $dstPath ); |
| | 205 | + return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath ); |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
| Index: trunk/phase3/includes/media/Generic.php |
| — | — | @@ -349,7 +349,8 @@ |
| 350 | 350 | return false; |
| 351 | 351 | } |
| 352 | 352 | $url = $script . '&' . wfArrayToCGI( $this->getScriptParams( $params ) ); |
| 353 | | - return new ThumbnailImage( $url, $params['width'], $params['height'] ); |
| | 353 | + $page = isset( $params['page'] ) ? $params['page'] : false; |
| | 354 | + return new ThumbnailImage( $image, $url, $params['width'], $params['height'], $page ); |
| 354 | 355 | } |
| 355 | 356 | |
| 356 | 357 | /** |
| Index: trunk/phase3/includes/media/SVG.php |
| — | — | @@ -49,7 +49,7 @@ |
| 50 | 50 | $srcPath = $image->getPath(); |
| 51 | 51 | |
| 52 | 52 | if ( $flags & self::TRANSFORM_LATER ) { |
| 53 | | - return new ThumbnailImage( $dstUrl, $clientWidth, $clientHeight, $dstPath ); |
| | 53 | + return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath ); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if ( !wfMkdirParents( dirname( $dstPath ) ) ) { |
| — | — | @@ -80,7 +80,7 @@ |
| 81 | 81 | wfHostname(), $retval, trim($err), $cmd ) ); |
| 82 | 82 | return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err ); |
| 83 | 83 | } else { |
| 84 | | - return new ThumbnailImage( $dstUrl, $clientWidth, $clientHeight, $dstPath ); |
| | 84 | + return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath ); |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| Index: trunk/phase3/includes/media/DjVu.php |
| — | — | @@ -83,7 +83,7 @@ |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | if ( $flags & self::TRANSFORM_LATER ) { |
| 87 | | - return new ThumbnailImage( $dstUrl, $width, $height, $dstPath ); |
| | 87 | + return new ThumbnailImage( $image, $dstUrl, $width, $height, $dstPath, $page ); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | if ( !wfMkdirParents( dirname( $dstPath ) ) ) { |
| — | — | @@ -110,7 +110,7 @@ |
| 111 | 111 | wfHostname(), $retval, trim($err), $cmd ) ); |
| 112 | 112 | return new MediaTransformError( 'thumbnail_error', $width, $height, $err ); |
| 113 | 113 | } else { |
| 114 | | - return new ThumbnailImage( $dstUrl, $width, $height, $dstPath ); |
| | 114 | + return new ThumbnailImage( $image, $dstUrl, $width, $height, $dstPath, $page ); |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| Index: trunk/phase3/includes/MediaTransformOutput.php |
| — | — | @@ -6,6 +6,8 @@ |
| 7 | 7 | * @addtogroup Media |
| 8 | 8 | */ |
| 9 | 9 | abstract class MediaTransformOutput { |
| | 10 | + var $file, $width, $height, $url, $page, $path; |
| | 11 | + |
| 10 | 12 | /** |
| 11 | 13 | * Get the width of the output box |
| 12 | 14 | */ |
| — | — | @@ -36,12 +38,23 @@ |
| 37 | 39 | |
| 38 | 40 | /** |
| 39 | 41 | * Fetch HTML for this transform output |
| 40 | | - * @param array $attribs Advisory associative array of HTML attributes supplied |
| 41 | | - * by the linker. These can be incorporated into the output in any way. |
| 42 | | - * @param array $linkAttribs Attributes of a suggested enclosing <a> tag. |
| 43 | | - * May be ignored. |
| | 42 | + * |
| | 43 | + * @param array $options Associative array of options. Boolean options |
| | 44 | + * should be indicated with a value of true for true, and false or |
| | 45 | + * absent for false. |
| | 46 | + * |
| | 47 | + * alt Alternate text or caption |
| | 48 | + * desc-link Boolean, show a description link |
| | 49 | + * file-link Boolean, show a file download link |
| | 50 | + * valign vertical-align property, if the output is an inline element |
| | 51 | + * img-class Class applied to the <img> tag, if there is such a tag |
| | 52 | + * |
| | 53 | + * For images, desc-link and file-link are implemented as a click-through. For |
| | 54 | + * sounds and videos, they may be displayed in other ways. |
| | 55 | + * |
| | 56 | + * @return string |
| 44 | 57 | */ |
| 45 | | - abstract function toHtml( $attribs = array() , $linkAttribs = false ); |
| | 58 | + abstract function toHtml( $options = array() ); |
| 46 | 59 | |
| 47 | 60 | /** |
| 48 | 61 | * This will be overridden to return true in error classes |
| — | — | @@ -60,6 +73,19 @@ |
| 61 | 74 | return $contents; |
| 62 | 75 | } |
| 63 | 76 | } |
| | 77 | + |
| | 78 | + function getDescLinkAttribs( $alt = false ) { |
| | 79 | + $query = $this->page ? ( 'page=' . urlencode( $this->page ) ) : ''; |
| | 80 | + $title = $this->file->getTitle(); |
| | 81 | + if ( strval( $alt ) === '' ) { |
| | 82 | + $alt = $title->getText(); |
| | 83 | + } |
| | 84 | + return array( |
| | 85 | + 'href' => $this->file->getTitle()->getLocalURL( $query ), |
| | 86 | + 'class' => 'image', |
| | 87 | + 'title' => $alt |
| | 88 | + ); |
| | 89 | + } |
| 64 | 90 | } |
| 65 | 91 | |
| 66 | 92 | |
| — | — | @@ -74,7 +100,8 @@ |
| 75 | 101 | * @param string $url URL path to the thumb |
| 76 | 102 | * @private |
| 77 | 103 | */ |
| 78 | | - function ThumbnailImage( $url, $width, $height, $path = false ) { |
| | 104 | + function ThumbnailImage( $file, $url, $width, $height, $path = false, $page = false ) { |
| | 105 | + $this->file = $file; |
| 79 | 106 | $this->url = $url; |
| 80 | 107 | # These should be integers when they get here. |
| 81 | 108 | # If not, there's a bug somewhere. But let's at |
| — | — | @@ -82,28 +109,56 @@ |
| 83 | 110 | $this->width = round( $width ); |
| 84 | 111 | $this->height = round( $height ); |
| 85 | 112 | $this->path = $path; |
| | 113 | + $this->page = $page; |
| 86 | 114 | } |
| 87 | 115 | |
| 88 | 116 | /** |
| 89 | 117 | * Return HTML <img ... /> tag for the thumbnail, will include |
| 90 | 118 | * width and height attributes and a blank alt text (as required). |
| | 119 | + * |
| | 120 | + * @param array $options Associative array of options. Boolean options |
| | 121 | + * should be indicated with a value of true for true, and false or |
| | 122 | + * absent for false. |
| 91 | 123 | * |
| 92 | | - * You can set or override additional attributes by passing an |
| 93 | | - * associative array of name => data pairs. The data will be escaped |
| 94 | | - * for HTML output, so should be in plaintext. |
| | 124 | + * alt Alternate text or caption |
| | 125 | + * desc-link Boolean, show a description link |
| | 126 | + * file-link Boolean, show a file download link |
| | 127 | + * valign vertical-align property, if the output is an inline element |
| | 128 | + * img-class Class applied to the <img> tag, if there is such a tag |
| 95 | 129 | * |
| 96 | | - * If $linkAttribs is given, the image will be enclosed in an <a> tag. |
| | 130 | + * For images, desc-link and file-link are implemented as a click-through. For |
| | 131 | + * sounds and videos, they may be displayed in other ways. |
| 97 | 132 | * |
| 98 | | - * @param array $attribs |
| 99 | | - * @param array $linkAttribs |
| 100 | 133 | * @return string |
| 101 | 134 | * @public |
| 102 | 135 | */ |
| 103 | | - function toHtml( $attribs = array(), $linkAttribs = false ) { |
| 104 | | - $attribs['src'] = $this->url; |
| 105 | | - $attribs['width'] = $this->width; |
| 106 | | - $attribs['height'] = $this->height; |
| 107 | | - if( !isset( $attribs['alt'] ) ) $attribs['alt'] = ''; |
| | 136 | + function toHtml( $options = array() ) { |
| | 137 | + if ( count( func_get_args() ) == 2 ) { |
| | 138 | + throw new MWException( __METHOD__ .' called in the old style' ); |
| | 139 | + } |
| | 140 | + |
| | 141 | + $alt = empty( $options['alt'] ) ? '' : $options['alt']; |
| | 142 | + if ( !empty( $options['desc-link'] ) ) { |
| | 143 | + $linkAttribs = $this->getDescLinkAttribs( $alt ); |
| | 144 | + } elseif ( !empty( $options['file-link'] ) ) { |
| | 145 | + $linkAttribs = array( 'href' => $this->file->getURL() ); |
| | 146 | + } else { |
| | 147 | + $linkAttribs = false; |
| | 148 | + } |
| | 149 | + |
| | 150 | + $attribs = array( |
| | 151 | + 'alt' => $alt, |
| | 152 | + 'src' => $this->url, |
| | 153 | + 'width' => $this->width, |
| | 154 | + 'height' => $this->height, |
| | 155 | + 'border' => 0, |
| | 156 | + ); |
| | 157 | + if ( !empty( $options['valign'] ) ) { |
| | 158 | + $attribs['style'] = "vertical-align: {$options['valign']}"; |
| | 159 | + } |
| | 160 | + if ( !empty( $options['img-class'] ) ) { |
| | 161 | + $attribs['class'] = $options['img-class']; |
| | 162 | + } |
| 108 | 163 | return $this->linkWrap( $linkAttribs, Xml::element( 'img', $attribs ) ); |
| 109 | 164 | } |
| 110 | 165 | |
| — | — | @@ -130,7 +185,7 @@ |
| 131 | 186 | $this->path = false; |
| 132 | 187 | } |
| 133 | 188 | |
| 134 | | - function toHtml( $attribs = array(), $linkAttribs = false ) { |
| | 189 | + function toHtml( $options = array() ) { |
| 135 | 190 | return "<table class=\"MediaTransformError\" style=\"" . |
| 136 | 191 | "width: {$this->width}px; height: {$this->height}px;\"><tr><td>" . |
| 137 | 192 | $this->htmlMsg . |
| Index: trunk/phase3/includes/ImageGallery.php |
| — | — | @@ -261,13 +261,14 @@ |
| 262 | 262 | . htmlspecialchars( $img->getLastError() ) . '</div>'; |
| 263 | 263 | } else { |
| 264 | 264 | $vpad = floor( ( 1.25*$this->mHeights - $thumb->height ) /2 ) - 2; |
| 265 | | - $linkAttribs = array( |
| 266 | | - 'href' => $nt->getLocalURL(), |
| 267 | | - 'title' => $nt->getPrefixedText(), |
| 268 | | - ); |
| 269 | 265 | |
| 270 | | - $thumbhtml = "\n\t\t\t".'<div class="thumb" style="padding: ' . $vpad . 'px 0; width: '.($this->mWidths+30).'px;">' |
| 271 | | - . $thumb->toHtml( array(), $linkAttribs ) . '</div>'; |
| | 266 | + $thumbhtml = "\n\t\t\t". |
| | 267 | + '<div class="thumb" style="padding: ' . $vpad . 'px 0; width: ' .($this->mWidths+30).'px;">' |
| | 268 | + # Auto-margin centering for block-level elements. Needed now that we have video |
| | 269 | + # handlers since they may emit block-level elements as opposed to simple <img> tags. |
| | 270 | + # ref http://css-discuss.incutio.com/?page=CenteringBlockElement |
| | 271 | + . '<div style="margin-left: auto; margin-right: auto; width: ' .$this->mWidths.'px;">' |
| | 272 | + . $thumb->toHtml( array( 'desc-link' => true ) ) . '</div></div>'; |
| 272 | 273 | |
| 273 | 274 | // Call parser transform hook |
| 274 | 275 | if ( $this->mParser && $img->getHandler() ) { |
| — | — | @@ -350,3 +351,4 @@ |
| 351 | 352 | |
| 352 | 353 | } //class |
| 353 | 354 | |
| | 355 | + |
| Index: trunk/extensions/OggHandler/OggPlayer.js |
| — | — | @@ -1,4 +1,3 @@ |
| 2 | | - |
| 3 | 2 | // This is a global configuration object which can embed multiple video instances |
| 4 | 3 | var wgOggPlayer = { |
| 5 | 4 | 'detectionDone': false, |
| — | — | @@ -8,7 +7,8 @@ |
| 9 | 8 | // Downpreffed VLC because it crashes my browser all the damn time -- TS |
| 10 | 9 | 'players': ['videoElement', 'oggPlugin', 'cortado', 'quicktime-mozilla', 'quicktime-activex', 'vlc-mozilla', 'vlc-activex'], |
| 11 | 10 | |
| 12 | | - 'clientSupports': {}, |
| | 11 | + 'clientSupports': { 'thumbnail' : true }, |
| | 12 | + 'savedThumbs': {}, |
| 13 | 13 | |
| 14 | 14 | // Configuration from MW |
| 15 | 15 | 'msg': {}, |
| — | — | @@ -20,9 +20,16 @@ |
| 21 | 21 | // Main entry point: initialise a video player |
| 22 | 22 | // Player will be created as a child of the given ID |
| 23 | 23 | // There may be multiple players in a document |
| 24 | | - 'init': function ( player, id, videoUrl, width, height, length ) { |
| 25 | | - var elt = document.getElementById( id ); |
| | 24 | + 'init': function ( player, id, videoUrl, width, height, length, linkUrl ) { |
| | 25 | + elt = document.getElementById( id ); |
| 26 | 26 | |
| | 27 | + // Save still image HTML |
| | 28 | + if ( !(id in this.savedThumbs) ) { |
| | 29 | + var thumb = document.createDocumentFragment(); |
| | 30 | + thumb.appendChild( elt.cloneNode( true ) ); |
| | 31 | + this.savedThumbs[id] = thumb; |
| | 32 | + } |
| | 33 | + |
| 27 | 34 | this.detect( elt ); |
| 28 | 35 | |
| 29 | 36 | if ( !player ) { |
| — | — | @@ -34,6 +41,10 @@ |
| 35 | 42 | var semicolon = player.indexOf( ";" ); |
| 36 | 43 | if ( semicolon > -1 ) { |
| 37 | 44 | player = player.substr( cookiePos, semicolon ); |
| | 45 | + if ( player == 'thumbnail' ) { |
| | 46 | + // Can't select this one permanently |
| | 47 | + player = false; |
| | 48 | + } |
| 38 | 49 | } |
| 39 | 50 | } |
| 40 | 51 | } |
| — | — | @@ -48,7 +59,7 @@ |
| 49 | 60 | } |
| 50 | 61 | |
| 51 | 62 | elt.innerHTML = ''; |
| 52 | | - |
| | 63 | + |
| 53 | 64 | switch ( player ) { |
| 54 | 65 | case 'videoElement': |
| 55 | 66 | this.embedVideoElement( elt, videoUrl, width, height, length ); |
| — | — | @@ -68,17 +79,23 @@ |
| 69 | 80 | case 'quicktime-mozilla': |
| 70 | 81 | this.embedQuicktimePlugin( elt, videoUrl, width, height, length ); |
| 71 | 82 | break; |
| | 83 | + case 'thumbnail': |
| | 84 | + if ( id in this.savedThumbs ) { |
| | 85 | + elt.appendChild( this.savedThumbs[id].cloneNode( true ) ); |
| | 86 | + } else { |
| | 87 | + elt.appendChild( document.createTextNode( 'Missing saved thumbnail for ' + id ) ); |
| | 88 | + } |
| | 89 | + break; |
| 72 | 90 | default: |
| 73 | 91 | elt.innerHTML = this.msg['ogg-no-player'] + '<br/>'; |
| 74 | 92 | player = 'none'; |
| 75 | 93 | } |
| 76 | | - if ( this.showPlayerSelect ) { |
| | 94 | + if ( player != 'thumbnail' ) { |
| | 95 | + var optionsBox = this.makeOptionsBox( player, id, videoUrl, width, height, length, linkUrl ); |
| | 96 | + var optionsLink = this.makeOptionsLink( id ); |
| 77 | 97 | elt.appendChild( document.createElement( 'br' ) ); |
| 78 | | - var label = document.createElement( 'label' ); |
| 79 | | - label.setAttribute( 'class', 'ogg_player_using' ); |
| 80 | | - label.appendChild( document.createTextNode( ' ' + this.msg['ogg-using-player'] ) ); |
| 81 | | - label.appendChild( this.makePlayerSelect( player, id, videoUrl, width, height, length ) ); |
| 82 | | - elt.appendChild( label ); |
| | 98 | + elt.appendChild( optionsBox ); |
| | 99 | + elt.appendChild( optionsLink ); |
| 83 | 100 | } |
| 84 | 101 | }, |
| 85 | 102 | |
| — | — | @@ -99,7 +116,7 @@ |
| 100 | 117 | this.clientSupports['vlc-activex'] = true; |
| 101 | 118 | } |
| 102 | 119 | // Java |
| 103 | | - if ( javaEnabled && this.testActiveX( 'JavaPlugin' ) ) { |
| | 120 | + if ( javaEnabled && this.testActiveX( 'JavaWebStart.isInstalled' ) ) { |
| 104 | 121 | this.clientSupports['cortado'] = true; |
| 105 | 122 | } |
| 106 | 123 | // QuickTime |
| — | — | @@ -180,23 +197,136 @@ |
| 181 | 198 | } |
| 182 | 199 | }, |
| 183 | 200 | |
| 184 | | - 'makePlayerSelect' : function ( selectedPlayer, id, videoUrl, width, height, length ) { |
| 185 | | - var select = document.createElement( 'select' ); |
| 186 | | - if ( selectedPlayer == 'none' ) { |
| 187 | | - this.addOption( select, 'none', this.msg['ogg-player-none'], true ); |
| | 201 | + 'makeOptionsBox' : function ( selectedPlayer, id, videoUrl, width, height, length, linkUrl ) { |
| | 202 | + var div, p, a, ul, li, button; |
| | 203 | + |
| | 204 | + div = document.createElement( 'div' ); |
| | 205 | + div.style.cssText = "width: " + ( width - 10 ) + "px; display: none;"; |
| | 206 | + div.className = 'ogg-player-options'; |
| | 207 | + div.id = id + '_options_box'; |
| | 208 | + div.align = 'center'; |
| | 209 | + |
| | 210 | + ul = document.createElement( 'ul' ); |
| | 211 | + |
| | 212 | + // Description page link |
| | 213 | + if ( linkUrl ) { |
| | 214 | + li = document.createElement( 'li' ); |
| | 215 | + a = document.createElement( 'a' ); |
| | 216 | + a.href = linkUrl; |
| | 217 | + a.appendChild( document.createTextNode( this.msg['ogg-desc-link'] ) ); |
| | 218 | + li.appendChild( a ); |
| | 219 | + ul.appendChild( li ); |
| 188 | 220 | } |
| 189 | | - for ( var player in this.clientSupports ) { |
| 190 | | - this.addOption( select, player, this.getMsg( 'ogg-player-' + player ), selectedPlayer == player ); |
| | 221 | + |
| | 222 | + // Download link |
| | 223 | + li = document.createElement( 'li' ); |
| | 224 | + a = document.createElement( 'a' ); |
| | 225 | + a.href = videoUrl; |
| | 226 | + a.appendChild( document.createTextNode( this.msg['ogg-download'] ) ); |
| | 227 | + li.appendChild( a ); |
| | 228 | + ul.appendChild( li ); |
| | 229 | + |
| | 230 | + div.appendChild( ul ); |
| | 231 | + |
| | 232 | + // Player list caption |
| | 233 | + p = document.createElement( 'p' ); |
| | 234 | + p.appendChild( document.createTextNode( this.msg['ogg-use-player'] ) ); |
| | 235 | + div.appendChild( p ); |
| | 236 | + |
| | 237 | + // Make player list |
| | 238 | + ul = document.createElement( 'ul' ); |
| | 239 | + for ( var i = 0; i < this.players.length + 1; i++ ) { |
| | 240 | + var player; |
| | 241 | + if ( i == this.players.length ) { |
| | 242 | + player = 'thumbnail'; |
| | 243 | + } else { |
| | 244 | + player = this.players[i]; |
| | 245 | + // Skip unsupported players |
| | 246 | + if ( ! this.clientSupports[player] ) { |
| | 247 | + continue; |
| | 248 | + } |
| | 249 | + } |
| | 250 | + |
| | 251 | + // Make list item |
| | 252 | + li = document.createElement( 'li' ); |
| | 253 | + if ( player == selectedPlayer ) { |
| | 254 | + var strong = document.createElement( 'strong' ); |
| | 255 | + strong.appendChild( document.createTextNode( |
| | 256 | + this.msg['ogg-player-' + player] + ' ' + this.msg['ogg-player-selected'] ) ); |
| | 257 | + li.appendChild( strong ); |
| | 258 | + } else { |
| | 259 | + a = document.createElement( 'a' ); |
| | 260 | + a.href = 'javascript:void("' + player + '")'; |
| | 261 | + a.onclick = this.makePlayerFunction( player, id, videoUrl, width, height, length, linkUrl ); |
| | 262 | + a.appendChild( document.createTextNode( this.msg['ogg-player-' + player] ) ); |
| | 263 | + li.appendChild( a ); |
| | 264 | + } |
| | 265 | + ul.appendChild( li ); |
| 191 | 266 | } |
| 192 | | - select.value = selectedPlayer; |
| | 267 | + div.appendChild( ul ); |
| | 268 | + |
| | 269 | + div2 = document.createElement( 'div' ); |
| | 270 | + div2.style.cssText = 'text-align: center;'; |
| | 271 | + button = document.createElement( 'button' ); |
| | 272 | + button.appendChild( document.createTextNode( this.msg['ogg-dismiss'] ) ); |
| | 273 | + button.onclick = this.makeDismissFunction( id ); |
| | 274 | + div2.appendChild( button ); |
| | 275 | + div.appendChild( div2 ); |
| 193 | 276 | |
| 194 | | - var me = this; |
| 195 | | - select.onchange = function () { |
| 196 | | - var player = select.value; |
| 197 | | - document.cookie = "ogg_player=" + player; |
| 198 | | - me.init( player, id, videoUrl, width, height, length ); |
| | 277 | + return div; |
| | 278 | + }, |
| | 279 | + |
| | 280 | + 'makeOptionsLink' : function ( id ) { |
| | 281 | + var a = document.createElement( 'a' ); |
| | 282 | + a.href = 'javascript:void("options")'; |
| | 283 | + a.id = id + '_options_link'; |
| | 284 | + a.onclick = this.makeDisplayOptionsFunction( id ); |
| | 285 | + a.appendChild( document.createTextNode( this.msg['ogg-more'] ) ); |
| | 286 | + return a; |
| | 287 | + }, |
| | 288 | + |
| | 289 | + 'setCssProperty' : function ( elt, prop, value ) { |
| | 290 | + // Could use style.setProperty() here if it worked in IE |
| | 291 | + var re = new RegExp( prop + ':[^;](;|$)' ); |
| | 292 | + if ( elt.style.cssText.search( re ) > -1 ) { |
| | 293 | + elt.style.cssText = elt.style.cssText.replace( re, prop + ':' + value + '$1' ); |
| | 294 | + } else if ( elt.style.cssText == '' ) { |
| | 295 | + elt.style.cssText = prop + ':' + value + ';'; |
| | 296 | + } else if ( elt.style.cssText[elt.style.cssText.length - 1] == ';' ) { |
| | 297 | + elt.style.cssText += prop + ':' + value + ';'; |
| | 298 | + } else { |
| | 299 | + elt.style.cssText += ';' + prop + ':' + value + ';'; |
| | 300 | + } |
| | 301 | + }, |
| | 302 | + |
| | 303 | + 'makeDismissFunction' : function ( id ) { |
| | 304 | + var this_ = this; |
| | 305 | + return function () { |
| | 306 | + var optionsLink = document.getElementById( id + '_options_link' ); |
| | 307 | + var optionsBox = document.getElementById( id + '_options_box' ); |
| | 308 | + this_.setCssProperty( optionsLink, 'display', 'inline' ); |
| | 309 | + this_.setCssProperty( optionsBox, 'display', 'none' ); |
| | 310 | + } |
| | 311 | + }, |
| | 312 | + |
| | 313 | + 'makeDisplayOptionsFunction' : function ( id ) { |
| | 314 | + var this_ = this; |
| | 315 | + return function () { |
| | 316 | + var optionsLink = document.getElementById( id + '_options_link' ); |
| | 317 | + var optionsBox = document.getElementById( id + '_options_box' ); |
| | 318 | + this_.setCssProperty( optionsLink, 'display', 'none' ); |
| | 319 | + this_.setCssProperty( optionsBox, 'display', 'block' ); |
| | 320 | + } |
| | 321 | + }, |
| | 322 | + |
| | 323 | + 'makePlayerFunction' : function ( player, id, videoUrl, width, height, length, linkUrl ) { |
| | 324 | + var this_ = this; |
| | 325 | + return function () { |
| | 326 | + if ( player != 'thumbnail' ) { |
| | 327 | + document.cookie = "ogg_player=" + player; |
| | 328 | + } |
| | 329 | + this_.init( player, id, videoUrl, width, height, length, linkUrl ); |
| 199 | 330 | }; |
| 200 | | - return select; |
| 201 | 331 | }, |
| 202 | 332 | |
| 203 | 333 | 'newButton': function ( caption, callback ) { |
| — | — | @@ -350,11 +480,11 @@ |
| 351 | 481 | "</object>"; |
| 352 | 482 | |
| 353 | 483 | // Disable autoplay on back button |
| 354 | | - var me = this; |
| | 484 | + var this_ = this; |
| 355 | 485 | window.setTimeout( |
| 356 | 486 | function () { |
| 357 | 487 | var videoElt = document.getElementById( id ); |
| 358 | | - me.setParam( videoElt, 'AUTOPLAY', 'False' ); |
| | 488 | + this_.setParam( videoElt, 'AUTOPLAY', 'False' ); |
| 359 | 489 | }, 3000 ); |
| 360 | 490 | }, |
| 361 | 491 | |
| — | — | @@ -376,6 +506,4 @@ |
| 377 | 507 | this.addParam( elt, name, value ); |
| 378 | 508 | } |
| 379 | 509 | }; |
| 380 | | - |
| 381 | 510 | // vim: ts=4 sw=4 noet cindent : |
| 382 | | - |
| Index: trunk/extensions/OggHandler/OggHandler_body.php |
| — | — | @@ -143,11 +143,11 @@ |
| 144 | 144 | $width = $params['width']; |
| 145 | 145 | } |
| 146 | 146 | $height = $icon->getHeight(); |
| 147 | | - return new OggAudioDisplay( $file->getURL(), $icon->getUrl(), $width, $height, $length ); |
| | 147 | + return new OggAudioDisplay( $file, $file->getURL(), $icon->getUrl(), $width, $height, $length ); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | if ( $flags & self::TRANSFORM_LATER ) { |
| 151 | | - return new OggVideoDisplay( $file->getURL(), $dstUrl, $width, $height, $length ); |
| | 151 | + return new OggVideoDisplay( $file, $file->getURL(), $dstUrl, $width, $height, $length ); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | wfMkdirParents( dirname( $dstPath ) ); |
| — | — | @@ -180,7 +180,7 @@ |
| 181 | 181 | // Return error box |
| 182 | 182 | return new MediaTransformError( 'thumbnail_error', $width, $height, implode( "\n", $lines ) ); |
| 183 | 183 | } |
| 184 | | - return new OggVideoDisplay( $file->getURL(), $dstUrl, $width, $height, $length ); |
| | 184 | + return new OggVideoDisplay( $file, $file->getURL(), $dstUrl, $width, $height, $length ); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | function canRender() { return true; } |
| — | — | @@ -319,7 +319,8 @@ |
| 320 | 320 | $msgNames = array( 'ogg-play', 'ogg-pause', 'ogg-stop', 'ogg-no-player', |
| 321 | 321 | 'ogg-player-videoElement', 'ogg-player-oggPlugin', 'ogg-player-cortado', 'ogg-player-vlc-mozilla', |
| 322 | 322 | 'ogg-player-vlc-activex', 'ogg-player-quicktime-mozilla', 'ogg-player-quicktime-activex', |
| 323 | | - 'ogg-player-none', 'ogg-using-player' ); |
| | 323 | + 'ogg-player-thumbnail', 'ogg-player-selected', 'ogg-use-player', 'ogg-more', 'ogg-download', |
| | 324 | + 'ogg-desc-link', 'ogg-dismiss' ); |
| 324 | 325 | $msgValues = array_map( 'wfMsg', $msgNames ); |
| 325 | 326 | $jsMsgs = Xml::encodeJsVar( (object)array_combine( $msgNames, $msgValues ) ); |
| 326 | 327 | $cortadoUrl = $wgCortadoJarFile; |
| — | — | @@ -337,6 +338,14 @@ |
| 338 | 339 | wgOggPlayer.cortadoUrl = $encCortadoUrl; |
| 339 | 340 | wgOggPlayer.smallFileUrl = $encSmallFileUrl; |
| 340 | 341 | </script> |
| | 342 | +<style type="text/css"> |
| | 343 | +.ogg-player-options { |
| | 344 | + border: solid 1px #ccc; |
| | 345 | + padding: 2pt; |
| | 346 | + text-align: left; |
| | 347 | + font-size: 10pt; |
| | 348 | +} |
| | 349 | +</style> |
| 341 | 350 | EOT |
| 342 | 351 | ); |
| 343 | 352 | |
| — | — | @@ -361,7 +370,8 @@ |
| 362 | 371 | class OggTransformOutput extends MediaTransformOutput { |
| 363 | 372 | static $serial = 0; |
| 364 | 373 | |
| 365 | | - function __construct( $videoUrl, $thumbUrl, $width, $height, $length, $isVideo ) { |
| | 374 | + function __construct( $file, $videoUrl, $thumbUrl, $width, $height, $length, $isVideo ) { |
| | 375 | + $this->file = $file; |
| 366 | 376 | $this->videoUrl = $videoUrl; |
| 367 | 377 | $this->url = $thumbUrl; |
| 368 | 378 | $this->width = round( $width ); |
| — | — | @@ -370,24 +380,25 @@ |
| 371 | 381 | $this->isVideo = $isVideo; |
| 372 | 382 | } |
| 373 | 383 | |
| 374 | | - function toHtml( $attribs = array() , $linkAttribs = false ) { |
| | 384 | + function toHtml( $options = array() ) { |
| 375 | 385 | wfLoadExtensionMessages( 'OggHandler' ); |
| | 386 | + if ( count( func_get_args() ) == 2 ) { |
| | 387 | + throw new MWException( __METHOD__ .' called in the old style' ); |
| | 388 | + } |
| 376 | 389 | |
| 377 | 390 | OggTransformOutput::$serial++; |
| 378 | 391 | |
| 379 | | - $encThumbUrl = htmlspecialchars( $this->url ); |
| 380 | | - |
| 381 | 392 | if ( substr( $this->videoUrl, 0, 4 ) != 'http' ) { |
| 382 | 393 | global $wgServer; |
| 383 | 394 | $encUrl = Xml::encodeJsVar( $wgServer . $this->videoUrl ); |
| 384 | 395 | } else { |
| 385 | 396 | $encUrl = Xml::encodeJsVar( $this->videoUrl ); |
| 386 | 397 | } |
| 387 | | - #$encUrl = htmlspecialchars( $encUrl ); |
| 388 | 398 | $length = intval( $this->length ); |
| 389 | 399 | $width = intval( $this->width ); |
| 390 | 400 | $height = intval( $this->height ); |
| 391 | | - $attribs['src'] = $this->url; |
| | 401 | + $alt = empty( $options['alt'] ) ? '' : $options['alt']; |
| | 402 | + $attribs = array( 'src' => $this->url ); |
| 392 | 403 | if ( $this->isVideo ) { |
| 393 | 404 | $msgStartPlayer = wfMsg( 'ogg-play-video' ); |
| 394 | 405 | $attribs['width'] = $width; |
| — | — | @@ -400,18 +411,23 @@ |
| 401 | 412 | } |
| 402 | 413 | |
| 403 | 414 | $thumb = Xml::element( 'img', $attribs, null ); |
| 404 | | - if ( $linkAttribs ) { |
| | 415 | + if ( !empty( $options['desc-link'] ) ) { |
| | 416 | + $linkAttribs = $this->getDescLinkAttribs( $alt ); |
| 405 | 417 | $thumb = Xml::tags( 'a', $linkAttribs, $thumb ); |
| | 418 | + $encLink = Xml::encodeJsVar( $linkAttribs['href'] ); |
| | 419 | + } else { |
| | 420 | + // We don't respect the file-link option, click-through to download is not appropriate |
| | 421 | + $encLink = 'false'; |
| 406 | 422 | } |
| 407 | 423 | $thumb .= "<br/>\n"; |
| 408 | 424 | |
| 409 | 425 | $id = "ogg_player_" . OggTransformOutput::$serial; |
| 410 | 426 | |
| 411 | | - $s = Xml::tags( 'div', array( 'id' => $id ), |
| | 427 | + $s = Xml::tags( 'div', array( 'id' => $id, /*'align' => 'center',*/ 'style' => 'width: ' . $width . 'px' ), |
| 412 | 428 | $thumb . |
| 413 | 429 | Xml::element( 'button', |
| 414 | 430 | array( |
| 415 | | - 'onclick' => "wgOggPlayer.init(false, '$id', $encUrl, $width, $playerHeight, $length);", |
| | 431 | + 'onclick' => "wgOggPlayer.init(false, '$id', $encUrl, $width, $playerHeight, $length, $encLink);", |
| 416 | 432 | ), |
| 417 | 433 | $msgStartPlayer |
| 418 | 434 | ) |
| — | — | @@ -421,14 +437,14 @@ |
| 422 | 438 | } |
| 423 | 439 | |
| 424 | 440 | class OggVideoDisplay extends OggTransformOutput { |
| 425 | | - function __construct( $videoUrl, $thumbUrl, $width, $height, $length ) { |
| 426 | | - parent::__construct( $videoUrl, $thumbUrl, $width, $height, $length, true ); |
| | 441 | + function __construct( $file, $videoUrl, $thumbUrl, $width, $height, $length ) { |
| | 442 | + parent::__construct( $file, $videoUrl, $thumbUrl, $width, $height, $length, true ); |
| 427 | 443 | } |
| 428 | 444 | } |
| 429 | 445 | |
| 430 | 446 | class OggAudioDisplay extends OggTransformOutput { |
| 431 | | - function __construct( $videoUrl, $iconUrl, $width, $height, $length ) { |
| 432 | | - parent::__construct( $videoUrl, $iconUrl, $width, $height, $length, false ); |
| | 447 | + function __construct( $file, $videoUrl, $iconUrl, $width, $height, $length ) { |
| | 448 | + parent::__construct( $file, $videoUrl, $iconUrl, $width, $height, $length, false ); |
| 433 | 449 | } |
| 434 | 450 | } |
| 435 | 451 | |
| Index: trunk/extensions/OggHandler/OggHandler.i18n.php |
| — | — | @@ -24,8 +24,13 @@ |
| 25 | 25 | 'ogg-player-vlc-activex' => 'VLC (ActiveX)', # only translate this message to other languages if you have to change it |
| 26 | 26 | 'ogg-player-quicktime-mozilla' => 'QuickTime', # only translate this message to other languages if you have to change it |
| 27 | 27 | 'ogg-player-quicktime-activex' => 'QuickTime (ActiveX)', # only translate this message to other languages if you have to change it |
| 28 | | - 'ogg-player-none' => '(none)', |
| 29 | | - 'ogg-using-player' => 'Using player:', |
| | 28 | + 'ogg-player-thumbnail' => 'Still image only', |
| | 29 | + 'ogg-player-selected' => '(selected)', |
| | 30 | + 'ogg-use-player' => 'Use player: ', |
| | 31 | + 'ogg-more' => 'More...', |
| | 32 | + 'ogg-dismiss' => 'Close', |
| | 33 | + 'ogg-download' => 'Download file', |
| | 34 | + 'ogg-desc-link' => 'About this file', |
| 30 | 35 | ), |
| 31 | 36 | |
| 32 | 37 | 'de' => array( |
| — | — | @@ -45,8 +50,6 @@ |
| 46 | 51 | 'ogg-no-player' => 'Dein System scheint über keine Abspielsoftware zu verfügen. Bitte installiere <a href="http://www.java.com/de/download/manual.jsp">Java</a>', |
| 47 | 52 | 'ogg-player-videoElement' => '<video>-Element', |
| 48 | 53 | 'ogg-player-oggPlugin' => 'Ogg-Plugin', |
| 49 | | - 'ogg-player-none' => '(keiner)', |
| 50 | | - 'ogg-using-player' => 'Verwende Player:', |
| 51 | 54 | ), |
| 52 | 55 | |
| 53 | 56 | 'nl' => array( |
| — | — | @@ -67,7 +70,5 @@ |
| 68 | 71 | 'Installeer alstublieft <a href="http://www.java.com/nl/download/manual.jsp">Java</a>.', |
| 69 | 72 | 'ogg-player-videoElement' => '<video>-element', |
| 70 | 73 | 'ogg-player-oggPlugin' => 'Ogg-plugin', |
| 71 | | - 'ogg-player-none' => '(geen)', |
| 72 | | - 'ogg-using-player' => 'Gebruikte speler:', |
| 73 | 74 | ), |
| 74 | 75 | ); |