Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
<html> | ||
<head> | ||
<title>YUI3: Loading YUI3 in a GreaseMonkey script</title> | ||
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css"> | ||
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/assets/skins/sam/skin.css"> | ||
<link rel="stylesheet" href="http://blog.davglass.com/wp-content/themes/davglass/style.css" type="text/css"> | ||
<link rel="stylesheet" type="text/css" href="http://developer.yahoo.com/yui/assets/dpSyntaxHighlighter.css"> | ||
<style type="text/css" media="screen"> | ||
p, h2 { | ||
margin: 1em; | ||
} | ||
</style> | ||
</head> | ||
<body class="yui-skin-sam"> | ||
<div id="davdoc" class="yui-t7"> | ||
<div id="hd"><h1 id="header"><a href="http://blog.davglass.com/">YUI3: Loading YUI3 in a GreaseMonkey script</a></h1></div> | ||
<div id="bd"> | ||
<p>This GreaseMonkey User Script loads YUI 3.</p> | ||
|
||
<h2>The Script</h2> | ||
<textarea name="code" class="JScript"><?php include('yui3.user.js'); ?></textarea> | ||
</div> | ||
<div id="ft"> </div> | ||
</div> | ||
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/utilities/utilities.js"></script> | ||
<script src="http://developer.yahoo.com/yui/assets/dpSyntaxHighlighter.js"></script> | ||
<script type="text/javascript" src="../js/toolseffects-min.js"></script> | ||
<script type="text/javascript" src="../js/davglass.js"></script> | ||
<script type="text/javascript"> | ||
|
||
(function() { | ||
var Dom = YAHOO.util.Dom, | ||
Event = YAHOO.util.Event; | ||
|
||
|
||
|
||
dp.SyntaxHighlighter.HighlightAll('code'); | ||
})(); | ||
|
||
</script> | ||
</body> | ||
</html> | ||
<?php @include_once($_SERVER["DOCUMENT_ROOT"]."/wp-content/plugins/shortstat/inc.stats.php"); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// ==UserScript== | ||
// @name YUI3 Loader | ||
// @namespace http://blog.davglass.com/files/yui3/greasemonkey/ | ||
// @description Loads YUI3 | ||
// @author Dav Glass (davglass@gmail.com) | ||
// @include http://* | ||
// @version 0.1 | ||
// @date 2009/07/24 | ||
// ==/UserScript== | ||
|
||
(function() { | ||
var uw = unsafeWindow, | ||
YUI, script, head, | ||
YUILoaded = function() { | ||
YUI = uw.YUI; | ||
YUI.config.doc = uw.document; | ||
YUI.config.win = uw; | ||
YUI().use('node', 'dd-drag', function(Y) { | ||
var body = Y.get('body'); | ||
Y.log(body); | ||
body.setStyle('backgroundColor', 'red'); | ||
var h = Y.all('h2'); | ||
h.setStyle('cursor', 'move'); | ||
h.each(function(v) { | ||
new Y.DD.Drag({ | ||
node: v | ||
}); | ||
}); | ||
}); | ||
}; | ||
|
||
if (!uw.YUI) { | ||
script = uw.document.createElement('script'); | ||
script.src = 'http:/'+'/yui.yahooapis.com/3.0.0b1/build/yui/yui-min.js'; | ||
script.onload = YUILoaded; | ||
head = uw.document.getElementsByTagName('head')[0]; | ||
head.appendChild(script); | ||
|
||
} | ||
|
||
})(); |