summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-10-02 10:11:18 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-10-02 10:11:18 +0200
commit8b08b1b455b474de3fa376dfafa3de63727364ea (patch)
tree536b2d4ba4f979d69f4f6e73755e06635345f78a /core/js
parent084f76fd14125023d5b7277c558eb86a20ea07d3 (diff)
parent535ed8369f701a184340a428e82cc8d7cc7588bb (diff)
downloadnextcloud-server-8b08b1b455b474de3fa376dfafa3de63727364ea.tar.gz
nextcloud-server-8b08b1b455b474de3fa376dfafa3de63727364ea.zip
Merge branch 'master' into sharing_mail_notification_master
Conflicts: lib/private/util.php
Diffstat (limited to 'core/js')
-rw-r--r--core/js/jquery.avatar.js6
-rw-r--r--core/js/placeholder.js15
-rw-r--r--core/js/share.js4
3 files changed, 20 insertions, 5 deletions
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js
index f1382fd7d2d..88a4c25d1ee 100644
--- a/core/js/jquery.avatar.js
+++ b/core/js/jquery.avatar.js
@@ -69,7 +69,11 @@
var url = OC.Router.generate('core_avatar_get', {user: user, size: size})+'?requesttoken='+oc_requesttoken;
$.get(url, function(result) {
if (typeof(result) === 'object') {
- $div.placeholder(user);
+ if (result.data && result.data.displayname) {
+ $div.placeholder(user, result.data.displayname);
+ } else {
+ $div.placeholder(user);
+ }
} else {
if (ie8fix === true) {
$div.html('<img src="'+url+'#'+Math.floor(Math.random()*1000)+'">');
diff --git a/core/js/placeholder.js b/core/js/placeholder.js
index d63730547d7..ee2a8ce84c4 100644
--- a/core/js/placeholder.js
+++ b/core/js/placeholder.js
@@ -36,10 +36,21 @@
*
* <div id="albumart" style="background-color: hsl(123, 90%, 65%); ... ">T</div>
*
+ * You may also call it like this, to have a different background, than the seed:
+ *
+ * $('#albumart').placeholder('The Album Title', 'Album Title');
+ *
+ * Resulting in:
+ *
+ * <div id="albumart" style="background-color: hsl(123, 90%, 65%); ... ">A</div>
+ *
*/
(function ($) {
- $.fn.placeholder = function(seed) {
+ $.fn.placeholder = function(seed, text) {
+ // set optional argument "text" to value of "seed" if undefined
+ text = text || seed;
+
var hash = md5(seed),
maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16),
hue = parseInt(hash, 16) / maxRange * 256,
@@ -56,7 +67,7 @@
this.css('font-size', (height * 0.55) + 'px');
if(seed !== null && seed.length) {
- this.html(seed[0].toUpperCase());
+ this.html(text[0].toUpperCase());
}
};
}(jQuery));
diff --git a/core/js/share.js b/core/js/share.js
index b366665ed3f..8d14520cd74 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -175,10 +175,10 @@ OC.Share={
var allowPublicUploadStatus = false;
$.each(data.shares, function(key, value) {
- if (allowPublicUploadStatus) {
+ if (value.share_type === OC.Share.SHARE_TYPE_LINK) {
+ allowPublicUploadStatus = (value.permissions & OC.PERMISSION_CREATE) ? true : false;
return true;
}
- allowPublicUploadStatus = (value.permissions & OC.PERMISSION_CREATE) ? true : false;
});
html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Share with')+'" />';