]> source.dussan.org Git - nextcloud-server.git/commitdiff
sharing code between the two bookmarklets
authorAlessandro Cosentino <cosenal@gmail.com>
Wed, 22 Feb 2012 21:38:05 +0000 (16:38 -0500)
committerAlessandro Cosentino <cosenal@gmail.com>
Wed, 22 Feb 2012 21:38:05 +0000 (16:38 -0500)
apps/bookmarks/css/bookmarks.css
apps/bookmarks/templates/bookmarklet.php [new file with mode: 0644]
apps/bookmarks/templates/list.php
apps/bookmarks/templates/settings.php

index 499a4e9c53e94b511d3754e43e254a6accce1f6e..7203078ffda620a7823c1effdc00483820eb5e62 100644 (file)
@@ -1,7 +1,7 @@
 #content { overflow: auto; height: 100%; }
 #firstrun { width: 80%; margin: 5em auto auto auto; text-align: center; font-weight:bold; font-size:1.5em;  color:#777;}
 #firstrun small { display: block; font-weight: normal; font-size: 0.5em; }
-#firstrun #selections { font-size:0.8em;  width: 100%; margin: 2em auto auto auto; clear: both; }
+#firstrun #selections { font-size:0.8em;  font-weight: normal; width: 100%; margin: 2em auto auto auto; clear: both; }
 
 .bookmarks_headline {
        font-size: large;
        display: none;
        margin-left: 5px;
 }
-
-#footer {
-       color: #999;
-       font-size: medium;
-       text-align: center;
-       position: absolute;
-       bottom: 10px;
-       left: 0px;
-       width: 100%;
-       height: 20px;
-       visibility: visible;
-       display: block
-}
diff --git a/apps/bookmarks/templates/bookmarklet.php b/apps/bookmarks/templates/bookmarklet.php
new file mode 100644 (file)
index 0000000..eaae21d
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+function createBookmarklet() {
+         $l = new OC_L10N('bookmarks');
+         echo "<em>" .$l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage:') . "</em>&nbsp;";
+         echo "<a style='background-color:#eee;border:1px groove #999; padding:5px;padding-top:0px;padding-bottom:2px; text-decoration:none; margin-top:5px' href=\"javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open('" . OC_Helper::linkToAbsolute('bookmarks', 'addBm.php') . "?output=popup&url='+c(b.location)+'&title='+c(b.title),'bkmk_popup','left='+((a.screenX||a.screenLeft)+10)+',top='+((a.screenY||a.screenTop)+10)+',height=510px,width=550px,resizable=1,alwaysRaised=1');a.setTimeout(function(){d.focus()},300)})();\">";
+         echo $l->t('Add page to ownCloud') . "</a>";
+} 
index d772cb905aa878a424259773d8bffbc504720102..ae63d4dc6fd915af54cf5d132074de4984bd79a6 100644 (file)
 </div>
 <div id="firstrun">
        <?php echo $l->t('You have no bookmarks'); ?>
-       <small><?php echo $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.'); ?></small>
        <div id="selections">
-               <a class="button" href='javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open("<?php echo OC_Helper::linkToAbsolute('bookmarks', 'addBm.php') ?>?output=popup&url="+c(b.location)+"&title="+c(b.title),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=510px,width=550px,resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},300)})();'><?php echo $l->t('Add page to ownCloud'); ?></a>
+       <?php
+         require_once('bookmarklet.php');
+         createBookmarklet(); 
+       ?>
        </div>
 </div>
index b787e31f3c582e4479ef79baeedfe1ae71a4ffa0..31edf7478bfed53c5290ed207a387b840fa91b94 100644 (file)
@@ -8,7 +8,10 @@
 ?>
 <form id="bookmarks">
                <fieldset class="personalblock">
-                       <span class="bold"><?php echo $l->t('Bookmarklet:');?></span>&nbsp;<a class="bookmarks_addBml" href='javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open("<?php echo OC_Helper::linkToAbsolute('bookmarks', 'addBm.php') ?>?output=popup&url="+c(b.location)+"&title="+c(b.title),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=510px,width=550px,resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},300)})();'><?php echo $l->t('Add page to ownCloud'); ?></a>
-                       <br/><em><?php echo $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.'); ?></em><br />
+                       <span class="bold"><?php echo $l->t('Bookmarklet <br />');?></span>
+                       <?php
+                           require_once('bookmarklet.php');
+                           createBookmarklet(); 
+                       ?>
                </fieldset>
 </form>