aboutsummaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-30 09:21:37 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-30 09:21:37 +0200
commit952433eae6cdf15e8615b4da682b81f4537b0ba0 (patch)
treed0adb161a3184fd6890df1eca8922f87ad300836 /core/js
parent46e47be78272b76c6c569a8f1589d78828d72ec1 (diff)
parent5899485ca17045e93528c29d1ed63b02192c4191 (diff)
downloadnextcloud-server-952433eae6cdf15e8615b4da682b81f4537b0ba0.tar.gz
nextcloud-server-952433eae6cdf15e8615b4da682b81f4537b0ba0.zip
Merge branch 'master' into move-aborted-upload-detection-into-plugin-master
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 f54f13c95e3..82f5da0baea 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -174,10 +174,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')+'" />';