Getting master page URL in SharePoint 2013 with JSOM

I’m only just starting to learn JSOM (after previously learning the server-side object model, and CSOM, via C#). There are some slightly weird requirements and limitations that are constantly tripping me up. Here’s today’s waste of time: trying to get the current site’s master page URL.

Here’s what I came up with:

$(document).ready(function () {
            $('#divMain').text('Hello World.');
            getMasterUrl();
        });
        function getMasterUrl() {
            var myCtx = new SP.ClientContext();
            this.site = myCtx.get_site();
            this.web = myCtx.get_web();
            myCtx.load(web);
            myCtx.executeQueryAsync(
                Function.createDelegate(this, this.onSucceededMasterUrl),
                Function.createDelegate(this, this.onFailed)
                );
        }

        function onSucceededMasterUrl() {
            $('#divMain').text('Master URL: ' + web.get_masterUrl());
        }
        function onFailed(sender, args) {
            $('#divMain').text('Failed: ' + args.get_message());
        }

This just kept failing. I tried a bunch of random stuff to get it to work. In the end, I made a fairly minor change that got it to work. But then, I changed the code back, and it still worked. So this was going to be a post about a minor quirk of JSOM, but now it’s more of a “WTF” post. I’m sure I did something to make it work, and I just lost track of what it was. Well, either way, I’m having some fun with JavaScript.

Anime

There’s an interesting article on the NewsHour site about anime’s absence from the Oscars this year. It mentions the movie Your Name, which I’ve heard a lot about, but haven’t had a chance to see. (As far as I can tell, it was only released for a short run in 2016 in the US, to qualify for the Oscars and won’t get a “real” release until April.) I don’t know much about the director, Makoto Shinkai, but he seems to be well-regarded, so maybe I should hunt down some of his older movies.

I’ve been getting interested in anime again lately. This week, I watched the first three parts of Ghost in the Shell: Arise on Netflix. It’s not nearly as good as the GITS: Stand Alone Complex series, but it’s not bad. And I really liked the music, some (or all) of which is by Cornelius. There’s even one song which, apparently, is a collaboration between Cornelius and Sean Lennon. It seems like only those first three parts of Arise are available on Netflix, so now I need to decide if I want to buy the rest on Blu-Ray from Amazon, or maybe from iTunes. The series is a bit confusing, just in terms of the way it was released. Wikipedia does a (relatively) good job of explaining it. There are five main episodes, each about an hour long. In the US, they’ve been released on Blu-Ray as Borders 1 & 2 and Borders 3 & 4. (I’m not quite sure about the fifth episode, “Pyrophoric Cult”.) There is also something called The New Movie, which completes the series (I think). Those episodes/movies have also been re-edited into an anime TV series, with typical 30-minute episodes. That TV series is available on iTunes.

All of this leads me to think that I should maybe dive back into my old pile of unwatched anime DVDs.

Pocket acquired by Mozilla

Well, this is interesting. Mozilla has acquired Pocket. I blogged recently about Instapaper, and their acquisition by Pinterest. Now, their one big competitor has been acquired too. That’s a little disappointing, but maybe not unexpected. Though I wouldn’t have guessed that Mozilla would be the one to buy them out.

I’m still using Instapaper. They’ve restored all the data that was lost in their big crash a few weeks ago, and their site has been working fine for me ever since. So I’m hoping that they’re doing OK.

Amazon Affiliate Links

Amazon has recently made some changes to their affiliate program that are going to have a negative impact on some bloggers. Here are a couple of articles about the change, from The Verge and The Digital Reader.

I’ve been using Amazon affiliate links here on my blog for a long time. And I’ve never earned a penny from them. And that’s fine. I used to use SiteStripe to generate fancy image links, but I’ve had problems with those since I switched from Blogger to WordPress. So lately I’ve just been using SiteStripe’s short URL links. For me, it’s really just a way to get a short URL that might (but probably won’t) make me a buck or two at some point. But there are some sites that have based their “business model” on Amazon affiliate links, and they’re going to be in a bit of trouble. The Wirecutter and The Sweethome used to be in that category, but since they’ve been acquired by the NY Times, maybe they don’t have to rely so much on Amazon.

Either way, relying on something as fragile as affiliate links for anything other than a little extra coffee money has always seemed a bit daft to me. On the other hand, online advertising is a mess too, with so many people using ad blockers, and getting people to pay for content doesn’t usually work out too well either. I’m glad I have a good day job!

The Book of Dust

I was pretty excited to find out this week that Philip Pullman will be releasing the first volume of his new trilogy in October of this year. The trilogy isn’t exactly a sequel to His Dark Materials, but it’s in the same universe, and features some of the same characters. More details can be found at NPR and The Guardian.

I read His Dark Materials back in 2004, starting in January and finishing in June. I remember it well, since I was reading it when my brother passed away, in February 2004, so those memories are linked together in my head. It was also the first time I read anything substantial in ebook form. (I was reading it with Microsoft Reader on a Toshiba Pocket PC. It wasn’t a horrible experience, but neither was it a good one, and I never did buy anything else to read on that device.)

At some point in 2010, I think, I bought a trade paperback of the trilogy, with the idea that I’d reread it eventually. (Of course, the Pocket PC was long gone by then, along with the DRM’d ebooks that were tied to it.) I still haven’t gotten around to rereading it, but I’m thinking about it again.

I could just go ahead and start into the trade paperback, or I could listen to the audio version of Golden Compass, which I seem to have bought via iTunes in 2007 and forgotten about. Or I could buy the graphic novel version of Golden Compass, which I didn’t know about until I started poking around on Amazon tonight. So, plenty of options.

I’m kind of curious as to how I’d process the books right now. I think I’m a different person than I was in 2004. Am I capable of enjoying them as much as I did the first time through? Would I find new things in them that went over my head the first time? Would reading certain sections trigger specific memories? I don’t know. I’m usually not big on rereading books. There are just so many that I haven’t read yet, and I’m such a slow reader these days. But rereading these books would probably be worth my time.

Twitterrific, Overcast, and Ted Leo

Twitterrific is my favorite iOS Twitter client. (But also, honestly, the only one I’ve used other than the official one, so that’s not saying much.) I appreciate the fact that Twitter even still supports third-party clients. Facebook never really did, and Twitter’s support has wavered quite a bit over the years. But anyway, I get a lot of use out of Twitterrific. I bought it back when it actually cost money. (Now, it’s free with ads and various in-app purchases.)

I also used to use their Mac client. But they stopped development on it quite a while ago. I now just use the Twitter web page and occasionally the official Twitter Mac client (which really isn’t bad). But Twitterrific is looking to fix up their Mac client, and have put up a Kickstarter to fund new development. I’ve managed to avoid Kickstarter up until now, despite being tempted by a few things I’ve seen there in the past. But I finally gave in for this, and registered a Kickstarter account and pledged $30. That seems reasonable. The project isn’t fully funded yet, but it’s doing well, so hopefully they’ll actually do it.

And, since I have a Kickstarter account now, I’m tempted to go in on the Kickstarter for Ted Leo’s new album too. He’s one of my favorite artists, and it’s been a while since his last full album. I am worried now about getting sucked into the whole Kickstarter thing and spending money on stuff I don’t really need. There’s no reason that I can’t just wait until Ted Leo’s new album is out, read the reviews, then make an informed decision to buy it or not. And that’s probably what I should do in most cases.

Getting back to the subject of iOS & Mac software that I use a lot, Marco Arment has just released a new version of his podcast player, Overcast. This is another iOS app that I paid for the old-fashioned way at some point, but is now a free app with ads and in-app purchases. The new version is a pretty major redesign. I was pretty happy with the previous design, so I wasn’t really looking forward to this. But it’s a pretty good redesign. I’m getting used to a few things, like swiping left (or is it right?) to get to the episode notes instead of swiping up. Reading through Marco’s blog post on the redesign, it’s clear that he thought about it a lot and put a lot of work into making it as easy to use as possible. So it’s still my favorite podcast player out there. (I kind of wish he’d create a Mac client too, but I can understand why he hasn’t.)

WordPress post formats

In addition to doing my taxes today, I also spent some time messing around with this blog. The theme I’m using, Stargazer, supports post formats. I’ve messed around with them a little, marking some posts as video, audio, quotes, and images. I thought the feature was kind of nifty, though it didn’t seem to have that much utility.

Over time, though, I’ve started to see some downsides to post formats. There seemed to be some issues with the way they were treated in certain plugins. (Specifically, it looked like they were being ignored, and the plugin would only see standard format posts.) So I thought it might be a good idea to just reset all the posts to “standard,” and avoid using them in the future.

I couldn’t initially find a way to get a list of posts by format. I did some searching and found the Post Format Filter plugin. It hasn’t been updated in a long time, but it still works, so I used that to search out and reset all my posts to standard. That was kind of boring work, but it allowed me to stumble across some fun old posts.