From 64c9fdcc28333c7310df8d9efb9040dbe3b4f8c8 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 1 Jun 2013 16:38:35 +0200 Subject: Speed up octemplate rendering. --- core/js/octemplate.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'core/js') diff --git a/core/js/octemplate.js b/core/js/octemplate.js index e032506c0b1..352a23c4dc7 100644 --- a/core/js/octemplate.js +++ b/core/js/octemplate.js @@ -60,11 +60,9 @@ var self = this; if(typeof this.options.escapeFunction === 'function') { - $.each(this.vars, function(key, val) { - if(typeof val === 'string') { - self.vars[key] = self.options.escapeFunction(val); - } - }); + for (var key = 0; key < this.vars.length; key++) { + this.vars[key] = self.options.escapeFunction(this.vars[key]); + } } var _html = this._build(this.vars); -- cgit v1.2.3 From bfcf113ce7e4293c955fd76e51e4515f29232b94 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 1 Jun 2013 16:47:34 +0200 Subject: Forgot typeof condition --- core/js/octemplate.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/js') diff --git a/core/js/octemplate.js b/core/js/octemplate.js index 352a23c4dc7..e69c6cc56e0 100644 --- a/core/js/octemplate.js +++ b/core/js/octemplate.js @@ -61,7 +61,9 @@ if(typeof this.options.escapeFunction === 'function') { for (var key = 0; key < this.vars.length; key++) { - this.vars[key] = self.options.escapeFunction(this.vars[key]); + if(typeof this.vars[key] === 'string') { + this.vars[key] = self.options.escapeFunction(this.vars[key]); + } } } -- cgit v1.2.3 From 3fe46706aff12995a49f5b69d0ea3645dae6de7c Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sun, 2 Jun 2013 19:53:18 +0200 Subject: Update to jquery.multiselect 1.13 --- core/js/jquery.multiselect.js | 153 +++++++++++++++++++++++++++--------------- 1 file changed, 100 insertions(+), 53 deletions(-) (limited to 'core/js') diff --git a/core/js/jquery.multiselect.js b/core/js/jquery.multiselect.js index 46aab7ebf01..16ae4264177 100644 --- a/core/js/jquery.multiselect.js +++ b/core/js/jquery.multiselect.js @@ -1,6 +1,7 @@ +/* jshint forin:true, noarg:true, noempty:true, eqeqeq:true, boss:true, undef:true, curly:true, browser:true, jquery:true */ /* - * jQuery MultiSelect UI Widget 1.11 - * Copyright (c) 2011 Eric Hynds + * jQuery MultiSelect UI Widget 1.13 + * Copyright (c) 2012 Eric Hynds * * http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ * @@ -34,8 +35,8 @@ $.widget("ech.multiselect", { noneSelectedText: 'Select options', selectedText: '# selected', selectedList: 0, - show: '', - hide: '', + show: null, + hide: null, autoOpen: false, multiple: true, position: {} @@ -62,7 +63,7 @@ $.widget("ech.multiselect", { menu = (this.menu = $('
')) .addClass('ui-multiselect-menu ui-widget ui-widget-content ui-corner-all') .addClass( o.classes ) - .insertAfter( button ), + .appendTo( document.body ), header = (this.header = $('
')) .addClass('ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix') @@ -119,70 +120,72 @@ $.widget("ech.multiselect", { menu = this.menu, checkboxContainer = this.checkboxContainer, optgroups = [], - html = [], + html = "", id = el.attr('id') || multiselectID++; // unique ID for the label & option tags // build items - this.element.find('option').each(function( i ){ + el.find('option').each(function( i ){ var $this = $(this), parent = this.parentNode, title = this.innerHTML, description = this.title, value = this.value, - inputID = this.id || 'ui-multiselect-'+id+'-option-'+i, + inputID = 'ui-multiselect-' + (this.id || id + '-option-' + i), isDisabled = this.disabled, isSelected = this.selected, - labelClasses = ['ui-corner-all'], + labelClasses = [ 'ui-corner-all' ], + liClasses = (isDisabled ? 'ui-multiselect-disabled ' : ' ') + this.className, optLabel; // is this an optgroup? - if( parent.tagName.toLowerCase() === 'optgroup' ){ - optLabel = parent.getAttribute('label'); + if( parent.tagName === 'OPTGROUP' ){ + optLabel = parent.getAttribute( 'label' ); // has this optgroup been added already? if( $.inArray(optLabel, optgroups) === -1 ){ - html.push('
  • ' + optLabel + '
  • '); + html += '
  • ' + optLabel + '
  • '; optgroups.push( optLabel ); } } if( isDisabled ){ - labelClasses.push('ui-state-disabled'); + labelClasses.push( 'ui-state-disabled' ); } // browsers automatically select the first option // by default with single selects if( isSelected && !o.multiple ){ - labelClasses.push('ui-state-active'); + labelClasses.push( 'ui-state-active' ); } - html.push('
  • '); + html += '
  • '; // create the label - html.push('
  • '); + html += ' />' + title + ''; }); // insert into the DOM - checkboxContainer.html( html.join('') ); + checkboxContainer.html( html ); // cache some moar useful elements this.labels = menu.find('label'); + this.inputs = this.labels.children('input'); // set widths this._setButtonWidth(); @@ -197,10 +200,10 @@ $.widget("ech.multiselect", { } }, - // updates the button text. call refresh() to rebuild + // updates the button text. call refresh() to rebuild update: function(){ var o = this.options, - $inputs = this.labels.find('input'), + $inputs = this.inputs, $checked = $inputs.filter(':checked'), numChecked = $checked.length, value; @@ -211,7 +214,7 @@ $.widget("ech.multiselect", { if($.isFunction( o.selectedText )){ value = o.selectedText.call(this, numChecked, $inputs.length, $checked.get()); } else if( /\d/.test(o.selectedList) && o.selectedList > 0 && numChecked <= o.selectedList){ - value = $checked.map(function(){ return this.title; }).get().join(', '); + value = $checked.map(function(){ return $(this).next().html(); }).get().join(', '); } else { value = o.selectedText.replace('#', numChecked).replace('#', $inputs.length); } @@ -291,8 +294,8 @@ $.widget("ech.multiselect", { var $this = $(this), $inputs = $this.parent().nextUntil('li.ui-multiselect-optgroup-label').find('input:visible:not(:disabled)'), - nodes = $inputs.get(), - label = $this.parent().text(); + nodes = $inputs.get(), + label = $this.parent().text(); // trigger event and bail if the return is false if( self._trigger('beforeoptgrouptoggle', e, { inputs:nodes, label:label }) === false ){ @@ -343,11 +346,15 @@ $.widget("ech.multiselect", { tags = self.element.find('option'); // bail if this input is disabled or the event is cancelled - if( this.disabled || self._trigger('click', e, { value:val, text:this.title, checked:checked }) === false ){ + if( this.disabled || self._trigger('click', e, { value: val, text: this.title, checked: checked }) === false ){ e.preventDefault(); return; } + // make sure the input has focus. otherwise, the esc key + // won't close the menu after clicking an item. + $this.focus(); + // toggle aria state $this.attr('aria-selected', checked); @@ -389,7 +396,7 @@ $.widget("ech.multiselect", { // handler fires before the form is actually reset. delaying it a bit // gives the form inputs time to clear. $(this.element[0].form).bind('reset.multiselect', function(){ - setTimeout(function(){ self.update(); }, 10); + setTimeout($.proxy(self.refresh, self), 10); }); }, @@ -428,7 +435,7 @@ $.widget("ech.multiselect", { // if at the first/last element if( !$next.length ){ - var $container = this.menu.find('ul:last'); + var $container = this.menu.find('ul').last(); // move to the first/last this.menu.find('label')[ moveToLast ? 'last' : 'first' ]().trigger('mouseover'); @@ -445,27 +452,29 @@ $.widget("ech.multiselect", { // other related attributes of a checkbox. // // The context of this function should be a checkbox; do not proxy it. - _toggleCheckbox: function( prop, flag ){ + _toggleState: function( prop, flag ){ return function(){ - !this.disabled && (this[ prop ] = flag); + if( !this.disabled ) { + this[ prop ] = flag; + } if( flag ){ this.setAttribute('aria-selected', true); } else { this.removeAttribute('aria-selected'); } - } + }; }, _toggleChecked: function( flag, group ){ - var $inputs = (group && group.length) ? - group : - this.labels.find('input'), - + var $inputs = (group && group.length) ? group : this.inputs, self = this; // toggle state on inputs - $inputs.each(this._toggleCheckbox('checked', flag)); + $inputs.each(this._toggleState('checked', flag)); + + // give the first input focus + $inputs.eq(0).focus(); // update button text this.update(); @@ -480,7 +489,7 @@ $.widget("ech.multiselect", { .find('option') .each(function(){ if( !this.disabled && $.inArray(this.value, values) > -1 ){ - self._toggleCheckbox('selected', flag).call( this ); + self._toggleState('selected', flag).call( this ); } }); @@ -494,9 +503,22 @@ $.widget("ech.multiselect", { this.button .attr({ 'disabled':flag, 'aria-disabled':flag })[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled'); - this.menu - .find('input') - .attr({ 'disabled':flag, 'aria-disabled':flag }) + var inputs = this.menu.find('input'); + var key = "ech-multiselect-disabled"; + + if(flag) { + // remember which elements this widget disabled (not pre-disabled) + // elements, so that they can be restored if the widget is re-enabled. + inputs = inputs.filter(':enabled') + .data(key, true) + } else { + inputs = inputs.filter(function() { + return $.data(this, key) === true; + }).removeData(key); + } + + inputs + .attr({ 'disabled':flag, 'arial-disabled':flag }) .parent()[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled'); this.element @@ -509,16 +531,17 @@ $.widget("ech.multiselect", { button = this.button, menu = this.menu, speed = this.speed, - o = this.options; + o = this.options, + args = []; // bail if the multiselectopen event returns false, this widget is disabled, or is already open if( this._trigger('beforeopen') === false || button.hasClass('ui-state-disabled') || this._isOpen ){ return; } - var $container = menu.find('ul:last'), + var $container = menu.find('ul').last(), effect = o.show, - pos = button.position(); + pos = button.offset(); // figure out opening effects/speeds if( $.isArray(o.show) ){ @@ -526,6 +549,12 @@ $.widget("ech.multiselect", { speed = o.show[1] || self.speed; } + // if there's an effect, assume jQuery UI is in use + // build the arguments to pass to show() + if( effect ) { + args = [ effect, speed ]; + } + // set the scroll of the checkbox container $container.scrollTop(0).height(o.height); @@ -536,17 +565,19 @@ $.widget("ech.multiselect", { menu .show() .position( o.position ) - .hide() - .show( effect, speed ); + .hide(); // if position utility is not available... } else { menu.css({ - top: pos.top+button.outerHeight(), + top: pos.top + button.outerHeight(), left: pos.left - }).show( effect, speed ); + }); } + // show the menu, maybe with a speed/effect combo + $.fn.show.apply(menu, args); + // select the first option // triggering both mouseover and mouseover because 1.4.2+ has a bug where triggering mouseover // will actually trigger mouseenter. the mouseenter trigger is there for when it's eventually fixed @@ -563,7 +594,10 @@ $.widget("ech.multiselect", { return; } - var o = this.options, effect = o.hide, speed = this.speed; + var o = this.options, + effect = o.hide, + speed = this.speed, + args = []; // figure out opening effects/speeds if( $.isArray(o.hide) ){ @@ -571,7 +605,11 @@ $.widget("ech.multiselect", { speed = o.hide[1] || this.speed; } - this.menu.hide(effect, speed); + if( effect ) { + args = [ effect, speed ]; + } + + $.fn.hide.apply(this.menu, args); this.button.removeClass('ui-state-active').trigger('blur').trigger('mouseleave'); this._isOpen = false; this._trigger('close'); @@ -618,6 +656,10 @@ $.widget("ech.multiselect", { return this.menu; }, + getButton: function(){ + return this.button; + }, + // react to option changes after initialization _setOption: function( key, value ){ var menu = this.menu; @@ -633,7 +675,7 @@ $.widget("ech.multiselect", { menu.find('a.ui-multiselect-none span').eq(-1).text(value); break; case 'height': - menu.find('ul:last').height( parseInt(value,10) ); + menu.find('ul').last().height( parseInt(value,10) ); break; case 'minWidth': this.options[ key ] = parseInt(value,10); @@ -649,6 +691,11 @@ $.widget("ech.multiselect", { case 'classes': menu.add(this.button).removeClass(this.options.classes).addClass(value); break; + case 'multiple': + menu.toggleClass('ui-multiselect-single', !value); + this.options.multiple = value; + this.element[0].multiple = value; + this.refresh(); } $.Widget.prototype._setOption.apply( this, arguments ); -- cgit v1.2.3 From 901b1150ffcdb3f541d6843221ba4ee3fb617751 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sun, 2 Jun 2013 21:52:59 +0200 Subject: Replacement for jquery.dialog to fit better with ownCloud design. --- core/css/jquery.ocdialog.css | 49 ++++++++++ core/css/styles.css | 6 +- core/js/jquery.ocdialog.js | 217 +++++++++++++++++++++++++++++++++++++++++++ core/js/oc-dialogs.js | 18 ++-- lib/base.php | 2 + 5 files changed, 282 insertions(+), 10 deletions(-) create mode 100644 core/css/jquery.ocdialog.css create mode 100644 core/js/jquery.ocdialog.js (limited to 'core/js') diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css new file mode 100644 index 00000000000..6342780aa95 --- /dev/null +++ b/core/css/jquery.ocdialog.css @@ -0,0 +1,49 @@ +.oc-dialog { + background: white; + color: #333333; + border-radius: 3px; box-shadow: 0 0 7px #888888; + padding: 15px; + z-index: 1000; + font-size: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + min-width: 200px; +} +.oc-dialog-title { + background: white; + font-weight: bold; + font-size: 110%; + margin-bottom: 10px; +} +.oc-dialog-content { + z-index: 1000; + background: white; + overflow-y: auto; +} +.oc-dialog-separator { +} +.oc-dialog-buttonrow { + background: white; + float: right; + position: relative; + bottom: 0; + display: block; + margin-top: 10px; +} + +.oc-dialog-close { + position:absolute; + top:7px; right:7px; + height:20px; width:20px; + background:url('../img/actions/delete.svg') no-repeat center; +} + +.oc-dialog-dim { + background-color: #000; + opacity: .20;filter:Alpha(Opacity=20); + z-index: 999; + position: absolute; + top: 0; left: 0; + width: 100%; height: 100%; +} diff --git a/core/css/styles.css b/core/css/styles.css index 70a840d6890..08a277a4ea8 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -391,7 +391,11 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin #oc-dialog-filepicker-content .dirtree span:not(:last-child) { cursor: pointer; } #oc-dialog-filepicker-content .dirtree span:last-child { font-weight: bold; } #oc-dialog-filepicker-content .dirtree span:not(:last-child)::after { content: '>'; padding: 3px;} -#oc-dialog-filepicker-content .filelist {height:270px; overflow-y:auto; background-color:white; width:100%;} +#oc-dialog-filepicker-content .filelist { + overflow-y:auto; + background-color:white; + width:100%; +} #oc-dialog-filepicker-content .filelist img { margin: 2px 1em 0 4px; } #oc-dialog-filepicker-content .filelist .date { float:right;margin-right:1em; } #oc-dialog-filepicker-content .filepicker_element_selected { background-color:lightblue;} diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js new file mode 100644 index 00000000000..7413927e3b2 --- /dev/null +++ b/core/js/jquery.ocdialog.js @@ -0,0 +1,217 @@ +(function($) { + $.widget('oc.ocdialog', { + options: { + width: 'auto', + height: 'auto', + closeButton: true, + closeOnEscape: true, + modal: false + }, + _create: function() { + var self = this; + + this.originalCss = { + display: this.element[0].style.display, + width: this.element[0].style.width, + height: this.element[0].style.height, + }; + + this.originalTitle = this.element.attr('title'); + this.options.title = this.options.title || this.originalTitle; + + this.$dialog = $('
    ') + .attr({ + // Setting tabIndex makes the div focusable + tabIndex: -1, + role: 'dialog' + }) + .insertBefore(this.element); + this.$dialog.append(this.element.detach()); + this.element.removeAttr('title').addClass('oc-dialog-content').appendTo(this.$dialog); + + this.$dialog.css({ + display: 'inline-block', + position: 'fixed' + }); + + $(document).on('keydown keyup', function(event) { + if(event.target !== self.$dialog.get(0) && self.$dialog.find($(event.target)).length === 0) { + return; + } + // Escape + if(event.keyCode === 27 && self.options.closeOnEscape) { + self.close(); + return false; + } + // Enter + if(event.keyCode === 13) { + event.stopImmediatePropagation(); + if(event.type === 'keyup') { + event.preventDefault(); + return false; + } + // If no button is selected we trigger the primary + if(self.$buttonrow && self.$buttonrow.find($(event.target)).length === 0) { + var $button = self.$buttonrow.find('button.primary'); + if($button) { + $button.trigger('click'); + } + } else if(self.$buttonrow) { + $(event.target).trigger('click'); + } + return false; + } + }); + $(window).resize(function() { + self.parent = self.$dialog.parent().length > 0 ? self.$dialog.parent() : $('body'); + var pos = self.parent.position(); + self.$dialog.css({ + left: pos.left + (self.parent.width() - self.$dialog.outerWidth())/2, + top: pos.top + (self.parent.height() - self.$dialog.outerHeight())/2 + }); + }); + + this._setOptions(this.options); + $(window).trigger('resize'); + this._createOverlay(); + }, + _init: function() { + this.$dialog.focus(); + this._trigger('open'); + }, + _setOption: function(key, value) { + var self = this; + switch(key) { + case 'title': + var $title = $('

    ' + this.options.title + + '

    '); //
    '); + if(this.$title) { + this.$title.replaceWith($title); + } else { + this.$title = $title.prependTo(this.$dialog); + } + this._setSizes(); + break; + case 'buttons': + var $buttonrow = $('
    '); + if(this.$buttonrow) { + this.$buttonrow.replaceWith($buttonrow); + } else { + this.$buttonrow = $buttonrow.appendTo(this.$dialog); + } + $.each(value, function(idx, val) { + var $button = $('
    + +
    +
    diff --git a/core/js/share.js b/core/js/share.js index 36e4babedf9..cb37dd70366 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -156,6 +156,19 @@ OC.Share={ html += '
    '; } if (possiblePermissions & OC.PERMISSION_SHARE) { + // Determine the Allow Public Upload status. + // Used later on to determine if the + // respective checkbox should be checked or + // not. + + var allowPublicUploadStatus = false; + $.each(data.shares, function(key, value) { + if (allowPublicUploadStatus) { + return true; + } + allowPublicUploadStatus = (value.permissions & OC.PERMISSION_CREATE) ? true : false; + }); + html += ''; html += '
      '; html += '
    '; @@ -168,12 +181,16 @@ OC.Share={ html += '
    '; html += ''; html += '
    '; - html += '
    '; + html += '
    '; html += ''; } + html += '
    '; html += ''; html += ''; @@ -370,6 +387,7 @@ OC.Share={ $('#expiration').show(); $('#emailPrivateLink #email').show(); $('#emailPrivateLink #emailButton').show(); + $('#allowPublicUploadWrapper').show(); }, hideLink:function() { $('#linkText').hide('blind'); @@ -378,6 +396,7 @@ OC.Share={ $('#linkPass').hide(); $('#emailPrivateLink #email').hide(); $('#emailPrivateLink #emailButton').hide(); + $('#allowPublicUploadWrapper').hide(); }, dirname:function(path) { return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, ''); @@ -543,6 +562,28 @@ $(document).ready(function() { $(this).select(); }); + // Handle the Allow Public Upload Checkbox + $(document).on('click', '#sharingDialogAllowPublicUpload', function() { + + // Gather data + var allowPublicUpload = $(this).is(':checked'); + var itemType = $('#dropdown').data('item-type'); + var itemSource = $('#dropdown').data('item-source'); + var permissions = 0; + + // Calculate permissions + if (allowPublicUpload) { + permissions = OC.PERMISSION_UPDATE + OC.PERMISSION_CREATE + OC.PERMISSION_READ; + } else { + permissions = OC.PERMISSION_READ; + } + + // Update the share information + OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', permissions, function(data) { + return; + }); + }); + $(document).on('click', '#dropdown #showPassword', function() { $('#linkPass').toggle('blind'); if (!$('#showPassword').is(':checked') ) { diff --git a/lib/files/view.php b/lib/files/view.php index 25071709fbe..d8d99698023 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -754,7 +754,7 @@ class View { if ($subStorage) { $subCache = $subStorage->getCache(''); $rootEntry = $subCache->get(''); - $data['size'] += $rootEntry['size']; + $data['size'] += isset($rootEntry['size']) ? $rootEntry['size'] : 0; } } } -- cgit v1.2.3 From e6c1db7a3f6d7ec35a1d55e5575e3e09d24bbbf8 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Wed, 26 Jun 2013 11:23:21 +0200 Subject: move javascript variables 'oc_current_user' and 'oc_requesttoken' to js.js - fixes #3853 --- core/js/config.php | 2 -- core/js/js.js | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'core/js') diff --git a/core/js/config.php b/core/js/config.php index 53a8fb96388..dd46f7889d1 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -26,8 +26,6 @@ $array = array( "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', "oc_webroot" => "\"".OC::$WEBROOT."\"", "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution - "oc_current_user" => "document.getElementsByTagName('head')[0].getAttribute('data-user')", - "oc_requesttoken" => "document.getElementsByTagName('head')[0].getAttribute('data-requesttoken')", "datepickerFormatDate" => json_encode($l->l('jsdate', 'jsdate')), "dayNames" => json_encode( array( diff --git a/core/js/js.js b/core/js/js.js index 3cb4d3dd151..08b429a555b 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -7,7 +7,10 @@ */ var oc_debug; var oc_webroot; -var oc_requesttoken; + +var oc_current_user = document.getElementsByTagName('head')[0].getAttribute('data-user'); +var oc_requesttoken = document.getElementsByTagName('head')[0].getAttribute('data-requesttoken'); + if (typeof oc_webroot === "undefined") { oc_webroot = location.pathname.substr(0, location.pathname.lastIndexOf('/')); } -- cgit v1.2.3 From 0217315a24d5d06f6fc3f0304460eeb9a0bbf143 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Sat, 29 Jun 2013 13:24:05 +0200 Subject: Escape dropdown Fixes #3241 --- core/js/share.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/js') diff --git a/core/js/share.js b/core/js/share.js index cb37dd70366..588202d2273 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -149,9 +149,9 @@ OC.Share={ var html = ''; - html += '
    '; html += ''; html += ''; html += ''; -- cgit v1.2.3 From 27c0cc7fda6c722a201ac8a549b855663cf9c68a Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Fri, 5 Jul 2013 11:23:08 +0200 Subject: no anonymous upload on read-only folders --- core/js/share.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'core/js') diff --git a/core/js/share.js b/core/js/share.js index 588202d2273..9494637c3dc 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -163,10 +163,10 @@ OC.Share={ var allowPublicUploadStatus = false; $.each(data.shares, function(key, value) { - if (allowPublicUploadStatus) { - return true; - } - allowPublicUploadStatus = (value.permissions & OC.PERMISSION_CREATE) ? true : false; + if (allowPublicUploadStatus) { + return true; + } + allowPublicUploadStatus = (value.permissions & OC.PERMISSION_CREATE) ? true : false; }); html += ''; @@ -181,11 +181,13 @@ OC.Share={ html += '
    '; html += ''; html += '
    '; - html += '
    '; - html += '
    '; html += ''; html += ''; html += ''; -- cgit v1.2.3 From 18b11f76b1e1a4e77ccf5e618f5312538db93532 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Fri, 5 Jul 2013 15:27:14 +0200 Subject: fixing === and ident --- core/js/share.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/js') diff --git a/core/js/share.js b/core/js/share.js index ced1e0aa8ca..21e352ee1c6 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -181,12 +181,12 @@ OC.Share={ html += '
    '; html += ''; html += '
    '; - if (itemType == 'folder' && (possiblePermissions & OC.PERMISSION_CREATE)) { - html += ''; - } + if (itemType === 'folder' && (possiblePermissions & OC.PERMISSION_CREATE)) { + html += ''; + } html += '