I’ve run into an issue on a few occasion where I wanted to dynamically create a string of repeated characters (usually spaces or tabs) an exact number of times. It always struck me as a bit of a headache to have to create a loop to join all the of the pieces of the string together.
Recently, I found a simpler way. The solution relies on the Array constructor. The Array constructor can accept either an array of values, or a number. If you pass a number, an array with that length is created with each item being empty. We can take advantage of the fact that the items are empty. Any character we use to join the array into a string is the only thing that will be shown, because the items themselves are empty.
var n = 3;
var str = '.';
var result = new Array(n+1).join(str); //creates "..."
Here’s what it looks like in a single line:
var result = new Array(4).join('.'); //creates "..."
(You need to add one since the join string appears between array items).
Far simpler and cleaner than creating a loop!
There are many cases where it makes sense to hide particular elements on mobile displays. One of these cases is a print button that is used to print the screen.
Since mobile devices are generally not attached to printers, a (now) useless print button is taking up valuable screen real estate. This post will cover some techniques to hide items on mobile devices.
In many respects, this an improvement. The lack of a a protocol means that this link will inherit the protocol from its container page. So if the container page is https (a secure page), the YouTube video will be as well. This avoids a security warning to IE users when loading unsecured content (the http YouTube video) within a secured (https) webpage. This is a more flexible method, as long as your page is on a web server.
However, it means that the embedded content will not preview locally from your hard drive.
To view a working embed from you local drive, modify the embed so that the src attribute begins with http:
When you install the latest version of in5 (InDesign to HTML5) and start up InDesign an in5 Feature Tour will automatically appear.
This document will get you started creating interactive HTML documents from InDesign. There are pre-built examples of hyperlinks, video, HTML embedding, page navigation, multi-state objects, a slideshow folio overlay, and liquid layout.
If you don’t need the document, you can simply close it and it won’t reappear until you update in5.
Before installing in5, make sure you have the latest version of InDesign CC. Try updating InDesign the Adobe Creative Cloud Desktop (which itself will have to have update 188.8.131.52 or newer).
Or more directly, use Help > Updates… within InDesign CC.
Check the InDesign version by going to the InDesign menu (or Edit in Windows) and choose About Adobe InDesign…
After the update, your InDesign version should be at least 9.1. At that point, you can use the in5_cc.zxp installer.
Hopefully the update will just appear for you in the Adobe Creative Cloud App. For me, I had to quit the app, delete the file listed below, then restart Creative Cloud for the update to appear (but I was trying to test this immediately after release).
Mac OS <Startup Disk>/Library/Application Support/Adobe/AAMUpdaterInventory/1.0/AdobeUpdaterAdminPrefs.dat