(bug 43100) Fixing WikiLove error handling for post-preview errors

Also adding window global declaration for JSHint

Change-Id: Id1877a4b2d6b596d1b3ef155c4eb91b60856cdad
Merge "(bug 43100) Fixing WikiLove error handling for post-preview errors"