]> git.saurik.com Git - cydget.git/commitdiff
Added a PhotoExample.cydget and renamed Cycript= to CycriptURLs=.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 9 Nov 2009 21:19:06 +0000 (21:19 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 9 Nov 2009 21:19:06 +0000 (21:19 +0000)
LockScreen.mm
PhotoExample.cydget/Info.plist [new file with mode: 0644]
PhotoExample.cydget/index.html [new file with mode: 0644]
Welcome.plist
control
makefile

index 4333ce96f35f902a4bffd77514148266f64633b1..0fc9a10d1989798bc4e13d8ffc31dc0a47ab486a 100644 (file)
@@ -532,7 +532,7 @@ class Pcre {
 
         NSDictionary *configuration([$CydgetController currentConfiguration]);
 
-        cycript_ = [configuration objectForKey:@"Cycript"];
+        cycript_ = [configuration objectForKey:@"CycriptURLs"];
 
         scrollable_ = [[configuration objectForKey:@"Scrollable"] boolValue];
         [scroller_ setScrollingEnabled:scrollable_];
diff --git a/PhotoExample.cydget/Info.plist b/PhotoExample.cydget/Info.plist
new file mode 100644 (file)
index 0000000..700b552
--- /dev/null
@@ -0,0 +1,8 @@
+Tagline = "a lame example Cydget that renders Camera photos";
+Plugin = "WebCycriptLockScreen";
+
+Configuration = {
+    Homepage = "file:///System/Library/LockCydgets/PhotoExample.cydget/index.html";
+    CycriptURLs = "^file:///System/Library/LockCydgets/PhotoExample\\.cydget/index\\.html$";
+    Scrollable = "NO";
+};
diff --git a/PhotoExample.cydget/index.html b/PhotoExample.cydget/index.html
new file mode 100644 (file)
index 0000000..ff28b98
--- /dev/null
@@ -0,0 +1,129 @@
+<html><head>
+    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
+<style>
+    * {
+        border: 0;
+        -moz-border-radius: 0;
+        -webkit-border-radius: 0;
+        box-sizing: border-box;
+        -moz-box-sizing: border-box;
+        -ms-box-sizing: border-box;
+        -webkit-box-sizing: border-box;
+        /*font-family: inherit;*/
+        font-size: 100%;
+        font-style: inherit;
+        font-weight: inherit;
+        margin: 0;
+        outline: 0;
+        padding: 0;
+        text-decoration: none;
+        vertical-align: baseline;
+    }
+
+    body {
+        color: white;
+    }
+
+    #lcd {
+        background: url(cydget://_UIImageWithName/UILCDBackground.png);
+        height: 96px;
+        width: 320px;
+    }
+
+    #lcd h1 {
+        font-family: "LockClock-Light";
+        font-size: 65px;
+        left: 1px;
+        position: relative;
+        text-align: center;
+        text-shadow: -0.5px -1px 1px black;
+        top: -6px;
+    }
+
+    #lcd h2 {
+        font-family: "Helvetica";
+        font-size: 17px;
+        position: relative;
+        text-align: center;
+        text-shadow: -0.5px -1px 1px black;
+        top: -16px;
+    }
+
+    #content {
+        font-family: "Helvetica";
+        min-height: 268px;
+        text-align:center;
+    }
+
+    #content h3 {
+        font-size: 20px;
+        text-align: center;
+        margin-bottom: 10px;
+    }
+
+    #content p {
+        font-size: 14px;
+        text-align: justify;
+        margin: 10px 12px;
+    }
+
+    sup {
+        font-size: smaller;
+        position: relative;
+        top: -5px;
+    }
+
+    #content img {
+        margin: auto;
+        max-height: 268px;
+        max-width: 320px;
+        vertical-align:middle;
+    }
+</style></head><body>
+    <div id="content"><script type="text/cycript">
+        document.write('<div id="lcd">');
+
+        var locale = CFLocaleCopyCurrent();
+        var now = CFDateCreate(NULL, CFAbsoluteTimeGetCurrent());
+        var formatter = CFDateFormatterCreate(NULL, locale, kCFDateFormatterNoStyle, kCFDateFormatterNoStyle);
+        CFRelease(locale);
+
+        CFDateFormatterSetFormat(formatter, UIDateFormatStringForFormatType(UINoAMPMTimeFormat));
+        var time = CFDateFormatterCreateStringWithDate(NULL, formatter, now);
+        document.write('<h1>');
+        document.write(time);
+        document.write('</h1>');
+        CFRelease(time);
+
+        CFDateFormatterSetFormat(formatter, UIDateFormatStringForFormatType(UIWeekdayNoYearDateFormat));
+        var date = CFDateFormatterCreateStringWithDate(NULL, formatter, now);
+        document.write('<h2>');
+        document.write(date);
+        document.write('</h2>');
+        CFRelease(date);
+
+        CFRelease(formatter);
+        CFRelease(now);
+
+        document.write('</div>');
+
+        dlopen("/System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary", RTLD_GLOBAL);
+        var album = PLCameraAlbum.sharedInstance.images;
+
+        var jpeg = null, length = album.length;
+        for (var i = 0; i != 5; ++i) {
+            jpeg = album[Math.floor(Math.random() * length)].fileGroup.pathForFullSizeImage;
+            if (jpeg != null)
+                break;
+        }
+
+        if (jpeg == null)
+            for (var i = 0; i != length; ++i) {
+                jpeg = album[Math.floor(i)].fileGroup.pathForFullSizeImage;
+                if (jpeg != null)
+                    break;
+            }
+
+        document.write('<img src="' + jpeg + '"/>');
+    </script></div>
+</body></html>
index ba23259615707ef824997c164e09d73cb69a4696..96020d2940e3e2ccb65de521fe812c60b37a0bc3 100644 (file)
@@ -3,6 +3,6 @@ Plugin = "WebCycriptLockScreen";
 
 Configuration = {
     Homepage = "file:///System/Library/LockCydgets/Welcome.cydget/Welcome.html";
-    Cycript = "^file:///System/Library/LockCydgets/Welcome\\.cydget/Welcome\\.html$";
+    CycriptURLs = "^file:///System/Library/LockCydgets/Welcome\\.cydget/Welcome\\.html$";
     Scrollable = "NO";
 };
