Skip to content

Commit

Permalink
use local version of zeroclipboard movie
Browse files Browse the repository at this point in the history
    fixes issues in some recent browser (eg latest chrome on latest os x)
    where the flash "movie" won't load unless it is local.
    the error it gives is a generic "uncaught exception" in
    ZeroClipboard activate -> flashState.bridge.setSize.
    curiously it still works fine in some browsers (firefox) and
    older chrome was also fine but I'm guessing
    security modes are being tightened in browsers.

    none of the other recommended settings for fixing this seem to work:
    * trustedDomains
    * trustedOrigin
    * allowScriptAccess
    * and even the flash config in the browser

    it's just a small movie however so should be low impact (smaller than most of our images).
    put in img path to simplify access.

    also, zeroclipboard is updated from 1.3.1 to 1.3.5 (latest stable 1.x branch).
    (2.x branch looks like it might be a bigger api change although some fixes in this area are reported.)

    note the SWF binary is downloaded on first run of _build/build.sh,
    similar to as we do for the brooklyn-ui project, and also with a README in that dir
  • Loading branch information
ahgittin committed Feb 18, 2016
1 parent 7c41f83 commit 602ca54
Show file tree
Hide file tree
Showing 6 changed files with 1,095 additions and 2 deletions.
6 changes: 6 additions & 0 deletions _build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ parse_mode $@
shift
parse_arguments $@

# prep
if [ ! -f style/js/zeroclipboard/ZeroClipboard.swf ] ; then
echo downloading ZeroClipboard.swf
curl -L -o style/js/zeroclipboard/ZeroClipboard.swf http://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.5/ZeroClipboard.swf
fi

make_jekyll || { echo ERROR: failed jekyll docs build in `pwd` ; exit 1 ; }

make_javadoc || { echo ERROR: failed javadoc build ; exit 1 ; }
Expand Down
4 changes: 2 additions & 2 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{{ content }}


<script src="//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.min.js"></script>
<script src="{{ site.path.style }}/js/zeroclipboard/ZeroClipboard.min.js"></script>

<script language="JavaScript" type="application/javascript">
fix_padding_function = function () {
Expand Down Expand Up @@ -66,7 +66,7 @@
});

<!-- Clipboard support -->
ZeroClipboard.config({ moviePath: '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.swf' });
ZeroClipboard.config({ moviePath: '{{ site.path.style }}/js/zeroclipboard/ZeroClipboard.swf' });

$(function() {
$('div.highlight').prepend(
Expand Down
1 change: 1 addition & 0 deletions style/js/zeroclipboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ZeroClipboard.swf
41 changes: 41 additions & 0 deletions style/js/zeroclipboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

For the clipboard to work, the ZeroClipboard.swf artifact (v1.3.5) needs to be
downloaded and installed in this directory. The build will do this automatically for
you on first run and thereafter use the downloaded version.

If you do not wish to have it, simply create an empty file with that name in this dir.

You can download it manually from:

http://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.5/ZeroClipboard.swf

It can be built from source using a free toolchain as described at

https://github.com/zeroclipboard/zeroclipboard/blob/master/CONTRIBUTING.md .

It is not checked in because binary artifacts should not be included in source releases
due to Apache policies. This project is not currently set up to use bower/npm which would
do the same thing, so instead we follow this process. See also ZeroClipboard.js.

ZeroClipboard is used under the MIT license.

This description file is part of the Apache Brooklyn project.

----
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

Loading

0 comments on commit 602ca54

Please sign in to comment.