On www.youtube.com I am trying to replace:
<div id="masthead" class="" dir="ltr">
<a id="logo-container" href="/" title="YouTube home">
<img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif"
alt="YouTube home">
</a>
<div id="masthead-user-bar-container" >
<div id="masthead-user-bar">
<div id="masthead-user">
<span id="masthead-user-expander"class="yt-uix-expander yt-uix-
expander-collapsed"data-expander-
action="yt.www.masthead.toggleExpandedMasthead"><span id="masthead-
user-wrapper" class="yt-uix-expander-head yt-rounded"
tabindex="0"><button type="button" id="masthead-user-button"
onclick=";return false;" class=" yt-uix-button yt-uix-button-text yt-
uix-button-toggle" role="button"><span class="yt-uix-button-
content"> <span id="masthead-user-image">
<span class="clip">
<span class="clip-center">
<img src="http://i1.ytimg.com/i/0vizxIIPy3xLVsPMd4isaw/1.jpg?
v=8f8172" alt="(YOUR YOUTUBE USERNAME GOES HERE">
<span class="vertical-center"></span>
</span>
</span>
</span>
<span class="masthead-user-username">YOUR YOUTUBE USERNAME GOES
HERE</span>
<span class="yt-uix-expander-arrow"></span>
</span></button></span></span>
</div>
</div>
</div>
<div id="masthead-search-bar-container" >
<div id="masthead-search-bar">
<div id="masthead-nav"><a href="/videos?feature=mh" >Browse</a><span
class="masthead-link-separator">|</span><a href="/shows?feature=mh"
>TV Shows</a> <span class="masthead-link-separator">|</
span><a href="/movies?feature=mh" >Films</a> <span
class="masthead-link-separator">|</span><a href="http://
www.youtube.com/my_videos_upload" >Upload</a></div>
<form id="masthead-search" class="search-form consolidated-form"
action="/results" onsubmit="if (_gel('masthead-search-
term').value == '') return false;">
<button class="search-btn-compontent search-button yt-uix-button"
onclick="if (_gel('masthead-search-term').value == '')
return false; _gel('masthead-search').submit(); return
false;;return true;" type="submit" id="search-btn" dir="ltr"
tabindex="2" role="button"><span class="yt-uix-button-content">Search
</span></button><div id="masthead-search-terms"
dir="ltr"><label><input id="masthead-search-term"
onfocus="_addclass(_gel('masthead-search'),
'focused'); " onblur="_removeclass(_gel('masthead-
search'), 'focused');" autocomplete="off" class="search-
term " name="search_query" value="" type="text" tabindex="1"
onkeyup="goog.i18n.bidi.setDirAttribute(event,this)" title="Search"></
label></div> </form>
</div>
</div>
</div>
With:
<div id="masthead">
<a class="logo" href="http://web.archive.org/web/20091026171708/
http://www.youtube.com/">
<img border="0" alt="" src="http://web.archive.org/web/
20091026171708im_/https://www.google.com/accounts/youtube/
youtube_pixel.gif"/>
</a>
<div id="masthead-main">
<div id="masthead-search">
<form name="searchForm" method="get" action="http://web.archive.org/
web/20091026171708/http://www.youtube.com/results" class="search-
form">
<div class="search-wrapper">
<input type="text" maxlength="128" value="" tabindex="1"
name="search_query" class="search-term" id="masthead-search-term"/>
<input type="hidden" value="" name="search_type" id="search-type-
masthead"/>
<a onclick="document.searchForm.submit(); return false;"
href="http://web.archive.org/web/20091026171708/https://www.google.com/
accounts/ForgotPasswd?service=youtube<mpl=sso#" class="yt-button
yt-button-primary">
<span>
Search
</span>
</a>
</div>
</form>
</div>
<div id="masthead-nav-main">
<a href="http://web.archive.org/web/20091026171708/http://
www.youtube.com/">
Home
</a>
<a href="http://web.archive.org/web/20091026171708/http://
www.youtube.com/browse">
Videos
</a>
<a href="http://web.archive.org/web/20091026171708/http://
www.youtube.com/members">
Channels
</a>
<a href="http://web.archive.org/web/20091026171708/http://
www.youtube.com/shows">
Shows
</a>
Obviously I will chnage web archive stuff for no wen archive stuff
when it is working and YOUR YOUTUBE USERNAME GOES HERE will be
replaced with your YouTube username (it would be useful if someone
could give me an ID for that aswell) I have writen scripts before but
still do not much about writing scripts.
Below is what i tried:
// ==/UserScript==
var eska1, eska2, eska3;
eska1 = document.getElementById('masthead-container');
if (eska1) {
eska2.innerHTML = '
<div id="masthead" class="" dir="ltr">
<a id="logo-container" href="/" title="YouTube home">
<img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif"
alt="YouTube home">
</a>
<div id="masthead-user-bar-container" >
<div id="masthead-user-bar">
<div id="masthead-user">
<span id="masthead-user-expander"class="yt-uix-expander yt-uix-
expander-collapsed"data-expander-
action="yt.www.masthead.toggleExpandedMasthead"><span id="masthead-
user-wrapper" class="yt-uix-expander-head yt-rounded"
tabindex="0"><button type="button" id="masthead-user-button"
onclick=";return false;" class=" yt-uix-button yt-uix-button-text yt-
uix-button-toggle" role="button"><span class="yt-uix-button-
content"> <span id="masthead-user-image">
<span class="clip">
<span class="clip-center">
<img src="http://i1.ytimg.com/i/0vizxIIPy3xLVsPMd4isaw/1.jpg?
v=8f8172" alt="MY YOUTUBE USER NAME WAS HERE">
<span class="vertical-center"></span>
</span>
</span>
</span>
<span class="masthead-user-username">MY YOUTUBE USERNAME WAS HERE</
span>
<span class="yt-uix-expander-arrow"></span>
</span></button></span></span>
</div>
</div>
</div>
<div id="masthead-search-bar-container" >
<div id="masthead-search-bar">
<div id="masthead-nav"><a href="/videos?feature=mh" >Browse</a><span
class="masthead-link-separator">|</span><a href="/shows?feature=mh"
>TV Shows</a> <span class="masthead-link-separator">|</
span><a href="/movies?feature=mh" >Films</a> <span
class="masthead-link-separator">|</span><a href="http://
www.youtube.com/my_videos_upload" >Upload</a></div>
<form id="masthead-search" class="search-form consolidated-form"
action="/results" onsubmit="if (_gel('masthead-search-
term').value == '') return false;">
<button class="search-btn-compontent search-button yt-uix-button"
onclick="if (_gel('masthead-search-term').value == '')
return false; _gel('masthead-search').submit(); return
false;;return true;" type="submit" id="search-btn" dir="ltr"
tabindex="2" role="button"><span class="yt-uix-button-content">Search
</span></button><div id="masthead-search-terms"
dir="ltr"><label><input id="masthead-search-term"
onfocus="_addclass(_gel('masthead-search'),
'focused'); " onblur="_removeclass(_gel('masthead-
search'), 'focused');" autocomplete="off" class="search-
term " name="search_query" value="" type="text" tabindex="1"
onkeyup="goog.i18n.bidi.setDirAttribute(event,this)" title="Search"></
label></div> </form>
</div>
</div>
</div>';
eska3.innerHTML = '<div id="masthead">
<a class="logo" href="http://web.archive.org/web/20091026171708/
http://www.youtube.com/">
<img border="0" alt="" src="http://web.archive.org/web/
20091026171708im_/https://www.google.com/accounts/youtube/
youtube_pixel.gif"/>
</a>
<div id="masthead-main">
<div id="masthead-search">
<form name="searchForm" method="get" action="http://web.archive.org/
web/20091026171708/http://www.youtube.com/results" class="search-
form">
<div class="search-wrapper">
<input type="text" maxlength="128" value="" tabindex="1"
name="search_query" class="search-term" id="masthead-search-term"/>
<input type="hidden" value="" name="search_type" id="search-type-
masthead"/>
<a onclick="document.searchForm.submit(); return false;"
href="http://web.archive.org/web/20091026171708/https://www.google.com/
accounts/ForgotPasswd?service=youtube<mpl=sso#" class="yt-button
yt-button-primary">
<span>
Search
</span>
</a>
</div>
</form>
</div>
<div id="masthead-nav-main">
<a href="http://web.archive.org/web/20091026171708/http://
www.youtube.com/">
Home
</a>
<a href="http://web.archive.org/web/20091026171708/http://
www.youtube.com/browse">
Videos
</a>
<a href="http://web.archive.org/web/20091026171708/http://
www.youtube.com/members">
Channels
</a>
<a href="http://web.archive.org/web/20091026171708/http://
www.youtube.com/shows">
Shows
</a>';
eska1.innerHTML.replace(eska2, eska3);
}
Sorry if this post is TLDR but any help is apreciated.
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en.