diff --git a/control b/control
index 353bc85e8da89c12578c7062f49a2b645b0b3ab2..a0b2e39a14ffdb37e4d449f4db7e6b754ba893b0 100644 (file)
--- a/control
+++ b/control
@@ -3,7 +3,7 @@ Priority: optional
 Section: Development
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 0.9.3085-1
+Version: 0.9.3086-1
 Description: framework for managing lock screen plugins
 Name: Cydget
 Depends: mobilesubstrate (>= 0.9.2587-1), firmware (>= 2.2), preferenceloader, apr-lib, pcre
index 0a85f5b3b8ac10bd50ce77cec2e8bf96b546cca1..3acf1a1475e3700b47620ce033f1a06980779803 100644 (file)
--- a/makefile
+++ b/makefile
@@ -23,6 +23,7 @@ extra:
        cp -a Welcome.html package/System/Library/LockCydgets/Welcome.cydget
        cp -a Welcome.plist package/System/Library/LockCydgets/Welcome.cydget/Info.plist
        svn export AwayView.cydget package/System/Library/LockCydgets/AwayView.cydget
+       svn export PhotoExample.cydget package/System/Library/LockCydgets/PhotoExample.cydget
        mkdir -p package/System/Library/SpringBoardPlugins/WebCycriptLockScreen.bundle
        cp -a Info.plist package/System/Library/SpringBoardPlugins/WebCycriptLockScreen.bundle
        cp -a WebCycriptLockScreen package/System/Library/SpringBoardPlugins/WebCycriptLockScreen.bundle