aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-24 19:27:33 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-24 19:27:33 +0200
commit66813e9df6eb96a960462a3dc8dbe1de4df5314c (patch)
tree69985a6adc77d66a5289e321172231f89849a4ec /core
parent54e0f1d739b4b3820cafafca039a3524d3dd28ba (diff)
parent3917d18980638e86f5cce9242adeded0ca760260 (diff)
downloadnextcloud-server-66813e9df6eb96a960462a3dc8dbe1de4df5314c.tar.gz
nextcloud-server-66813e9df6eb96a960462a3dc8dbe1de4df5314c.zip
Merge branch 'master' into fix-language-detection
Diffstat (limited to 'core')
-rw-r--r--core/css/share.css51
-rw-r--r--core/css/styles.css13
-rw-r--r--core/js/jquery.avatar.js6
-rw-r--r--core/js/jquery.placeholder.js216
-rw-r--r--core/js/js.js2
-rw-r--r--core/js/octemplate.js2
-rw-r--r--core/js/placeholder.js6
-rw-r--r--core/js/share.js57
-rw-r--r--core/templates/message.html2
-rw-r--r--core/templates/update.admin.php (renamed from core/templates/update.php)0
-rw-r--r--core/templates/update.user.php8
11 files changed, 300 insertions, 63 deletions
diff --git a/core/css/share.css b/core/css/share.css
index 2a21dc6edf6..d8140242e06 100644
--- a/core/css/share.css
+++ b/core/css/share.css
@@ -21,28 +21,41 @@
padding:.5em;
}
-#shareWithList li {
- padding-top:.1em;
-}
-
-#shareWithList li:first-child {
- white-space:normal;
-}
-
-#shareWithList .cruds {
- margin-left:-10px;
-}
-
-#shareWithList .unshare img, #shareWithList .showCruds img {
- vertical-align:text-bottom; /* properly align icons */
-}
-
+ #shareWithList li {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ font-weight: bold;
+ line-height: 21px;
+ white-space: normal;
+ }
+
+ #shareWithList .unshare img, #shareWithList .showCruds img {
+ vertical-align:text-bottom; /* properly align icons */
+ }
+
+ #shareWithList label input[type=checkbox]{
+ margin-left: 0;
+ }
+ #shareWithList .username{
+ padding-right: .5em;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ max-width: 254px;
+ display: inline-block;
+ overflow: hidden;
+ vertical-align: middle;
+ }
+ #shareWithList li label{
+ margin-right: .5em;
+ }
#dropdown label {
font-weight:400;
+ white-space: nowrap;
}
#dropdown input[type="checkbox"] {
margin:0 .2em 0 .5em;
+ vertical-align: middle;
}
a.showCruds {
@@ -99,3 +112,9 @@ a.showCruds:hover,a.unshare:hover {
overflow-y:auto;
overflow-x:hidden;
}
+
+.notCreatable {
+ padding-left: 12px;
+ padding-top: 12px;
+ color: #999;
+}
diff --git a/core/css/styles.css b/core/css/styles.css
index 62ee0e56cae..868829b1c58 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -202,7 +202,7 @@ input[type="submit"].enabled {
-moz-box-sizing:border-box; box-sizing:border-box;
}
#leftcontent, .leftcontent {
- position:relative; overflow:auto; width:20em; height:100%;
+ position:relative; overflow:auto; width:256px; height:100%;
background:#f8f8f8; border-right:1px solid #ddd;
-moz-box-sizing:border-box; box-sizing:border-box;
}
@@ -211,7 +211,11 @@ input[type="submit"].enabled {
#leftcontent li.active, .leftcontent li.active { font-weight:bold; }
#leftcontent li:hover, .leftcontent li:hover { color:#333; background:#ddd; }
#leftcontent a { height:100%; display:block; margin:0; padding:0 1em 0 0; float:left; }
-#rightcontent, .rightcontent { position:fixed; top:6.4em; left:24.5em; overflow:auto }
+#rightcontent, .rightcontent { position:fixed; top:89px; left: 336px; overflow:auto }
+
+#controls + .leftcontent{
+ top: 44px;
+}
#emptycontent {
font-size: 1.5em;
@@ -441,6 +445,11 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; }
cursor: default;
}
+#body-login .update {
+ text-align: center;
+ color: #ccc;
+}
+
#body-user .warning, #body-settings .warning {
margin-top: 8px;
padding: 5px;
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js
index 00068101726..dbab032b971 100644
--- a/core/js/jquery.avatar.js
+++ b/core/js/jquery.avatar.js
@@ -60,7 +60,7 @@
if (typeof(this.data('user')) !== 'undefined') {
user = this.data('user');
} else {
- this.placeholder('x');
+ this.imageplaceholder('x');
return;
}
}
@@ -76,9 +76,9 @@
if (typeof(result) === 'object') {
if (!hidedefault) {
if (result.data && result.data.displayname) {
- $div.placeholder(user, result.data.displayname);
+ $div.imageplaceholder(user, result.data.displayname);
} else {
- $div.placeholder(user);
+ $div.imageplaceholder(user);
}
} else {
$div.hide();
diff --git a/core/js/jquery.placeholder.js b/core/js/jquery.placeholder.js
new file mode 100644
index 00000000000..689462582b3
--- /dev/null
+++ b/core/js/jquery.placeholder.js
@@ -0,0 +1,216 @@
+/*
+ jQuery placeholder plugin
+ by Andrey Kuzmin, @unsoundscapes
+
+ Based on existing plugin http://mths.be/placeholder by @mathias
+ and this demo http://robertnyman.com/2011/05/02/ by @robertnyman
+
+ Adopted to toggle placeholder on user input instead of focus
+
+ Released under the MIT license
+*/
+
+(function (factory) {
+ 'use strict';
+
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as anonymous module.
+ define(['jquery'], factory)
+ } else {
+ // Browser globals.
+ factory(jQuery)
+ }
+}(function ($) {
+ 'use strict';
+
+ var isInputSupported = 'placeholder' in document.createElement('input')
+ , isTextareaSupported = 'placeholder' in document.createElement('textarea')
+ , $placeholders = $()
+
+ function getAttributes (element) {
+ // Return an object of element attributes
+ var newAttrs = {}
+ , rinlinejQuery = /^jQuery\d+$/
+
+ $.each(element.attributes, function () {
+ if (this.specified && !rinlinejQuery.test(this.name)) {
+ newAttrs[this.name] = this.value
+ }
+ })
+ return newAttrs
+ }
+
+ function setCaretTo (element, index) {
+ // Set caret to specified @index
+ if (element.createTextRange) {
+ var range = element.createTextRange()
+ range.move('character', index)
+ range.select()
+ } else if (element.selectionStart !== null) {
+ element.focus()
+ element.setSelectionRange(index, index)
+ }
+ }
+
+
+ function Placeholder (element, options) {
+ this.options = options || {}
+ this.$replacement = this.$element = $(element)
+ this.initialize.apply(this, arguments)
+ // Cache all elements with placeholders
+ $placeholders = $placeholders.add(element)
+ }
+
+ Placeholder.prototype = {
+
+ initialize: function () {
+ this.isHidden = true
+ this.placeholderAttr = this.$element.attr('placeholder')
+ // do not mess with default behavior
+ this.$element.removeAttr('placeholder')
+ this.isPassword = this.$element.is('[type=password]')
+ if (this.isPassword) this.makeReplacement()
+ this.$replacement.on({
+ 'keydown.placeholder': $.proxy(this.hide, this)
+ , 'focus.placeholder drop.placeholder click.placeholder': $.proxy(this.setCaret, this)
+ })
+ this.$element.on({
+ 'blur.placeholder keyup.placeholder': $.proxy(this.show, this)
+ })
+ this.show()
+ }
+
+ // Set or get input value
+ // Setting value toggles placeholder
+ , val: function (value) {
+ if (value === undefined) {
+ return this.isHidden ? this.$element[0].value : '';
+ }
+ if (value === '') {
+ if (this.isHidden) {
+ this.$element[0].value = value
+ this.show()
+ }
+ } else {
+ if (!this.isHidden) this.hide()
+ this.$element[0].value = value
+ }
+ return this
+ }
+
+ // Hide placeholder at user input
+ , hide: function (e) {
+ var isActiveElement = this.$replacement.is(':focus')
+ if (this.isHidden) return;
+ if (!e || !(e.shiftKey && e.keyCode === 16) && e.keyCode !== 9) {
+ this.isHidden = true
+ if (this.isPassword) {
+ this.$replacement.before(this.$element.show()).hide()
+ if (isActiveElement) this.$element.focus()
+ } else {
+ this.$element[0].value = ''
+ this.$element.removeClass(this.options.className)
+ }
+ }
+ }
+
+ // Show placeholder on blur and keyup
+ , show: function (e) {
+ var isActiveElement = this.$element.is(':focus')
+ if (!this.isHidden) return;
+ if (this.$element[0].value === '') {
+ this.isHidden = false
+ if (this.isPassword) {
+ this.$element.before(this.$replacement.show()).hide()
+ if (isActiveElement) this.$replacement.focus()
+ } else {
+ this.$element[0].value = this.placeholderAttr
+ this.$element.addClass(this.options.className)
+ if (isActiveElement) this.setCaret(e)
+ }
+ }
+ }
+
+ // Set caret at the beginning of the input
+ , setCaret: function (e) {
+ if (e && !this.isHidden) {
+ setCaretTo(this.$replacement[0], 0)
+ e.preventDefault()
+ }
+ }
+
+ // Make and return replacement element
+ , makeReplacement: function () {
+ // we can't use $.fn.clone because ie <= 8 doesn't allow type change
+ var replacementAttributes =
+ $.extend(
+ getAttributes(this.$element[0])
+ , { 'type': 'text'
+ , 'value': this.placeholderAttr
+ }
+ )
+
+ // replacement should not have input name
+ delete replacementAttributes.name
+
+ this.$replacement = $('<input>', replacementAttributes)
+ .data('placeholder', this)
+ .addClass(this.options.className)
+
+ return this.$replacement;
+ }
+
+ }
+
+
+ // Override jQuery val and prop hooks
+ $.valHooks.input = $.valHooks.textarea = $.propHooks.value = {
+ get: function (element) {
+ var placeholder = $(element).data('placeholder')
+ return placeholder ? placeholder.val() : element.value;
+ }
+ , set: function (element, value) {
+ var placeholder = $(element).data('placeholder')
+ return placeholder ? placeholder.val(value) : element.value = value;
+ }
+ }
+
+
+ // Plugin definition
+ $.fn.placeholder = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('placeholder')
+ , options = $.extend({}, $.fn.placeholder.defaults, typeof option === 'object' && option)
+
+ if (!data && $this.is('[placeholder]') && (options.force ||
+ !isInputSupported && $this.is('input') ||
+ !isTextareaSupported && $this.is('textarea'))) {
+ $this.data('placeholder', data = new Placeholder(this, options))
+ }
+
+ if (data && typeof option === 'string') data[option]()
+ })
+ }
+ $.fn.placeholder.defaults = {
+ force: false
+ , className: 'placeholder'
+ }
+ $.fn.placeholder.Constructor = Placeholder
+
+
+ // Events
+ $(document).on('submit.placeholder', 'form', function () {
+ // Clear the placeholder values so they don't get submitted
+ $placeholders.placeholder('hide')
+ // And then restore them back
+ setTimeout(function () { $placeholders.placeholder('show') }, 10)
+ })
+ $(window).on('beforeunload.placeholder', function () {
+ // Clear placeholders upon page reload
+ $placeholders.placeholder('hide')
+ })
+
+ return Placeholder
+
+}));
diff --git a/core/js/js.js b/core/js/js.js
index c17e3fa2959..f5991cfc9dd 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -933,7 +933,7 @@ jQuery.fn.selectRange = function(start, end) {
*/
jQuery.fn.exists = function(){
return this.length > 0;
-}
+};
/**
* Calls the server periodically every 15 mins to ensure that session doesnt
diff --git a/core/js/octemplate.js b/core/js/octemplate.js
index 46ffa976574..aab705059d2 100644
--- a/core/js/octemplate.js
+++ b/core/js/octemplate.js
@@ -82,7 +82,7 @@
}
);
} catch(e) {
- console.error(e, 'data:', data)
+ console.error(e, 'data:', data);
}
},
options: {
diff --git a/core/js/placeholder.js b/core/js/placeholder.js
index ee2a8ce84c4..47cff780d2f 100644
--- a/core/js/placeholder.js
+++ b/core/js/placeholder.js
@@ -30,7 +30,7 @@
*
* And call this from Javascript:
*
- * $('#albumart').placeholder('The Album Title');
+ * $('#albumart').imageplaceholder('The Album Title');
*
* Which will result in:
*
@@ -38,7 +38,7 @@
*
* You may also call it like this, to have a different background, than the seed:
*
- * $('#albumart').placeholder('The Album Title', 'Album Title');
+ * $('#albumart').imageplaceholder('The Album Title', 'Album Title');
*
* Resulting in:
*
@@ -47,7 +47,7 @@
*/
(function ($) {
- $.fn.placeholder = function(seed, text) {
+ $.fn.imageplaceholder = function(seed, text) {
// set optional argument "text" to value of "seed" if undefined
text = text || seed;
diff --git a/core/js/share.js b/core/js/share.js
index 281cccaaef8..ff557652b67 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -200,13 +200,13 @@ OC.Share={
}
});
- html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Share with')+'" />';
+ html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Share with user or group …')+'" />';
html += '<ul id="shareWithList">';
html += '</ul>';
var linksAllowed = $('#allowShareWithLink').val() === 'yes';
if (link && linksAllowed) {
html += '<div id="link">';
- html += '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">'+t('core', 'Share with link')+'</label>';
+ html += '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">'+t('core', 'Share link')+'</label>';
html += '<br />';
html += '<input id="linkText" type="text" readonly="readonly" />';
html += '<input type="checkbox" name="showPassword" id="showPassword" value="1" style="display:none;" /><label for="showPassword" style="display:none;">'+t('core', 'Password protect')+'</label>';
@@ -310,6 +310,9 @@ OC.Share={
$('#dropdown').show('blind', function() {
OC.Share.droppedDown = true;
});
+ if ($('html').hasClass('lte9')){
+ $('#dropdown input[placeholder]').placeholder();
+ }
$('#shareWith').focus();
},
hideDropDown:function(callback) {
@@ -363,29 +366,21 @@ OC.Share={
shareChecked = 'checked="checked"';
}
var html = '<li style="clear: both;" data-share-type="'+escapeHTML(shareType)+'" data-share-with="'+escapeHTML(shareWith)+'" title="' + escapeHTML(shareWith) + '">';
- html += '<a href="#" class="unshare" style="display:none;"><img class="svg" alt="'+t('core', 'Unshare')+'" src="'+OC.imagePath('core', 'actions/delete')+'"/></a>';
- if(shareWith.length > 14){
- html += escapeHTML(shareWithDisplayName.substr(0,11) + '...');
- }else{
- html += escapeHTML(shareWithDisplayName);
- }
+ var showCrudsButton;
+ html += '<a href="#" class="unshare"><img class="svg" alt="'+t('core', 'Unshare')+'" src="'+OC.imagePath('core', 'actions/delete')+'"/></a>';
+ html += '<span class="username">' + escapeHTML(shareWithDisplayName) + '</span>';
var mailNotificationEnabled = $('input:hidden[name=mailNotificationEnabled]').val();
if (mailNotificationEnabled === 'yes') {
var checked = '';
if (mailSend === '1') {
checked = 'checked';
}
- html += '<label><input type="checkbox" name="mailNotification" class="mailNotification" ' + checked + ' />'+t('core', 'notify user by email')+'</label>';
+ html += '<label><input type="checkbox" name="mailNotification" class="mailNotification" ' + checked + ' />'+t('core', 'notify by email')+'</label> ';
}
if (possiblePermissions & OC.PERMISSION_CREATE || possiblePermissions & OC.PERMISSION_UPDATE || possiblePermissions & OC.PERMISSION_DELETE) {
- if (editChecked == '') {
- html += '<label style="display:none;">';
- } else {
- html += '<label>';
- }
- html += '<input type="checkbox" name="edit" class="permissions" '+editChecked+' />'+t('core', 'can edit')+'</label>';
+ html += '<label><input type="checkbox" name="edit" class="permissions" '+editChecked+' />'+t('core', 'can edit')+'</label> ';
}
- html += '<a href="#" class="showCruds" style="display:none;"><img class="svg" alt="'+t('core', 'access control')+'" src="'+OC.imagePath('core', 'actions/triangle-s')+'"/></a>';
+ showCrudsButton = '<a href="#" class="showCruds"><img class="svg" alt="'+t('core', 'access control')+'" src="'+OC.imagePath('core', 'actions/triangle-s')+'"/></a>';
html += '<div class="cruds" style="display:none;">';
if (possiblePermissions & OC.PERMISSION_CREATE) {
html += '<label><input type="checkbox" name="create" class="permissions" '+createChecked+' data-permissions="'+OC.PERMISSION_CREATE+'" />'+t('core', 'create')+'</label>';
@@ -401,7 +396,15 @@ OC.Share={
}
html += '</div>';
html += '</li>';
- $(html).appendTo('#shareWithList');
+ html = $(html).appendTo('#shareWithList');
+ // insert cruds button into last label element
+ var lastLabel = html.find('>label:last');
+ if (lastLabel.exists()){
+ lastLabel.append(showCrudsButton);
+ }
+ else{
+ html.find('.cruds').before(showCrudsButton);
+ }
$('#expiration').show();
}
},
@@ -507,26 +510,8 @@ $(document).ready(function() {
}
});
- $(document).on('mouseenter', '#dropdown #shareWithList li', function(event) {
- // Show permissions and unshare button
- $(':hidden', this).filter(':not(.cruds)').show();
- });
-
- $(document).on('mouseleave', '#dropdown #shareWithList li', function(event) {
- // Hide permissions and unshare button
- if (!$('.cruds', this).is(':visible')) {
- $('a', this).hide();
- if (!$('input[name="edit"]', this).is(':checked')) {
- $('input[type="checkbox"]', this).hide();
- $('label', this).hide();
- }
- } else {
- $('a.unshare', this).hide();
- }
- });
-
$(document).on('click', '#dropdown .showCruds', function() {
- $(this).parent().find('.cruds').toggle();
+ $(this).closest('li').find('.cruds').toggle();
return false;
});
diff --git a/core/templates/message.html b/core/templates/message.html
index 59048100f32..cd642231a9e 100644
--- a/core/templates/message.html
+++ b/core/templates/message.html
@@ -1,3 +1,3 @@
-<div id="{dialog_name}" title="{title}">
+<div id="{dialog_name}" title="{title} "><!-- the ' ' after {title} fixes ie8, see http://stackoverflow.com/a/5313137/828717 -->
<p><span class="ui-icon ui-icon-{type}"></span>{message}</p>
</div>
diff --git a/core/templates/update.php b/core/templates/update.admin.php
index a652d5f195a..a652d5f195a 100644
--- a/core/templates/update.php
+++ b/core/templates/update.admin.php
diff --git a/core/templates/update.user.php b/core/templates/update.user.php
new file mode 100644
index 00000000000..bb93f0fad00
--- /dev/null
+++ b/core/templates/update.user.php
@@ -0,0 +1,8 @@
+<ul>
+ <li class='update'>
+ <?php p($l->t('This ownCloud instance is currently being updated, which may take a while.')) ?><br/><br/>
+ <?php p($l->t('Please reload this page after a short time to continue using ownCloud.')) ?><br/><br/>
+ <?php p($l->t('Contact your system administrator if this message persists or appeared unexpectedly.')) ?><br/><br/>
+ <?php p($l->t('Thank you for your patience.')); ?><br/><br/>
+ </li>
+</ul>