]> source.dussan.org Git - nextcloud-server.git/commitdiff
added infield labels. readded fade in of login button. updated label on install page.
authorMarvin Thomas Rabe <m.rabe@echtzeitraum.de>
Mon, 3 Oct 2011 12:41:55 +0000 (14:41 +0200)
committerMarvin Thomas Rabe <m.rabe@echtzeitraum.de>
Mon, 3 Oct 2011 12:41:55 +0000 (14:41 +0200)
core/css/styles.css
core/js/jquery.infieldlabel.min.js [new file with mode: 0755]
core/js/js.js
core/templates/installation.php
core/templates/login.php
index.php
lib/base.php
lostpassword/templates/lostpassword.php
lostpassword/templates/resetpassword.php

index 4d9cb2037740c445f49949872f1fcbbd9ae80911..8f3093333184c1de3fdcfcd4a5533915e207db8f 100644 (file)
@@ -49,7 +49,6 @@ form.searchbox input[type="search"] { position:fixed; font-size:1.2em; top:.4em;
 input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; }
 input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-shadow:#ffeedd 0 1px 0; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; }
 
-
 /* CONTENT ------------------------------------------------------------------ */
 #controls { width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; }
 #controls .button { display:inline-block; }
@@ -70,7 +69,11 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
 #login form { width:22em; margin:2em auto 2em; padding:0; }
 #login form fieldset { background:0; border:0; margin-bottom:2em; padding:0; }
 #login form fieldset legend { font-weight:bold; }
-#login form label { position:absolute; margin:.8em .8em; font-size:1.5em; color:#666; }
+#login form label { margin:.8em .8em; color:#666; }
+/* NEEDED FOR INFIELD LABELS */
+p.infield { position: relative; }
+label.infield { cursor: text !important; }
+#login form label.infield { position:absolute; font-size:1.5em; color:#AAA; }
 #login #dbhostlabel, #login #directorylabel { display:block; margin:.95em 0 .8em -8em; }
 #login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; }
 #login form ul.errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; }
diff --git a/core/js/jquery.infieldlabel.min.js b/core/js/jquery.infieldlabel.min.js
new file mode 100755 (executable)
index 0000000..8f0ab9f
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * In-Field Label jQuery Plugin
+ * http://fuelyourcoding.com/scripts/infield.html
+ *
+ * Copyright (c) 2009 Doug Neiner
+ * Dual licensed under the MIT and GPL licenses.
+ * Uses the same license as jQuery, see:
+ * http://docs.jquery.com/License
+ *
+ * @version 0.1
+ */
+(function($){$.InFieldLabels=function(b,c,d){var f=this;f.$label=$(b);f.label=b;f.$field=$(c);f.field=c;f.$label.data("InFieldLabels",f);f.showing=true;f.init=function(){f.options=$.extend({},$.InFieldLabels.defaultOptions,d);if(f.$field.val()!=""){f.$label.hide();f.showing=false};f.$field.focus(function(){f.fadeOnFocus()}).blur(function(){f.checkForEmpty(true)}).bind('keydown.infieldlabel',function(e){f.hideOnChange(e)}).change(function(e){f.checkForEmpty()}).bind('onPropertyChange',function(){f.checkForEmpty()})};f.fadeOnFocus=function(){if(f.showing){f.setOpacity(f.options.fadeOpacity)}};f.setOpacity=function(a){f.$label.stop().animate({opacity:a},f.options.fadeDuration);f.showing=(a>0.0)};f.checkForEmpty=function(a){if(f.$field.val()==""){f.prepForShow();f.setOpacity(a?1.0:f.options.fadeOpacity)}else{f.setOpacity(0.0)}};f.prepForShow=function(e){if(!f.showing){f.$label.css({opacity:0.0}).show();f.$field.bind('keydown.infieldlabel',function(e){f.hideOnChange(e)})}};f.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(f.showing){f.$label.hide();f.showing=false};f.$field.unbind('keydown.infieldlabel')};f.init()};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(c){return this.each(function(){var a=$(this).attr('for');if(!a)return;var b=$("input#"+a+"[type='text'],"+"input#"+a+"[type='password'],"+"textarea#"+a);if(b.length==0)return;(new $.InFieldLabels(this,b[0],c))})}})(jQuery);
\ No newline at end of file
index f5abd9df6b3274e916c053ab8d35dfc611033c0d..61a60c52485058dcd2ff8a31f3872b103de5a71d 100644 (file)
@@ -252,7 +252,7 @@ $(document).ready(function(){
        }
        $('form.searchbox').submit(function(event){
                event.preventDefault();
-       })
+       });
        $('#searchbox').keyup(function(event){
                if(event.keyCode==13){//enter
                        if(OC.search.currentResult>-1){
@@ -290,7 +290,9 @@ $(document).ready(function(){
        // 'show password' checkbox     
        $('#pass2').showPassword();
 
-       /* @TODO: Currently not working perfect. Remember-Checkbox is flashing.
+       //use infield labels
+       $("label.infield").inFieldLabels();
+
        // hide log in button etc. when form fields not filled
        $('#submit').hide();
        $('#remember_login').hide();
@@ -302,18 +304,16 @@ $(document).ready(function(){
                                empty = true;
                        }
                });
-
                if(empty) {
                        $('#submit').fadeOut();
-                       $('#remember_login').fadeOut();
+                       $('#remember_login').hide();
                        $('#remember_login+label').fadeOut();
                } else {
                        $('#submit').fadeIn();
-                       $('#remember_login').fadeIn();
+                       $('#remember_login').show();
                        $('#remember_login+label').fadeIn();
                }
        });
-       */
 
        if($('body').attr("id")=="body-user") { $('#settings #expanddiv').hide(); }
        $('#settings #expand').click(function(event) {
@@ -322,7 +322,7 @@ $(document).ready(function(){
        });
        $('#settings #expanddiv').click(function(event){
                event.stopPropagation();
-       })
+       });
        $('#settings #expand').hover(function(){
                $('#settings #expand+span').fadeToggle();
        });
index c1bfbdf176303ef8c1362386e35a512b0a0e777f..70a545d66cf0f7f0b525c43dcdfb9c49c8799764 100644 (file)
 
        <fieldset>
                <legend><?php echo $l->t( 'Create an <strong>admin account</strong>' ); ?></legend>
-               <input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" placeholder="<?php echo $l->t( 'Username' ); ?>" autocomplete="off" autofocus required />
-               <input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" placeholder="<?php echo $l->t( 'Password' ); ?>" required />
+               <p class="infield">
+                       <label for="adminlogin" class="infield"><?php echo $l->t( 'Username' ); ?></label>
+                       <input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" autocomplete="off" autofocus required />
+               </p>
+               <p class="infield">
+                       <label for="adminpass" class="infield"><?php echo $l->t( 'Password' ); ?></label>
+                       <input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" required />
+               </p>
        </fieldset>
 
        <fieldset id="datadirField">
                <legend><a id="showAdvanced"><?php echo $l->t( 'Advanced' ); ?> ▾</a></legend>
                <div id="datadirContent">
-                       <input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" placeholder="<?php echo $l->t( 'Data folder' ); ?>" />
+                       <label for="directory"><?php echo $l->t( 'Data folder' ); ?>:</label><br/>
+                       <input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" />
                </div>
        </fieldset>
 
 
                <?php if($hasOtherDB): ?>
                <div id="use_other_db">
-                       <input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" placeholder="<?php echo $l->t( 'Database user' ); ?>" autocomplete="off" />
-                       <input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" placeholder="<?php echo $l->t( 'Database password' ); ?>" />
-                       <input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" placeholder="<?php echo $l->t( 'Database name' ); ?>" autocomplete="off" />
+                       <p class="infield">
+                               <label for="dbuser" class="infield"><?php echo $l->t( 'Database user' ); ?></label>
+                               <input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" autocomplete="off" />
+                       </p>
+                       <p class="infield">
+                               <label for="dbpass" class="infield"><?php echo $l->t( 'Database password' ); ?></label>
+                               <input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" />
+                       </p>
+                       <p class="infield">
+                               <label for="dbname" class="infield"><?php echo $l->t( 'Database name' ); ?></label>
+                               <input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" autocomplete="off" />
+                       </p>
                </div>
                <?php endif; ?>
-                       <input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" placeholder="<?php echo $l->t( 'Database host' ); ?>" />
-
+               <p class="infield">
+                       <label for="dbhost" class="infield"><?php echo $l->t( 'Database host' ); ?></label>
+                       <input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" />
+               </p>
        </fieldset>
 
        <div class="buttons"><input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" /></div>
index f4ee44be4ed7080e0fbb1c354eebcad3205e9309..46b44c24d78d18c7b08c841663f2b8be5ee432ee 100644 (file)
@@ -3,8 +3,14 @@
                <?php if($_['error']): ?>
                        <a href="./lostpassword/"><?php echo $l->t('Lost your password?'); ?></a>
                <?php endif; ?>
-               <input type="text" name="user" id="user" placeholder="<?php echo $l->t( 'Username' ); ?>" value="<?php echo !empty($_POST['user'])?$_POST['user'].'"':'" autofocus'; ?> autocomplete="off" required />
-               <input type="password" name="password" id="password" placeholder="<?php echo $l->t( 'Password' ); ?>" value="" required <?php echo !empty($_POST['user'])?'autofocus':''; ?> />
+               <p class="infield">
+                       <label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
+                       <input type="text" name="user" id="user" value="<?php echo !empty($_POST['user'])?$_POST['user'].'"':'" autofocus'; ?> autocomplete="off" required />
+               </p>
+               <p class="infield">
+                       <label for="password" class="infield"><?php echo $l->t( 'Password' ); ?></label>
+                       <input type="password" name="password" id="password" value="" required <?php echo !empty($_POST['user'])?'autofocus':''; ?> />
+               </p>
                <input type="checkbox" name="remember_login" value="1" id="remember_login" /><label for="remember_login"><?php echo $l->t('remember'); ?></label>
                <input type="submit" id="submit" class="login" value="<?php echo $l->t( 'Log in' ); ?>" />
        </fieldset>
index 072f526d8f938e60a676455161dbb46a72354dfc..fb8d1922dd475cadd3bf9ebd4230324f4816a646 100644 (file)
--- a/index.php
+++ b/index.php
@@ -28,7 +28,7 @@ require_once('lib/base.php');
 // Setup required :
 $not_installed = !OC_Config::getValue('installed', false);
 $install_called = (isset($_POST['install']) AND $_POST['install']=='true');
-if($not_installed OR true) {
+if($not_installed) {
        OC_Util::addScript('setup');
        require_once('setup.php');
        exit();
index de2e7a36eeedc41f2b665ec1d86d54babe51e73b..0156febe2311fd37494337c30b57f5252c8ae605 100644 (file)
@@ -115,6 +115,7 @@ class OC{
                OC_Util::addScript( "jquery-1.6.4.min" );
                OC_Util::addScript( "jquery-ui-1.8.14.custom.min" );
                OC_Util::addScript( "jquery-showpassword" );
+               OC_Util::addScript( "jquery.infieldlabel.min" );
                OC_Util::addScript( "jquery-tipsy" );
                OC_Util::addScript( "js" );
                //OC_Util::addScript( "multiselect" );
index 2c38a1562fe4808c21cd00377fd9bc24888530ae..4b871963b8055fbc6159ba0b8dcb595acd51da42 100644 (file)
@@ -7,7 +7,10 @@
                        <?php if ($_['error']): ?>
                                <?php echo $l->t('Login failed!'); ?>
                        <?php endif; ?>
-                       <input type="text" name="user" id="user" placeholder="<?php echo $l->t('Username'); ?>" value="" autocomplete="off" required autofocus />
+                       <p class="infield">
+                               <label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
+                               <input type="text" name="user" id="user" value="" autocomplete="off" required autofocus />
+                       </p>
                        <input type="submit" id="submit" value="<?php echo $l->t('Request reset'); ?>" />
                <?php endif; ?>
        </fieldset>
index 3ab9dd6543c7611048d534e2578d94faa61d4a68..56257de7f1371f7f8a4aa3747b651ebd7123adf7 100644 (file)
@@ -4,7 +4,10 @@
                        <h1><?php echo $l->t('Your password was reset'); ?></h1>
                        <p><a href="<?php echo OC::$WEBROOT ?>/"><?php echo $l->t('To login page'); ?></a></p>
                <?php else: ?>
-                       <input type="password" name="password" id="password" placeholder="<?php echo $l->t('New password'); ?>" value="" required />
+                       <p class="infield">
+                               <label for="password" class="infield"><?php echo $l->t( 'New password' ); ?></label>
+                               <input type="password" name="password" id="password" value="" required />
+                       </p>
                        <input type="submit" id="submit" value="<?php echo $l->t('Reset password'); ?>" />
                <?php endif; ?>
        </fieldset>