-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrotate.xml
29 lines (23 loc) · 1.08 KB
/
rotate.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Rotate image" />
<UserPref name="image" display_name="Image" />
<UserPref name="func" display_name="Function" />
<Content type="html">
<![CDATA[
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'></script>
<script type='text/javascript' src='https://jqueryrotate.googlecode.com/svn/trunk/jQueryRotate.js'></script>
<script type='text/javascript' src='https://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js'></script>
<script type="text/javascript">
var prefs = new gadgets.Prefs();
function getImg() {
img = $($("div").get(0).firstChild);
}
$(document.body).append("<div><img id='#img' src='"+prefs.getString("image")+"'></div>");
var img = document.getElementsByTagName('img')[0];
eval("var obj = "+prefs.getString("func"));
$(img).rotate(obj);
</script>
]]>
</Content>
</Module>