aboutsummaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-10-05 02:11:44 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-10-05 02:11:44 +0200
commita8621265e27daefc4bd76fdf446e65648db4387d (patch)
tree9624340dfafaffd86210313db35a1a8423afb1d3 /core/js
parent36196b6c2d68ba7de74b8314743539b043325198 (diff)
parent2c95c799e6b4b433dccb6efe04fe2c6dc9e5d9f9 (diff)
downloadnextcloud-server-a8621265e27daefc4bd76fdf446e65648db4387d.tar.gz
nextcloud-server-a8621265e27daefc4bd76fdf446e65648db4387d.zip
Merge branch 'master' of gitorious.org:owncloud/owncloud
Diffstat (limited to 'core/js')
-rwxr-xr-xcore/js/jquery.infieldlabel.min.js12
-rw-r--r--core/js/js.js43
-rw-r--r--core/js/multiselect.js12
-rw-r--r--core/js/setup.js2
4 files changed, 56 insertions, 13 deletions
diff --git a/core/js/jquery.infieldlabel.min.js b/core/js/jquery.infieldlabel.min.js
new file mode 100755
index 00000000000..8f0ab9f7c5e
--- /dev/null
+++ b/core/js/jquery.infieldlabel.min.js
@@ -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
diff --git a/core/js/js.js b/core/js/js.js
index f5abd9df6b3..9e814ca0729 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -244,7 +244,36 @@ function object(o) {
return new F();
}
+
+/**
+ * Fills height of window. (more precise than height: 100%;)
+ */
+function fillHeight(selector) {
+ var height = parseFloat($(window).height())-parseFloat(selector.css('top'));
+ selector.css('height', height + 'px');
+ if(selector.outerHeight() > selector.height())
+ selector.css('height', height-(selector.outerHeight()-selector.height()) + 'px');
+}
+
+/**
+ * Fills height and width of window. (more precise than height: 100%; or width: 100%;)
+ */
+function fillWindow(selector) {
+ fillHeight(selector);
+ var width = parseFloat($(window).width())-parseFloat(selector.css('left'));
+ selector.css('width', width + 'px');
+ if(selector.outerWidth() > selector.width())
+ selector.css('width', width-(selector.outerWidth()-selector.width()) + 'px');
+}
+
$(document).ready(function(){
+
+ $(window).resize(function () {
+ fillHeight($('#leftcontent'));
+ fillWindow($('#rightcontent'));
+ });
+ $(window).trigger('resize');
+
if(!SVGSupport()){//replace all svg images with png images for browser that dont support svg
replaceSVG();
}else{
@@ -252,7 +281,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 +319,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 +333,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 +351,7 @@ $(document).ready(function(){
});
$('#settings #expanddiv').click(function(event){
event.stopPropagation();
- })
+ });
$('#settings #expand').hover(function(){
$('#settings #expand+span').fadeToggle();
});
diff --git a/core/js/multiselect.js b/core/js/multiselect.js
index 559cdf9b167..26380824047 100644
--- a/core/js/multiselect.js
+++ b/core/js/multiselect.js
@@ -43,25 +43,25 @@
});
button.addClass('active');
event.stopPropagation();
- var options=$(this).parent().next().children().map(function(){return $(this).val()});
+ var options=$(this).parent().next().children().map(function(){return $(this).val();});
var list=$('<ul class="multiselectoptions"/>').hide().appendTo($(this).parent());
function createItem(item,checked){
var id='ms'+multiSelectId+'-option-'+item;
var input=$('<input id="'+id+'" type="checkbox"/>');
var label=$('<label for="'+id+'">'+item+'</label>');
if(settings.checked.indexOf(item)!=-1 || checked){
- input.attr('checked','checked');
+ input.attr('checked',true);
}
if(checked){
settings.checked.push(item);
}
input.change(function(){
var groupname=$(this).next().text();
- if($(this).attr('checked')){
+ if($(this).is(':checked')){
settings.checked.push(groupname);
if(settings.oncheck){
if(settings.oncheck(groupname)===false){
- $(this).removeAttr('checked');
+ $(this).attr('checked', false);
return;
}
}
@@ -70,7 +70,7 @@
settings.checked.splice(index,1);
if(settings.onuncheck){
if(settings.onuncheck(groupname)===false){
- $(this).attr('checked','checked');
+ $(this).attr('checked',true);
return;
}
}
@@ -81,7 +81,7 @@
}else{
button.children('span').first().text(settings.title);
}
- var newOuterWidth=Math.max((button.outerWidth()-2),settings.minOuterWidth)+'px'
+ var newOuterWidth=Math.max((button.outerWidth()-2),settings.minOuterWidth)+'px';
var newWidth=Math.max(button.width(),settings.minWidth);
button.css('height',button.height());
button.css('white-space','nowrap');
diff --git a/core/js/setup.js b/core/js/setup.js
index e16f9b6e329..b765d41ba35 100644
--- a/core/js/setup.js
+++ b/core/js/setup.js
@@ -1,6 +1,7 @@
$(document).ready(function() {
$('#selectDbType').buttonset();
$('#datadirContent').hide(250);
+ $('#databaseField').hide(250);
if($('#hasSQLite').val()=='true'){
$('#use_other_db').hide();
$('#dbhost').hide();
@@ -29,6 +30,7 @@ $(document).ready(function() {
$('#showAdvanced').click(function() {
$('#datadirContent').slideToggle(250);
+ $('#databaseField').slideToggle(250);
});
$("form").submit(function(){
// Save form parameters