Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. javascript:(function(){class e extends Error{constructor(e){super(e),this.name="KnownError"}}const t="\nTry using the simple bookmarklet instead.";var n={IN_USE:"The title setting is already in the edit season dialog.",NOT_OPEN:"You do not have an edit metadata dialog open.",NOT_GENERAL:"You are not in the season's General metadata tab.",NOT_SEASON:"You are not currently editing a season's metadata.",UNK_STRUCT:"Failed to identify the HTML tree structure needed to insert the new setting."+t,UNK_VIEW:"Failed to find or identify the view instance data used to identify the season."+t};try{if(0==document.getElementsByClassName("edit-metadata-modal").length)throw new e(n.NOT_OPEN);var a=document.getElementsByClassName("modal-body-pane"),i=(a=1==a.length&&a[0].firstElementChild)&&a._viewInstance;if(!i)throw new e(n.UNK_VIEW);var l=i.model&&i.model.attributes;if(!l||"season"!=l.type)throw new e(n.NOT_SEASON);if("general"!=i.options.type)throw new e(n.NOT_GENERAL);var o=a.firstElementChild;if(!o)throw new e(n.NOT_OPEN);if(document.getElementById("lockable-title"))throw new e(n.IN_USE);var d=o.firstElementChild;if(!d)throw new e(n.UNK_STRUCT);var r=document.createElement("div");r.innerHTML='<div class=row><div class=col-md-12><div class="form-group selectize-group"data-attr=title><label for=lockable-title>Title</label><div class=input-group><a class="edit-lock-addon input-group-addon"data-field=title href=# tabindex=-1><i class="glyphicon lock"></i> </a><input class="form-control lockable-field"id=lockable-title name=title placeholder=""></div></div></div></div>';var s=r.firstElementChild,c=s.children[0].children[0].children[1],h=c.children[0],m=c.children[1],u=l.title,f=0==l.index?"Specials":`Season ${l.index}`;u&&m.setAttribute("value",u),m.setAttribute("placeholder",f),1==l.lockedFields.state.filter(e=>"title"==e.name&&e.locked).length&&h.classList.add("locked"),o.insertBefore(s,d)}catch(n){n instanceof e?alert(`Bookmarklet Error: ${n.message}`):alert(`Unexpected ${n.name}: ${n.message}${t}`)}})()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement