From 4e214883d64acf4dc9cc3191780086d0a9dac60f Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Sun, 7 Jul 2013 20:26:09 +0200 Subject: Partly integrate plural translations into js --- core/js/js.js | 55 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 19 deletions(-) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index 3904787c4e5..15cf1d286fa 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1,6 +1,6 @@ /** * Disable console output unless DEBUG mode is enabled. - * Add + * Add * define('DEBUG', true); * To the end of config/config.php to enable debug mode. * The undefined checks fix the broken ie8 console @@ -28,9 +28,11 @@ if (oc_debug !== true || typeof console === "undefined" || typeof console.log == * translate a string * @param app the id of the app for which to translate the string * @param text the string to translate + * @param vars (optional) FIXME + * @param count (optional) number to replace %n with * @return string */ -function t(app,text, vars){ +function t(app, text, vars, count){ if( !( t.cache[app] )){ $.ajax(OC.filePath('core','ajax','translations.php'),{ async:false,//todo a proper sollution for this without sync ajax calls @@ -46,7 +48,8 @@ function t(app,text, vars){ t.cache[app] = []; } } - var _build = function (text, vars) { + var _build = function (text, vars, count) { + // FIXME: replace %n with content of count return text.replace(/{([^{}]*)}/g, function (a, b) { var r = vars[b]; @@ -54,30 +57,44 @@ function t(app,text, vars){ } ); }; + var translation = text; if( typeof( t.cache[app][text] ) !== 'undefined' ){ - if(typeof vars === 'object') { - return _build(t.cache[app][text], vars); - } else { - return t.cache[app][text]; - } + translation = t.cache[app][text]; } - else{ - if(typeof vars === 'object') { - return _build(text, vars); - } else { - return text; - } + + if(typeof vars === 'object' || typeof count !== 'undefined' ) { + return _build(translation, vars, count); + } else { + return translation; } } t.cache={}; -/* +/** + * translate a string + * @param app the id of the app for which to translate the string + * @param text_singular the string to translate for exactly one object + * @param text_plural the string to translate for n objects + * @param count number to determine whether to use singular or plural + * @param vars (optional) FIXME + * @return string + */ +function tp(app, text_singular, text_plural, count, vars){ + if(count==1){ + return t(app, text_singular, vars, count); + } + else{ + return t(app, text_plural, vars, count); + } +} + +/** * Sanitizes a HTML string -* @param string +* @param s string * @return Sanitized string */ function escapeHTML(s) { - return s.toString().split('&').join('&').split('<').join('<').split('"').join('"'); + return s.toString().split('&').join('&').split('<').join('<').split('"').join('"'); } /** @@ -741,7 +758,7 @@ OC.get=function(name) { var namespaces = name.split("."); var tail = namespaces.pop(); var context=window; - + for(var i = 0; i < namespaces.length; i++) { context = context[namespaces[i]]; if(!context){ @@ -760,7 +777,7 @@ OC.set=function(name, value) { var namespaces = name.split("."); var tail = namespaces.pop(); var context=window; - + for(var i = 0; i < namespaces.length; i++) { if(!context[namespaces[i]]){ context[namespaces[i]]={}; -- cgit v1.2.3 From bb0c5bff5fc493dd24c2c9cbbf27986fd5098de1 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Tue, 16 Jul 2013 22:16:53 +0200 Subject: Add multiple plural forms to the php part --- core/js/js.js | 11 +++++------ lib/l10n.php | 34 ++++++++++++++++++++++++++++++---- lib/l10n/string.php | 9 ++++++++- 3 files changed, 43 insertions(+), 11 deletions(-) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index 15cf1d286fa..37540bd15e7 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -33,7 +33,7 @@ if (oc_debug !== true || typeof console === "undefined" || typeof console.log == * @return string */ function t(app, text, vars, count){ - if( !( t.cache[app] )){ + if( !( t.cache[app] )) { $.ajax(OC.filePath('core','ajax','translations.php'),{ async:false,//todo a proper sollution for this without sync ajax calls data:{'app': app}, @@ -49,8 +49,7 @@ function t(app, text, vars, count){ } } var _build = function (text, vars, count) { - // FIXME: replace %n with content of count - return text.replace(/{([^{}]*)}/g, + return text.replace(/%n/g, count).replace(/{([^{}]*)}/g, function (a, b) { var r = vars[b]; return typeof r === 'string' || typeof r === 'number' ? r : a; @@ -62,7 +61,7 @@ function t(app, text, vars, count){ translation = t.cache[app][text]; } - if(typeof vars === 'object' || typeof count !== 'undefined' ) { + if(typeof vars === 'object' || count !== undefined ) { return _build(translation, vars, count); } else { return translation; @@ -79,8 +78,8 @@ t.cache={}; * @param vars (optional) FIXME * @return string */ -function tp(app, text_singular, text_plural, count, vars){ - if(count==1){ +function n(app, text_singular, text_plural, count, vars){ + if(count === 1) { return t(app, text_singular, vars, count); } else{ diff --git a/lib/l10n.php b/lib/l10n.php index 03528c22746..8348962cc10 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -176,13 +176,28 @@ class OC_L10N{ * * Returns the translation. If no translation is found, $text will be * returned. %n will be replaced with the number of objects. + * + * In case there is more than one plural form you can add a function + * "selectplural" in core/l10n/l10n-*.php + * + * Example: + * + * [...] + * 'selectplural' => function($i){return $i == 1 ? 0 : $i == 2 ? 1 : 2}, + * [...] */ - public function tp($text_singular, $text_plural, $count, $parameters = array()) { - if($count == 1){ - return new OC_L10N_String($this, $text_singular, $parameters, $count); + public function n($text_singular, $text_plural, $count, $parameters = array()) { + $identifier = "_${text_singular}__${text_plural}_"; + if(array_key_exists( $this->localizations, "selectplural") && array_key_exists($this->translations, $identifier)) { + return new OC_L10N_String( $this, $identifier, $parameters, $count ); } else{ - return new OC_L10N_String($this, $text_plural, $parameters, $count); + if($count === 1) { + return new OC_L10N_String($this, $text_singular, $parameters, $count); + } + else{ + return new OC_L10N_String($this, $text_plural, $parameters, $count); + } } } @@ -220,6 +235,17 @@ class OC_L10N{ return $this->translations; } + /** + * @brief get localizations + * @returns Fetch all localizations + * + * Returns an associative array with all localizations + */ + public function getLocalizations() { + $this->init(); + return $this->localizations; + } + /** * @brief Localization * @param $type Type of localization diff --git a/lib/l10n/string.php b/lib/l10n/string.php index 1bef7330945..3cda5eab506 100644 --- a/lib/l10n/string.php +++ b/lib/l10n/string.php @@ -18,10 +18,17 @@ class OC_L10N_String{ public function __toString() { $translations = $this->l10n->getTranslations(); + $localizations = $this->l10n->getLocalizations(); $text = $this->text; if(array_key_exists($this->text, $translations)) { - $text = $translations[$this->text]; + if(is_array($translations[$this->text])) { + $id = $localizations["selectplural"]( $count ); + $text = $translations[$this->text][$id] + } + else{ + $text = $translations[$this->text]; + } } // Replace %n first (won't interfere with vsprintf) $text = str_replace('%n', $this->count, $text); -- cgit v1.2.3 From 8a25d1ad068b67914ae87159e062c28433a3a789 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 18 Jul 2013 18:41:01 +0200 Subject: remove unnecessary tipsy for Files delete --- apps/files/js/fileactions.js | 2 +- core/js/js.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'core/js') diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index bb0a27638e4..59cf007f53d 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -125,7 +125,7 @@ var FileActions = { if (typeof trashBinApp !== 'undefined' && trashBinApp) { var html = ''; } else { - var html = ''; + var html = ''; } var element = $(html); element.data('action', actions['Delete']); diff --git a/core/js/js.js b/core/js/js.js index 5158b66d73a..6558adbb6a7 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -664,7 +664,6 @@ $(document).ready(function(){ $('.password .action').tipsy({gravity:'se', fade:true, live:true}); $('#upload').tipsy({gravity:'w', fade:true}); $('.selectedActions a').tipsy({gravity:'s', fade:true, live:true}); - $('a.delete').tipsy({gravity: 'e', fade:true, live:true}); $('a.action').tipsy({gravity:'s', fade:true, live:true}); $('#headerSize').tipsy({gravity:'s', fade:true, live:true}); $('td.filesize').tipsy({gravity:'s', fade:true, live:true}); -- cgit v1.2.3 From aaf0fec9f54bc6f9eef5df00441d593e053ee74b Mon Sep 17 00:00:00 2001 From: kondou Date: Wed, 31 Jul 2013 21:21:02 +0200 Subject: Fix some JSLint warnings --- apps/files/js/file-upload.js | 23 +++++++++++------------ apps/files/js/fileactions.js | 2 +- apps/files/js/keyboardshortcuts.js | 4 ++-- apps/files_sharing/js/public.js | 8 ++++---- apps/files_versions/js/versions.js | 10 +++++----- apps/user_ldap/js/settings.js | 4 ++-- core/js/compatibility.js | 2 +- core/js/config.js | 4 ++-- core/js/jquery.ocdialog.js | 10 +++++----- core/js/listview.js | 4 ++-- core/js/multiselect.js | 4 ++-- core/js/oc-dialogs.js | 26 +++++++++++++------------- core/js/oc-vcategories.js | 2 +- core/js/router.js | 2 +- core/js/share.js | 22 +++++++++++----------- settings/js/apps.js | 2 +- settings/js/log.js | 3 ++- settings/js/personal.js | 2 +- settings/js/users.js | 8 ++++---- 19 files changed, 71 insertions(+), 71 deletions(-) (limited to 'core/js') diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 942a07dfccc..08047c25fdb 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -1,6 +1,6 @@ $(document).ready(function() { - file_upload_param = { + var file_upload_param = { dropZone: $('#content'), // restrict dropZone to content div //singleFileUploads is on by default, so the data.files array will always have length 1 add: function(e, data) { @@ -142,7 +142,7 @@ $(document).ready(function() { $('#uploadprogressbar').progressbar('value',100); $('#uploadprogressbar').fadeOut(); } - } + }; var file_upload_handler = function() { $('#file_upload_start').fileupload(file_upload_param); }; @@ -156,20 +156,21 @@ $(document).ready(function() { // http://stackoverflow.com/a/6700/11236 var size = 0, key; for (key in obj) { - if (obj.hasOwnProperty(key)) size++; + if (obj.hasOwnProperty(key)) { size++; } } return size; }; // warn user not to leave the page while upload is in progress $(window).bind('beforeunload', function(e) { - if ($.assocArraySize(uploadingFiles) > 0) + if ($.assocArraySize(uploadingFiles) > 0) { return t('files','File upload is in progress. Leaving the page now will cancel the upload.'); + } }); //add multiply file upload attribute to all browsers except konqueror (which crashes when it's used) if(navigator.userAgent.search(/konqueror/i)==-1){ - $('#file_upload_start').attr('multiple','multiple') + $('#file_upload_start').attr('multiple','multiple'); } //if the breadcrumb is to long, start by replacing foldernames with '...' except for the current folder @@ -179,7 +180,7 @@ $(document).ready(function() { crumb=crumb.next('div.crumb'); } //if that isn't enough, start removing items from the breacrumb except for the current folder and it's parent - var crumb=$('div.crumb').first(); + crumb=$('div.crumb').first(); var next=crumb.next('div.crumb'); while($('div.controls').height()>40 && next.next('div.crumb').length>0){ crumb.remove(); @@ -189,7 +190,7 @@ $(document).ready(function() { //still not enough, start shorting down the current folder name var crumb=$('div.crumb>a').last(); while($('div.controls').height()>40 && crumb.text().length>6){ - var text=crumb.text() + var text=crumb.text(); text=text.substr(0,text.length-6)+'...'; crumb.text(text); } @@ -291,7 +292,7 @@ $(document).ready(function() { } var localName=name; if(localName.substr(localName.length-1,1)=='/'){//strip / - localName=localName.substr(0,localName.length-1) + localName=localName.substr(0,localName.length-1); } if(localName.indexOf('/')){//use last part of url localName=localName.split('/').pop(); @@ -300,8 +301,7 @@ $(document).ready(function() { } localName = getUniqueName(localName); //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - } else { + if($('html.lte9').length === 0) { $('#uploadprogressbar').progressbar({value:0}); $('#uploadprogressbar').fadeIn(); } @@ -309,8 +309,7 @@ $(document).ready(function() { var eventSource=new OC.EventSource(OC.filePath('files','ajax','newfile.php'),{dir:$('#dir').val(),source:name,filename:localName}); eventSource.listen('progress',function(progress){ //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - } else { + if($('html.lte9').length === 0) { $('#uploadprogressbar').progressbar('value',progress); } }); diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index aa66a57a7b5..f05a320e72d 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -200,7 +200,7 @@ FileActions.register('all', 'Rename', OC.PERMISSION_UPDATE, function () { FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) { - var dir = $('#dir').val() + var dir = $('#dir').val(); if (dir !== '/') { dir = dir + '/'; } diff --git a/apps/files/js/keyboardshortcuts.js b/apps/files/js/keyboardshortcuts.js index cc2b5d42139..1d3bae925bc 100644 --- a/apps/files/js/keyboardshortcuts.js +++ b/apps/files/js/keyboardshortcuts.js @@ -131,7 +131,7 @@ var Files = Files || {}; return; } var preventDefault = false; - if ($.inArray(event.keyCode, keys) === -1) keys.push(event.keyCode); + if ($.inArray(event.keyCode, keys) === -1) { keys.push(event.keyCode); } if ( $.inArray(keyCodes.n, keys) !== -1 && ($.inArray(keyCodes.cmdFirefox, keys) !== -1 || $.inArray(keyCodes.cmdOpera, keys) !== -1 || $.inArray(keyCodes.leftCmdWebKit, keys) !== -1 || $.inArray(keyCodes.rightCmdWebKit, keys) !== -1 || $.inArray(keyCodes.ctrl, keys) !== -1 || event.ctrlKey)) { preventDefault = true; //new file/folder prevent browser from responding @@ -165,4 +165,4 @@ var Files = Files || {}; removeA(keys, event.keyCode); }); }; -})(Files); \ No newline at end of file +})(Files); diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 294223aa094..6182e1dde0e 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -31,19 +31,19 @@ $(document).ready(function() { } } FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename) { - var tr = $('tr').filterAttr('data-file', filename) + var tr = $('tr').filterAttr('data-file', filename); if (tr.length > 0) { window.location = $(tr).find('a.name').attr('href'); } }); FileActions.register('file', 'Download', OC.PERMISSION_READ, '', function(filename) { - var tr = $('tr').filterAttr('data-file', filename) + var tr = $('tr').filterAttr('data-file', filename); if (tr.length > 0) { window.location = $(tr).find('a.name').attr('href'); } }); FileActions.register('dir', 'Download', OC.PERMISSION_READ, '', function(filename) { - var tr = $('tr').filterAttr('data-file', filename) + var tr = $('tr').filterAttr('data-file', filename); if (tr.length > 0) { window.location = $(tr).find('a.name').attr('href')+'&download'; } @@ -51,7 +51,7 @@ $(document).ready(function() { } // Add some form data to the upload handler - file_upload_param.formData = { + var file_upload_param.formData = { MAX_FILE_SIZE: $('#uploadMaxFilesize').val(), requesttoken: $('#publicUploadRequestToken').val(), dirToken: $('#dirToken').val(), diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index ca479507d48..9c3c74721f0 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -124,12 +124,12 @@ function createVersionsDropdown(filename, files) { } function addVersion( revision ) { - title = formatDate(revision.version*1000); - name ='' + revision.humanReadableTimestamp + ''; + var title = formatDate(revision.version*1000); + var name ='' + revision.humanReadableTimestamp + ''; - path = OC.filePath('files_versions', '', 'download.php'); + var path = OC.filePath('files_versions', '', 'download.php'); - download =''; + var download =''; download+=''; revert+=' 0 ? this.$dialog.parent() : $('body'); - content_height = Math.min(content_height, this.parent.height()-20) + content_height = Math.min(content_height, this.parent.height()-20); this.element.css({ height: content_height + 'px', width: this.$dialog.innerWidth()-20 + 'px' @@ -187,7 +187,7 @@ } }, widget: function() { - return this.$dialog + return this.$dialog; }, close: function() { this._destroyOverlay(); @@ -200,10 +200,10 @@ }, destroy: function() { if(this.$title) { - this.$title.remove() + this.$title.remove(); } if(this.$buttonrow) { - this.$buttonrow.remove() + this.$buttonrow.remove(); } if(this.originalTitle) { diff --git a/core/js/listview.js b/core/js/listview.js index 3a713a6222c..18d0bdeaf7c 100644 --- a/core/js/listview.js +++ b/core/js/listview.js @@ -11,11 +11,11 @@ ListView.generateTable=function(collumns){ html+=''; html+=''; html+=''; - html+''; + html+=''; $.each(collumns,function(index,collumn){ html+=''; }); - html+''; + html+=''; html+=''; html=''; return $(html); diff --git a/core/js/multiselect.js b/core/js/multiselect.js index 48d521e1856..373fd2d41a2 100644 --- a/core/js/multiselect.js +++ b/core/js/multiselect.js @@ -25,7 +25,7 @@ 'labels':[], 'oncheck':false, 'onuncheck':false, - 'minWidth': 'default;', + 'minWidth': 'default;' }; $(this).attr('data-msid', multiSelectId); $.extend(settings,options); @@ -200,7 +200,7 @@ return false; } var li=$(this).parent(); - var val = $(this).val() + var val = $(this).val(); var select=button.parent().next(); if(typeof settings.createCallback === 'function') { var response = settings.createCallback(select, val); diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index f4bc174b5eb..04fc43af001 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -79,9 +79,9 @@ var OCdialogs = { title: title }).data('path', ''); - if (modal === undefined) { modal = false }; - if (multiselect === undefined) { multiselect = false }; - if (mimetype_filter === undefined) { mimetype_filter = '' }; + if (modal === undefined) { modal = false; } + if (multiselect === undefined) { multiselect = false; } + if (mimetype_filter === undefined) { mimetype_filter = ''; } $('body').append(self.$filePicker); @@ -106,7 +106,7 @@ var OCdialogs = { datapath.push(self.$filePicker.data('path') + '/' + $(element).text()); }); } else { - var datapath = self.$filePicker.data('path'); + datapath = self.$filePicker.data('path'); datapath += '/' + self.$filelist.find('.filepicker_element_selected .filename').text(); } callback(datapath); @@ -155,7 +155,7 @@ var OCdialogs = { message: content, type: dialog_type }); - if (modal === undefined) { modal = false }; + if (modal === undefined) { modal = false; } $('body').append($dlg); var buttonlist = []; switch (buttons) { @@ -163,7 +163,7 @@ var OCdialogs = { buttonlist = [{ text: t('core', 'Yes'), click: function(){ - if (callback !== undefined) { callback(true) }; + if (callback !== undefined) { callback(true); } $(dialog_id).ocdialog('close'); }, defaultButton: true @@ -171,7 +171,7 @@ var OCdialogs = { { text: t('core', 'No'), click: function(){ - if (callback !== undefined) { callback(false) }; + if (callback !== undefined) { callback(false); } $(dialog_id).ocdialog('close'); } }]; @@ -179,7 +179,7 @@ var OCdialogs = { case OCdialogs.OK_BUTTON: var functionToCall = function() { $(dialog_id).ocdialog('close'); - if(callback !== undefined) { callback() }; + if(callback !== undefined) { callback(); } }; buttonlist[0] = { text: t('core', 'Ok'), @@ -187,7 +187,7 @@ var OCdialogs = { defaultButton: true }; break; - }; + } $(dialog_id).ocdialog({ closeOnEscape: true, @@ -269,7 +269,7 @@ var OCdialogs = { var sorted = dirs.concat(others); $.each(sorted, function(idx, entry) { - $li = self.$listTmpl.octemplate({ + var $li = self.$listTmpl.octemplate({ type: entry.type, dir: dir, filename: entry.name, @@ -287,13 +287,13 @@ var OCdialogs = { */ _fillSlug: function() { this.$dirTree.empty(); - var self = this + var self = this; var path = this.$filePicker.data('path'); var $template = $('{name}'); if(path) { var paths = path.split('/'); $.each(paths, function(index, dir) { - var dir = paths.pop(); + dir = paths.pop(); if(dir === '') { return false; } @@ -327,7 +327,7 @@ var OCdialogs = { $element.toggleClass('filepicker_element_selected'); return; } else if ( $element.data('type') === 'dir' ) { - this._fillFilePicker(this.$filePicker.data('path') + '/' + $element.data('entryname')) + this._fillFilePicker(this.$filePicker.data('path') + '/' + $element.data('entryname')); } } }; diff --git a/core/js/oc-vcategories.js b/core/js/oc-vcategories.js index c745dbc5fbd..c297a24680d 100644 --- a/core/js/oc-vcategories.js +++ b/core/js/oc-vcategories.js @@ -23,7 +23,7 @@ var OCCategories= { d.css('cursor', 'wait').find('input,button:not(#category_addbutton)') .prop('disabled', true).css('cursor', 'wait'); } - } + }; var dlg = $('#edit_categories_dialog').dialog({ modal: true, height: 350, minHeight:200, width: 250, minWidth: 200, diff --git a/core/js/router.js b/core/js/router.js index b94721673a7..44e7c30602e 100644 --- a/core/js/router.js +++ b/core/js/router.js @@ -1,4 +1,4 @@ -OC.router_base_url = OC.webroot + '/index.php', +OC.router_base_url = OC.webroot + '/index.php'; OC.Router = { // register your ajax requests to load after the loading of the routes // has finished. otherwise you face problems with race conditions diff --git a/core/js/share.js b/core/js/share.js index b4b5159b0b5..b220e4a1eb6 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -103,9 +103,9 @@ OC.Share={ var checkReshare = true; if (typeof OC.Share.statuses[itemSource] === 'undefined') { // NOTE: Check does not always work and misses some shares, fix later - checkShares = true; + var checkShares = true; } else { - checkShares = true; + var checkShares = true; } $.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'share.php'), data: { fetch: 'getItem', itemType: itemType, itemSource: itemSource, checkReshare: checkReshare, checkShares: checkShares }, async: false, success: function(result) { if (result && result.status === 'success') { @@ -228,23 +228,23 @@ OC.Share={ }); } $('#shareWith').autocomplete({minLength: 1, source: function(search, response) { - // if (cache[search.term]) { - // response(cache[search.term]); - // } else { + // if (cache[search.term]) { + // response(cache[search.term]); + // } else { $.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getShareWith', search: search.term, itemShares: OC.Share.itemShares }, function(result) { if (result.status == 'success' && result.data.length > 0) { response(result.data); } else { // Suggest sharing via email if valid email address -// var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i); -// if (pattern.test(search.term)) { -// response([{label: t('core', 'Share via email:')+' '+search.term, value: {shareType: OC.Share.SHARE_TYPE_EMAIL, shareWith: search.term}}]); -// } else { +// var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i); +// if (pattern.test(search.term)) { +// response([{label: t('core', 'Share via email:')+' '+search.term, value: {shareType: OC.Share.SHARE_TYPE_EMAIL, shareWith: search.term}}]); +// } else { response([t('core', 'No people found')]); -// } +// } } }); - // } + // } }, focus: function(event, focused) { event.preventDefault(); diff --git a/settings/js/apps.js b/settings/js/apps.js index 0540d9b1c58..94300074652 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -54,7 +54,7 @@ OC.Settings.Apps = OC.Settings.Apps || { enableApp:function(appid, active, element) { console.log('enableApp:', appid, active, element); var appitem=$('#leftcontent li[data-id="'+appid+'"]'); - appData = appitem.data('app'); + var appData = appitem.data('app'); appData.active = !active; appitem.data('app', appData); element.val(t('settings','Please wait....')); diff --git a/settings/js/log.js b/settings/js/log.js index 1ef9b419cdb..5832c698ad5 100644 --- a/settings/js/log.js +++ b/settings/js/log.js @@ -35,8 +35,9 @@ OC.Log={ $('#moreLog').show(); // remove all non-remaining items $('#log tr').slice(OC.Log.loaded).remove(); - if(OC.Log.loaded <= 3) + if(OC.Log.loaded <= 3) { $('#lessLog').hide(); + } }, addEntries:function(entries){ for(var i=0;i bb[x]) ? 1 : -1; + } else { return (aa[x] > bb[x]) ? 1 : -1; } } } return aa.length - bb.length; @@ -262,7 +262,7 @@ var UserList = { if ($(element).find('option[value="' + group + '"]').length === 0 && select.data('msid') !== $(element).data('msid')) { $(element).append(''); } - }) + }); }; var label; if (isadmin) { @@ -304,7 +304,7 @@ var UserList = { if ($(element).find('option[value="' + group + '"]').length === 0) { $(element).append(''); } - }) + }); }; element.multiSelect({ createCallback: addSubAdmin, @@ -469,7 +469,7 @@ $(document).ready(function () { } OC.Notification.hide(); }); - UserList.useUndo = ('onbeforeunload' in window) + UserList.useUndo = ('onbeforeunload' in window); $(window).bind('beforeunload', function () { UserList.finishDelete(null); }); -- cgit v1.2.3 From 1348330c7d75d2b60d845a43be57dedc6199ea1a Mon Sep 17 00:00:00 2001 From: kondou Date: Thu, 1 Aug 2013 18:44:01 +0200 Subject: Fix a syntax error & have if-conds in an own line --- apps/files/js/file-upload.js | 4 +++- apps/files/js/keyboardshortcuts.js | 4 +++- apps/files_sharing/js/public.js | 2 +- core/js/oc-dialogs.js | 28 +++++++++++++++++++++------- settings/js/users.js | 4 +++- 5 files changed, 31 insertions(+), 11 deletions(-) (limited to 'core/js') diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 08047c25fdb..87d8b353b68 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -156,7 +156,9 @@ $(document).ready(function() { // http://stackoverflow.com/a/6700/11236 var size = 0, key; for (key in obj) { - if (obj.hasOwnProperty(key)) { size++; } + if (obj.hasOwnProperty(key)) { + size++; + } } return size; }; diff --git a/apps/files/js/keyboardshortcuts.js b/apps/files/js/keyboardshortcuts.js index 1d3bae925bc..9d6c3ae8c33 100644 --- a/apps/files/js/keyboardshortcuts.js +++ b/apps/files/js/keyboardshortcuts.js @@ -131,7 +131,9 @@ var Files = Files || {}; return; } var preventDefault = false; - if ($.inArray(event.keyCode, keys) === -1) { keys.push(event.keyCode); } + if ($.inArray(event.keyCode, keys) === -1) { + keys.push(event.keyCode); + } if ( $.inArray(keyCodes.n, keys) !== -1 && ($.inArray(keyCodes.cmdFirefox, keys) !== -1 || $.inArray(keyCodes.cmdOpera, keys) !== -1 || $.inArray(keyCodes.leftCmdWebKit, keys) !== -1 || $.inArray(keyCodes.rightCmdWebKit, keys) !== -1 || $.inArray(keyCodes.ctrl, keys) !== -1 || event.ctrlKey)) { preventDefault = true; //new file/folder prevent browser from responding diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 6182e1dde0e..7ffd5e06873 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -51,7 +51,7 @@ $(document).ready(function() { } // Add some form data to the upload handler - var file_upload_param.formData = { + file_upload_param.formData = { MAX_FILE_SIZE: $('#uploadMaxFilesize').val(), requesttoken: $('#publicUploadRequestToken').val(), dirToken: $('#dirToken').val(), diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 04fc43af001..b3b1958659f 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -79,9 +79,15 @@ var OCdialogs = { title: title }).data('path', ''); - if (modal === undefined) { modal = false; } - if (multiselect === undefined) { multiselect = false; } - if (mimetype_filter === undefined) { mimetype_filter = ''; } + if (modal === undefined) { + modal = false; + } + if (multiselect === undefined) { + multiselect = false; + } + if (mimetype_filter === undefined) { + mimetype_filter = ''; + } $('body').append(self.$filePicker); @@ -155,7 +161,9 @@ var OCdialogs = { message: content, type: dialog_type }); - if (modal === undefined) { modal = false; } + if (modal === undefined) { + modal = false; + } $('body').append($dlg); var buttonlist = []; switch (buttons) { @@ -163,7 +171,9 @@ var OCdialogs = { buttonlist = [{ text: t('core', 'Yes'), click: function(){ - if (callback !== undefined) { callback(true); } + if (callback !== undefined) { + callback(true); + } $(dialog_id).ocdialog('close'); }, defaultButton: true @@ -171,7 +181,9 @@ var OCdialogs = { { text: t('core', 'No'), click: function(){ - if (callback !== undefined) { callback(false); } + if (callback !== undefined) { + callback(false); + } $(dialog_id).ocdialog('close'); } }]; @@ -179,7 +191,9 @@ var OCdialogs = { case OCdialogs.OK_BUTTON: var functionToCall = function() { $(dialog_id).ocdialog('close'); - if(callback !== undefined) { callback(); } + if(callback !== undefined) { + callback(); + } }; buttonlist[0] = { text: t('core', 'Ok'), diff --git a/settings/js/users.js b/settings/js/users.js index 798acce8471..ac0d7638f72 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -166,7 +166,9 @@ var UserList = { var c = Number(aa[x]), d = Number(bb[x]); if (c === aa[x] && d === bb[x]) { return c - d; - } else { return (aa[x] > bb[x]) ? 1 : -1; } + } else { + return (aa[x] > bb[x]) ? 1 : -1; + } } } return aa.length - bb.length; -- cgit v1.2.3 From d97e3c3571acb2ea88623384f4b17ced41dc0be9 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Sat, 3 Aug 2013 23:31:49 +0200 Subject: adding proper evaluation of plural form - uses LGPL licensed code of jsgettext --- core/js/js.js | 79 ++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 17 deletions(-) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index 37540bd15e7..b687c408bca 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -24,6 +24,55 @@ if (oc_debug !== true || typeof console === "undefined" || typeof console.log == } } +function initL10N(app) { + if (!( t.cache[app] )) { + $.ajax(OC.filePath('core', 'ajax', 'translations.php'), { + async: false,//todo a proper solution for this without sync ajax calls + data: {'app': app}, + type: 'POST', + success: function (jsondata) { + t.cache[app] = jsondata.data; + t.plural_form = jsondata.plural_form; + } + }); + + // Bad answer ... + if (!( t.cache[app] )) { + t.cache[app] = []; + } + } + if (typeof t.plural_function == 'undefined') { + t.plural_function = function (n) { + var p = (n != 1) ? 1 : 0; + return { 'nplural' : 2, 'plural' : p }; + }; + + /** + * code below has been taken from jsgettext - which is LGPL licensed + * https://developer.berlios.de/projects/jsgettext/ + * http://cvs.berlios.de/cgi-bin/viewcvs.cgi/jsgettext/jsgettext/lib/Gettext.js + */ + var pf_re = new RegExp('^(\\s*nplurals\\s*=\\s*[0-9]+\\s*;\\s*plural\\s*=\\s*(?:\\s|[-\\?\\|&=!<>+*/%:;a-zA-Z0-9_\(\)])+)', 'm'); + if (pf_re.test(t.plural_form)) { + //ex english: "Plural-Forms: nplurals=2; plural=(n != 1);\n" + //pf = "nplurals=2; plural=(n != 1);"; + //ex russian: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10< =4 && (n%100<10 or n%100>=20) ? 1 : 2) + //pf = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)"; + var pf = t.plural_form; + if (! /;\s*$/.test(pf)) pf = pf.concat(';'); + /* We used to use eval, but it seems IE has issues with it. + * We now use "new Function", though it carries a slightly + * bigger performance hit. + var code = 'function (n) { var plural; var nplurals; '+pf+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) }; };'; + Gettext._locale_data[domain].head.plural_func = eval("("+code+")"); + */ + var code = 'var plural; var nplurals; '+pf+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) };'; + t.plural_function = new Function("n", code); + } else { + console.log("Syntax error in language file. Plural-Forms header is invalid ["+plural_forms+"]"); + } + } +} /** * translate a string * @param app the id of the app for which to translate the string @@ -33,21 +82,7 @@ if (oc_debug !== true || typeof console === "undefined" || typeof console.log == * @return string */ function t(app, text, vars, count){ - if( !( t.cache[app] )) { - $.ajax(OC.filePath('core','ajax','translations.php'),{ - async:false,//todo a proper sollution for this without sync ajax calls - data:{'app': app}, - type:'POST', - success:function(jsondata){ - t.cache[app] = jsondata.data; - } - }); - - // Bad answer ... - if( !( t.cache[app] )){ - t.cache[app] = []; - } - } + initL10N(app); var _build = function (text, vars, count) { return text.replace(/%n/g, count).replace(/{([^{}]*)}/g, function (a, b) { @@ -67,7 +102,7 @@ function t(app, text, vars, count){ return translation; } } -t.cache={}; +t.cache = {}; /** * translate a string @@ -78,7 +113,17 @@ t.cache={}; * @param vars (optional) FIXME * @return string */ -function n(app, text_singular, text_plural, count, vars){ +function n(app, text_singular, text_plural, count, vars) { + initL10N(app); + var identifier = '_' + text_singular + '__' + text_plural + '_'; + if( typeof( t.cache[app][identifier] ) !== 'undefined' ){ + var translation = t.cache[app][identifier]; + if ($.isArray(translation)) { + var plural = t.plural_function(count); + return t(app, translation[plural.plural], vars, count); + } + } + if(count === 1) { return t(app, text_singular, vars, count); } -- cgit v1.2.3 From ff67f115d403d13dedf77457c539963f50a80eec Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Thu, 8 Aug 2013 13:50:04 +0200 Subject: fix #2711 using a custom event, also use css selectors over filterAttr --- apps/files/js/fileactions.js | 5 +++-- apps/files_sharing/js/share.js | 7 +++++-- core/js/share.js | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'core/js') diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index aa66a57a7b5..de67d13559e 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -65,7 +65,7 @@ var FileActions = { FileActions.currentFile = parent; var actions = FileActions.get(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); var file = FileActions.getCurrentFile(); - if ($('tr').filterAttr('data-file', file).data('renaming')) { + if ($('tr[data-file="'+file+'"]').data('renaming')) { return; } parent.children('a.name').append(''); @@ -164,10 +164,11 @@ $(document).ready(function () { window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val()); }); } - $('#fileList tr').each(function () { FileActions.display($(this).children('td.filename')); }); + + $('#fileList').trigger(jQuery.Event("fileActionsReady")); }); diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index eb5a6e8cb7f..b2efafde4e7 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -4,6 +4,10 @@ $(document).ready(function() { if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) { + $('#fileList').one('fileActionsReady',function(){ + OC.Share.loadIcons('file'); + }); + FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) { if ($('#dir').val() == '/') { var item = $('#dir').val() + filename; @@ -33,6 +37,5 @@ $(document).ready(function() { OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions); } }); - OC.Share.loadIcons('file'); } -}); +}); \ No newline at end of file diff --git a/core/js/share.js b/core/js/share.js index b4b5159b0b5..b0d38c45cb8 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -22,9 +22,9 @@ OC.Share={ if (itemType != 'file' && itemType != 'folder') { $('a.share[data-item="'+item+'"]').css('background', 'url('+image+') no-repeat center'); } else { - var file = $('tr').filterAttr('data-id', item); + var file = $('tr[data-id="'+item+'"]'); if (file.length > 0) { - var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share'); + var action = $(file).find('.fileactions .action[data-action="Share"]'); var img = action.find('img').attr('src', image); action.addClass('permanent'); action.html(' '+t('core', 'Shared')).prepend(img); @@ -36,7 +36,7 @@ OC.Share={ // Search for possible parent folders that are shared while (path != last) { if (path == data['path']) { - var actions = $('.fileactions .action').filterAttr('data-action', 'Share'); + var actions = $('.fileactions .action[data-action="Share"]'); $.each(actions, function(index, action) { var img = $(action).find('img'); if (img.attr('src') != OC.imagePath('core', 'actions/public')) { -- cgit v1.2.3 From 9549bd3e68aa32bb9fa1a9a54bda84fa5070966f Mon Sep 17 00:00:00 2001 From: kondou Date: Fri, 9 Aug 2013 20:37:18 +0200 Subject: Use plural translations --- apps/files/js/filelist.js | 5 +++-- apps/files/js/files.js | 14 +++----------- apps/files_trashbin/js/trash.js | 12 ++---------- core/js/js.js | 10 ++++------ lib/template/functions.php | 10 ++++------ 5 files changed, 16 insertions(+), 35 deletions(-) (limited to 'core/js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index b858e2580ee..e0c72295702 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -452,13 +452,14 @@ $(document).ready(function(){ var currentUploads = parseInt(uploadtext.attr('currentUploads')); currentUploads += 1; uploadtext.attr('currentUploads', currentUploads); + var translatedText = n('files', '%n file uploading', '%n files uploading', currentUploads); if(currentUploads === 1) { var img = OC.imagePath('core', 'loading.gif'); data.context.find('td.filename').attr('style','background-image:url('+img+')'); - uploadtext.text(t('files', '1 file uploading')); + uploadtext.text(translatedText); uploadtext.show(); } else { - uploadtext.text(currentUploads + ' ' + t('files', 'files uploading')); + uploadtext.text(translatedText); } } else { // add as stand-alone row to filelist diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 3fad3fae7d3..53fc25f41b0 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -759,21 +759,13 @@ function procesSelection(){ $('#headerSize').text(humanFileSize(totalSize)); var selection=''; if(selectedFolders.length>0){ - if(selectedFolders.length==1){ - selection+=t('files','1 folder'); - }else{ - selection+=t('files','{count} folders',{count: selectedFolders.length}); - } + selection += n('files', '%n folder', '%n folders', selectedFolders.length); if(selectedFiles.length>0){ selection+=' & '; } } if(selectedFiles.length>0){ - if(selectedFiles.length==1){ - selection+=t('files','1 file'); - }else{ - selection+=t('files','{count} files',{count: selectedFiles.length}); - } + selection += n('files', '%n file', '%n files', selectedFiles.length); } $('#headerName>span.name').text(selection); $('#modified').text(''); @@ -852,4 +844,4 @@ function checkTrashStatus() { $("input[type=button][id=trash]").removeAttr("disabled"); } }); -} \ No newline at end of file +} diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index c3c958b07a7..b14a7240cbe 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -188,21 +188,13 @@ function processSelection(){ $('.selectedActions').show(); var selection=''; if(selectedFolders.length>0){ - if(selectedFolders.length === 1){ - selection+=t('files','1 folder'); - }else{ - selection+=t('files','{count} folders',{count: selectedFolders.length}); - } + selection += n('files', '%n folder', '%n folders', selectedFolders.length); if(selectedFiles.length>0){ selection+=' & '; } } if(selectedFiles.length>0){ - if(selectedFiles.length === 1){ - selection+=t('files','1 file'); - }else{ - selection+=t('files','{count} files',{count: selectedFiles.length}); - } + selection += n('files', '%n file', '%n files', selectedFiles.length); } $('#headerName>span.name').text(selection); $('#modified').text(''); diff --git a/core/js/js.js b/core/js/js.js index 1d1711383f7..0fc4bab80a7 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -812,15 +812,13 @@ function relative_modified_date(timestamp) { var diffdays = Math.round(diffhours/24); var diffmonths = Math.round(diffdays/31); if(timediff < 60) { return t('core','seconds ago'); } - else if(timediff < 120) { return t('core','1 minute ago'); } - else if(timediff < 3600) { return t('core','{minutes} minutes ago',{minutes: diffminutes}); } - else if(timediff < 7200) { return t('core','1 hour ago'); } - else if(timediff < 86400) { return t('core','{hours} hours ago',{hours: diffhours}); } + else if(timediff < 3600) { return n('core','%n minute ago', '%n minutes ago', diffminutes); } + else if(timediff < 86400) { return n('core', '%n hour ago', '%n hours ago', diffhours); } else if(timediff < 86400) { return t('core','today'); } else if(timediff < 172800) { return t('core','yesterday'); } - else if(timediff < 2678400) { return t('core','{days} days ago',{days: diffdays}); } + else if(timediff < 2678400) { return n('core', '%n day ago', '%n days ago', diffdays); } else if(timediff < 5184000) { return t('core','last month'); } - else if(timediff < 31556926) { return t('core','{months} months ago',{months: diffmonths}); } + else if(timediff < 31556926) { return n('core', '%n month ago', '%n months ago', diffmonths); } //else if(timediff < 31556926) { return t('core','months ago'); } else if(timediff < 63113852) { return t('core','last year'); } else { return t('core','years ago'); } diff --git a/lib/template/functions.php b/lib/template/functions.php index 2d43cae1c0c..717e197c1cb 100644 --- a/lib/template/functions.php +++ b/lib/template/functions.php @@ -78,15 +78,13 @@ function relative_modified_date($timestamp) { $diffmonths = round($diffdays/31); if($timediff < 60) { return $l->t('seconds ago'); } - else if($timediff < 120) { return $l->t('1 minute ago'); } - else if($timediff < 3600) { return $l->t('%d minutes ago', $diffminutes); } - else if($timediff < 7200) { return $l->t('1 hour ago'); } - else if($timediff < 86400) { return $l->t('%d hours ago', $diffhours); } + else if($timediff < 3600) { return $l->n('%n minute ago', '%n minutes ago', $diffminutes); } + else if($timediff < 86400) { return $l->n('%n hour ago', '%n hours ago', $diffhours); } else if((date('G')-$diffhours) > 0) { return $l->t('today'); } else if((date('G')-$diffhours) > -24) { return $l->t('yesterday'); } - else if($timediff < 2678400) { return $l->t('%d days ago', $diffdays); } + else if($timediff < 2678400) { return $l->n('%n day go', '%n days ago', $diffdays); } else if($timediff < 5184000) { return $l->t('last month'); } - else if((date('n')-$diffmonths) > 0) { return $l->t('%d months ago', $diffmonths); } + else if((date('n')-$diffmonths) > 0) { return $l->n('%n month ago', '%n months ago', $diffmonths); } else if($timediff < 63113852) { return $l->t('last year'); } else { return $l->t('years ago'); } } -- cgit v1.2.3 From 5660f99592b313e423c0b7d9682dacb1896ce102 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Tue, 13 Aug 2013 22:58:27 +0200 Subject: add PERMISSIONS_ALL summary --- core/js/js.js | 1 + 1 file changed, 1 insertion(+) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index 1d1711383f7..64b5556987d 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -157,6 +157,7 @@ var OC={ PERMISSION_UPDATE:2, PERMISSION_DELETE:8, PERMISSION_SHARE:16, + PERMISSION_ALL:31, webroot:oc_webroot, appswebroots:(typeof oc_appswebroots !== 'undefined') ? oc_appswebroots:false, currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false, -- cgit v1.2.3 From ca95a475d5fa81f3b3a8b5dcbce87189b79fc56e Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Tue, 13 Aug 2013 22:58:47 +0200 Subject: use edit & reshare permission as default --- 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 b4b5159b0b5..622b23d05a2 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -256,8 +256,8 @@ OC.Share={ var shareType = selected.item.value.shareType; var shareWith = selected.item.value.shareWith; $(this).val(shareWith); - // Default permissions are Read and Share - var permissions = OC.PERMISSION_READ | OC.PERMISSION_SHARE; + // Default permissions are Edit and Share (all) + var permissions = OC.PERMISSION_ALL; OC.Share.share(itemType, itemSource, shareType, shareWith, permissions, function() { OC.Share.addShareWith(shareType, shareWith, selected.item.label, permissions, possiblePermissions); $('#shareWith').val(''); -- cgit v1.2.3 From 11a404b90b8676cd38b1f6dbfbc7ca074f9a31ab Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Wed, 14 Aug 2013 00:25:07 +0200 Subject: comment clarification --- core/js/share.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/js') diff --git a/core/js/share.js b/core/js/share.js index 622b23d05a2..a0ae39fffed 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -256,7 +256,7 @@ OC.Share={ var shareType = selected.item.value.shareType; var shareWith = selected.item.value.shareWith; $(this).val(shareWith); - // Default permissions are Edit and Share (all) + // Default permissions are Edit (CRUD) and Share var permissions = OC.PERMISSION_ALL; OC.Share.share(itemType, itemSource, shareType, shareWith, permissions, function() { OC.Share.addShareWith(shareType, shareWith, selected.item.label, permissions, possiblePermissions); -- cgit v1.2.3 From 5fb7aab7a07d05a7d05c7f0dbb5dacf33d401383 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 15 Aug 2013 13:05:26 +0200 Subject: remove jPlayer css rules from core css file --- core/css/styles.css | 7 +++---- core/js/js.js | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'core/js') diff --git a/core/css/styles.css b/core/css/styles.css index cf58a3b5f3f..1b58899eef6 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -45,7 +45,7 @@ body { background:#fefefe; font:normal .8em/1.6em "Helvetica Neue",Helvetica,Ari input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="email"], input[type="url"], textarea, select, button, .button, -#quota, div.jp-progress, .pager li a { +#quota, .pager li a { width:10em; margin:.3em; padding:.6em .5em .4em; font-size:1em; background:#fff; color:#333; border:1px solid #ddd; outline:none; @@ -85,7 +85,7 @@ input[type="checkbox"]:hover+label, input[type="checkbox"]:focus+label { color:# /* BUTTONS */ input[type="submit"], input[type="button"], button, .button, -#quota, div.jp-progress, select, .pager li a { +#quota, select, .pager li a { width:auto; padding:.4em; background-color:rgba(240,240,240,.9); font-weight:bold; color:#555; text-shadow:rgba(255,255,255,.9) 0 1px 0; border:1px solid rgba(190,190,190,.9); cursor:pointer; -moz-box-shadow:0 1px 1px rgba(255,255,255,.9), 0 1px 1px rgba(255,255,255,.9) inset; -webkit-box-shadow:0 1px 1px rgba(255,255,255,.9), 0 1px 1px rgba(255,255,255,.9) inset; box-shadow:0 1px 1px rgba(255,255,255,.9), 0 1px 1px rgba(255,255,255,.9) inset; @@ -545,7 +545,7 @@ tbody tr:hover, tr:active { background-color:#f8f8f8; } .personalblock > legend, th, dt, label { font-weight:bold; } code { font-family:"Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", monospace; } -#quota div, div.jp-play-bar, div.jp-seek-bar { +#quota div { padding: 0; background-color: rgb(220,220,220); font-weight: normal; @@ -553,7 +553,6 @@ code { font-family:"Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono -moz-border-radius-bottomleft: .4em; -webkit-border-bottom-left-radius: .4em; border-bottom-left-radius:.4em; -moz-border-radius-topleft: .4em; -webkit-border-top-left-radius: .4em; border-top-left-radius: .4em; } #quotatext {padding:.6em 1em;} -div.jp-play-bar, div.jp-seek-bar { padding:0; } .pager { list-style:none; float:right; display:inline; margin:.7em 13em 0 0; } .pager li { display:inline-block; } diff --git a/core/js/js.js b/core/js/js.js index 4dfe4d0e5ee..60a29342f26 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -758,8 +758,6 @@ $(document).ready(function(){ }); // all the tipsy stuff needs to be here (in reverse order) to work - $('.jp-controls .jp-previous').tipsy({gravity:'nw', fade:true, live:true}); - $('.jp-controls .jp-next').tipsy({gravity:'n', fade:true, live:true}); $('.displayName .action').tipsy({gravity:'se', fade:true, live:true}); $('.password .action').tipsy({gravity:'se', fade:true, live:true}); $('#upload').tipsy({gravity:'w', fade:true}); -- cgit v1.2.3 From 2ee8425295affcc5a5632d2f7ea17c66e539b3be Mon Sep 17 00:00:00 2001 From: kondou Date: Sat, 17 Aug 2013 12:07:58 +0200 Subject: Remove cancel button from filepicker Having the cancel button in the bottom right corner was a bit confusing. It's useless anyways, since there's a X in the top right. --- core/js/oc-dialogs.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'core/js') diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index f4bc174b5eb..5cbc8359d52 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -117,10 +117,6 @@ var OCdialogs = { text: t('core', 'Choose'), click: functionToCall, defaultButton: true - }, - { - text: t('core', 'Cancel'), - click: function(){self.$filePicker.ocdialog('close'); } }]; self.$filePicker.ocdialog({ -- cgit v1.2.3 From 15c9a0f405631c937a935ba781b1c73a7db82556 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Sat, 17 Aug 2013 19:24:06 +0200 Subject: fixing undefined js error --- core/js/js.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index c2b81ae3272..75a2b51a43f 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -69,7 +69,7 @@ function initL10N(app) { var code = 'var plural; var nplurals; '+pf+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) };'; t.plural_function = new Function("n", code); } else { - console.log("Syntax error in language file. Plural-Forms header is invalid ["+plural_forms+"]"); + console.log("Syntax error in language file. Plural-Forms header is invalid ["+ t.plural_forms+"]"); } } } -- cgit v1.2.3 From 9e8a6b704d4b65bb999d992f4900a9e184d952bd Mon Sep 17 00:00:00 2001 From: kondou Date: Sun, 18 Aug 2013 11:02:08 +0200 Subject: Add _many_ newlines at the end of files --- AUTHORS | 2 +- COPYING-README | 2 +- apps/files/ajax/rename.php | 2 +- apps/files/appinfo/routes.php | 2 +- apps/files/js/keyboardshortcuts.js | 2 +- apps/files/lib/app.php | 2 +- apps/files/lib/capabilities.php | 2 +- apps/files/tests/ajax_rename.php | 2 +- apps/files_encryption/ajax/changeRecoveryPassword.php | 2 +- apps/files_encryption/ajax/updatePrivateKeyPassword.php | 2 +- apps/files_encryption/ajax/userrecovery.php | 2 +- apps/files_encryption/appinfo/routes.php | 2 +- apps/files_encryption/css/settings-personal.css | 2 +- apps/files_encryption/js/settings-admin.js | 2 +- apps/files_encryption/js/settings-personal.js | 2 +- apps/files_encryption/lib/capabilities.php | 2 +- apps/files_encryption/lib/keymanager.php | 2 +- apps/files_encryption/tests/stream.php | 2 +- apps/files_encryption/tests/trashbin.php | 2 +- apps/files_encryption/tests/webdav.php | 2 +- apps/files_external/ajax/addMountPoint.php | 2 +- apps/files_external/ajax/google.php | 2 +- apps/files_external/js/google.js | 2 +- apps/files_external/lib/google.php | 2 +- apps/files_external/tests/google.php | 2 +- apps/files_sharing/appinfo/app.php | 2 +- apps/files_sharing/js/share.js | 2 +- apps/files_sharing/lib/cache.php | 2 +- apps/files_sharing/lib/permissions.php | 2 +- apps/files_sharing/lib/watcher.php | 2 +- apps/files_sharing/templates/part.404.php | 2 +- apps/files_trashbin/appinfo/app.php | 2 +- apps/files_trashbin/appinfo/update.php | 2 +- apps/files_trashbin/js/disableDefaultActions.js | 2 +- apps/files_versions/appinfo/routes.php | 2 +- apps/files_versions/lib/capabilities.php | 2 +- apps/user_ldap/ajax/clearMappings.php | 2 +- apps/user_ldap/ajax/getConfiguration.php | 2 +- apps/user_ldap/ajax/getNewServerConfigPrefix.php | 2 +- apps/user_ldap/ajax/setConfiguration.php | 2 +- apps/user_ldap/css/settings.css | 2 +- apps/user_ldap/group_proxy.php | 2 +- apps/user_ldap/js/settings.js | 2 +- apps/user_ldap/lib/proxy.php | 2 +- apps/user_ldap/user_proxy.php | 2 +- core/css/auth.css | 2 +- core/js/jquery.infieldlabel.js | 2 +- core/js/jquery.inview.js | 2 +- core/js/oc-requesttoken.js | 2 +- core/js/visitortimezone.js | 2 +- core/lostpassword/templates/email.php | 2 +- core/routes.php | 2 +- cron.php | 2 +- lib/files/storage/commontest.php | 2 +- lib/geo.php | 2 +- lib/ocs/result.php | 2 +- lib/public/groupinterface.php | 2 +- lib/public/userinterface.php | 2 +- lib/user/http.php | 2 +- lib/user/interface.php | 2 +- lib/vobject/compoundproperty.php | 2 +- lib/vobject/stringproperty.php | 2 +- ocs/routes.php | 2 +- public.php | 2 +- remote.php | 2 +- search/css/results.css | 2 +- settings/ajax/setsecurity.php | 2 +- settings/ajax/updateapp.php | 2 +- settings/js/apps-custom.php | 2 +- settings/js/isadmin.php | 2 +- status.php | 2 +- tests/lib/app.php | 2 +- tests/lib/archive/zip.php | 2 +- tests/lib/geo.php | 2 +- tests/lib/vobject.php | 2 +- 75 files changed, 75 insertions(+), 75 deletions(-) (limited to 'core/js') diff --git a/AUTHORS b/AUTHORS index c30a6bf426b..7e0d8f6587b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -28,4 +28,4 @@ With help from many libraries and frameworks including: … "Lock” symbol from thenounproject.com collection -"Clock” symbol by Brandon Hopkins, from thenounproject.com collection \ No newline at end of file +"Clock” symbol by Brandon Hopkins, from thenounproject.com collection diff --git a/COPYING-README b/COPYING-README index 49e035186ed..8c26709d767 100644 --- a/COPYING-README +++ b/COPYING-README @@ -12,4 +12,4 @@ Licensing of components: All unmodified files from these and other sources retain their original copyright and license notices: see the relevant individual files. -Attribution information for ownCloud is contained in the AUTHORS file. \ No newline at end of file +Attribution information for ownCloud is contained in the AUTHORS file. diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php index f4551858283..5b07c306af8 100644 --- a/apps/files/ajax/rename.php +++ b/apps/files/ajax/rename.php @@ -38,4 +38,4 @@ if($result['success'] === true){ OCP\JSON::success(array('data' => $result['data'])); } else { OCP\JSON::error(array('data' => $result['data'])); -} \ No newline at end of file +} diff --git a/apps/files/appinfo/routes.php b/apps/files/appinfo/routes.php index fcd5f4b2608..f3d8e9a4f4d 100644 --- a/apps/files/appinfo/routes.php +++ b/apps/files/appinfo/routes.php @@ -11,4 +11,4 @@ $this->create('download', 'download{file}') ->actionInclude('files/download.php'); // Register with the capabilities API -OC_API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', OC_API::USER_AUTH); \ No newline at end of file +OC_API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', OC_API::USER_AUTH); diff --git a/apps/files/js/keyboardshortcuts.js b/apps/files/js/keyboardshortcuts.js index cc2b5d42139..418c38adb99 100644 --- a/apps/files/js/keyboardshortcuts.js +++ b/apps/files/js/keyboardshortcuts.js @@ -165,4 +165,4 @@ var Files = Files || {}; removeA(keys, event.keyCode); }); }; -})(Files); \ No newline at end of file +})(Files); diff --git a/apps/files/lib/app.php b/apps/files/lib/app.php index f7052ef80b0..579e8676cfc 100644 --- a/apps/files/lib/app.php +++ b/apps/files/lib/app.php @@ -76,4 +76,4 @@ class App { return $result; } -} \ No newline at end of file +} diff --git a/apps/files/lib/capabilities.php b/apps/files/lib/capabilities.php index 90a5e2f4eb9..d4820e931ba 100644 --- a/apps/files/lib/capabilities.php +++ b/apps/files/lib/capabilities.php @@ -21,4 +21,4 @@ class Capabilities { )); } -} \ No newline at end of file +} diff --git a/apps/files/tests/ajax_rename.php b/apps/files/tests/ajax_rename.php index 2b90a11743d..8eff978cde0 100644 --- a/apps/files/tests/ajax_rename.php +++ b/apps/files/tests/ajax_rename.php @@ -114,4 +114,4 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase { $this->assertEquals($expected, $result); } -} \ No newline at end of file +} diff --git a/apps/files_encryption/ajax/changeRecoveryPassword.php b/apps/files_encryption/ajax/changeRecoveryPassword.php index 366f634a51c..945f054ea84 100644 --- a/apps/files_encryption/ajax/changeRecoveryPassword.php +++ b/apps/files_encryption/ajax/changeRecoveryPassword.php @@ -49,4 +49,4 @@ if ($return) { \OCP\JSON::success(array('data' => array('message' => $l->t('Password successfully changed.')))); } else { \OCP\JSON::error(array('data' => array('message' => $l->t('Could not change the password. Maybe the old password was not correct.')))); -} \ No newline at end of file +} diff --git a/apps/files_encryption/ajax/updatePrivateKeyPassword.php b/apps/files_encryption/ajax/updatePrivateKeyPassword.php index 6fd63dae9cd..1e6644da576 100644 --- a/apps/files_encryption/ajax/updatePrivateKeyPassword.php +++ b/apps/files_encryption/ajax/updatePrivateKeyPassword.php @@ -51,4 +51,4 @@ if ($return) { \OCP\JSON::success(array('data' => array('message' => $l->t('Private key password successfully updated.')))); } else { \OCP\JSON::error(array('data' => array('message' => $l->t('Could not update the private key password. Maybe the old password was not correct.')))); -} \ No newline at end of file +} diff --git a/apps/files_encryption/ajax/userrecovery.php b/apps/files_encryption/ajax/userrecovery.php index 1d0f1ac2d17..d6c94bde81e 100644 --- a/apps/files_encryption/ajax/userrecovery.php +++ b/apps/files_encryption/ajax/userrecovery.php @@ -38,4 +38,4 @@ if ( } // Return success or failure -($return) ? \OCP\JSON::success() : \OCP\JSON::error(); \ No newline at end of file +($return) ? \OCP\JSON::success() : \OCP\JSON::error(); diff --git a/apps/files_encryption/appinfo/routes.php b/apps/files_encryption/appinfo/routes.php index ab83432a4b2..07ff920a60d 100644 --- a/apps/files_encryption/appinfo/routes.php +++ b/apps/files_encryption/appinfo/routes.php @@ -6,4 +6,4 @@ */ // Register with the capabilities API -OC_API::register('get', '/cloud/capabilities', array('OCA\Encryption\Capabilities', 'getCapabilities'), 'files_encryption', OC_API::USER_AUTH); \ No newline at end of file +OC_API::register('get', '/cloud/capabilities', array('OCA\Encryption\Capabilities', 'getCapabilities'), 'files_encryption', OC_API::USER_AUTH); diff --git a/apps/files_encryption/css/settings-personal.css b/apps/files_encryption/css/settings-personal.css index 4ee0acc9768..8eb5bedcb06 100644 --- a/apps/files_encryption/css/settings-personal.css +++ b/apps/files_encryption/css/settings-personal.css @@ -7,4 +7,4 @@ , #recoveryEnabledError , #recoveryEnabledSuccess { display: none; -} \ No newline at end of file +} diff --git a/apps/files_encryption/js/settings-admin.js b/apps/files_encryption/js/settings-admin.js index 7c1866445ee..6647c621e7b 100644 --- a/apps/files_encryption/js/settings-admin.js +++ b/apps/files_encryption/js/settings-admin.js @@ -99,4 +99,4 @@ $(document).ready(function(){ ); }); -}); \ No newline at end of file +}); diff --git a/apps/files_encryption/js/settings-personal.js b/apps/files_encryption/js/settings-personal.js index d6535a25b70..e16519c3c98 100644 --- a/apps/files_encryption/js/settings-personal.js +++ b/apps/files_encryption/js/settings-personal.js @@ -95,4 +95,4 @@ $(document).ready(function(){ updatePrivateKeyPasswd(); }); -}); \ No newline at end of file +}); diff --git a/apps/files_encryption/lib/capabilities.php b/apps/files_encryption/lib/capabilities.php index 72baddcd049..ef94c9e086d 100644 --- a/apps/files_encryption/lib/capabilities.php +++ b/apps/files_encryption/lib/capabilities.php @@ -20,4 +20,4 @@ class Capabilities { )); } -} \ No newline at end of file +} diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php index b2fd650f18d..5386de486e1 100755 --- a/apps/files_encryption/lib/keymanager.php +++ b/apps/files_encryption/lib/keymanager.php @@ -593,4 +593,4 @@ class Keymanager { return $targetPath; } -} \ No newline at end of file +} diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php index 50ac41e4536..5193f8c9686 100644 --- a/apps/files_encryption/tests/stream.php +++ b/apps/files_encryption/tests/stream.php @@ -180,4 +180,4 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase { // tear down $view->unlink($filename); } -} \ No newline at end of file +} diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php index ade968fbece..6c1aa2a142f 100755 --- a/apps/files_encryption/tests/trashbin.php +++ b/apps/files_encryption/tests/trashbin.php @@ -300,4 +300,4 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey.' . $trashFileSuffix)); } -} \ No newline at end of file +} diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php index 1d406789f0c..26a002a8b34 100755 --- a/apps/files_encryption/tests/webdav.php +++ b/apps/files_encryption/tests/webdav.php @@ -259,4 +259,4 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { // return captured content return $content; } -} \ No newline at end of file +} diff --git a/apps/files_external/ajax/addMountPoint.php b/apps/files_external/ajax/addMountPoint.php index fed2ddfcf3d..9100d47db3a 100644 --- a/apps/files_external/ajax/addMountPoint.php +++ b/apps/files_external/ajax/addMountPoint.php @@ -16,4 +16,4 @@ $status = OC_Mount_Config::addMountPoint($_POST['mountPoint'], $_POST['mountType'], $_POST['applicable'], $isPersonal); -OCP\JSON::success(array('data' => array('message' => $status))); \ No newline at end of file +OCP\JSON::success(array('data' => array('message' => $status))); diff --git a/apps/files_external/ajax/google.php b/apps/files_external/ajax/google.php index e63b7cb07b9..2594a1780b3 100644 --- a/apps/files_external/ajax/google.php +++ b/apps/files_external/ajax/google.php @@ -39,4 +39,4 @@ if (isset($_POST['client_id']) && isset($_POST['client_secret']) && isset($_POST } } } -} \ No newline at end of file +} diff --git a/apps/files_external/js/google.js b/apps/files_external/js/google.js index 7e111a95d98..b4be1c1dc41 100644 --- a/apps/files_external/js/google.js +++ b/apps/files_external/js/google.js @@ -126,4 +126,4 @@ $(document).ready(function() { } }); -}); \ No newline at end of file +}); diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index ef8dd6d8cad..e6cdacdec4f 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -587,4 +587,4 @@ class Google extends \OC\Files\Storage\Common { return false; } -} \ No newline at end of file +} diff --git a/apps/files_external/tests/google.php b/apps/files_external/tests/google.php index 12faabb902d..d5495d49c5e 100644 --- a/apps/files_external/tests/google.php +++ b/apps/files_external/tests/google.php @@ -42,4 +42,4 @@ class Google extends Storage { $this->instance->rmdir('/'); } } -} \ No newline at end of file +} diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index 9363a5431fa..895d446a336 100644 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -15,4 +15,4 @@ OCP\Util::addScript('files_sharing', 'share'); \OC_Hook::connect('OC_Filesystem', 'delete', '\OC\Files\Cache\Shared_Updater', 'deleteHook'); \OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook'); \OC_Hook::connect('OCP\Share', 'post_shared', '\OC\Files\Cache\Shared_Updater', 'shareHook'); -\OC_Hook::connect('OCP\Share', 'pre_unshare', '\OC\Files\Cache\Shared_Updater', 'shareHook'); \ No newline at end of file +\OC_Hook::connect('OCP\Share', 'pre_unshare', '\OC\Files\Cache\Shared_Updater', 'shareHook'); diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index b2efafde4e7..3be89a39fa0 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -38,4 +38,4 @@ $(document).ready(function() { } }); } -}); \ No newline at end of file +}); diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 2160fe9a393..33cd1428899 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -288,4 +288,4 @@ class Shared_Cache extends Cache { return false; } -} \ No newline at end of file +} diff --git a/apps/files_sharing/lib/permissions.php b/apps/files_sharing/lib/permissions.php index b6638564cd8..e2978e12bfb 100644 --- a/apps/files_sharing/lib/permissions.php +++ b/apps/files_sharing/lib/permissions.php @@ -106,4 +106,4 @@ class Shared_Permissions extends Permissions { // Not a valid action for Shared Permissions } -} \ No newline at end of file +} diff --git a/apps/files_sharing/lib/watcher.php b/apps/files_sharing/lib/watcher.php index e67d1ee9086..6fdfc1db36d 100644 --- a/apps/files_sharing/lib/watcher.php +++ b/apps/files_sharing/lib/watcher.php @@ -48,4 +48,4 @@ class Shared_Watcher extends Watcher { } } -} \ No newline at end of file +} diff --git a/apps/files_sharing/templates/part.404.php b/apps/files_sharing/templates/part.404.php index b5152e1511a..3ef117d7524 100644 --- a/apps/files_sharing/templates/part.404.php +++ b/apps/files_sharing/templates/part.404.php @@ -9,4 +9,4 @@

t('For more info, please ask the person who sent this link.')); ?>

- \ No newline at end of file + diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php index 3b1e0ac30cc..2c101f0a723 100644 --- a/apps/files_trashbin/appinfo/app.php +++ b/apps/files_trashbin/appinfo/app.php @@ -4,4 +4,4 @@ OC::$CLASSPATH['OCA\Files_Trashbin\Hooks'] = 'files_trashbin/lib/hooks.php'; OC::$CLASSPATH['OCA\Files_Trashbin\Trashbin'] = 'files_trashbin/lib/trash.php'; // register hooks -\OCA\Files_Trashbin\Trashbin::registerHooks(); \ No newline at end of file +\OCA\Files_Trashbin\Trashbin::registerHooks(); diff --git a/apps/files_trashbin/appinfo/update.php b/apps/files_trashbin/appinfo/update.php index f4dad7b26bf..0ca232668d7 100644 --- a/apps/files_trashbin/appinfo/update.php +++ b/apps/files_trashbin/appinfo/update.php @@ -7,4 +7,4 @@ if (version_compare($installedVersion, '0.4', '<')) { //enforce a recalculation during next usage. $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trashsize`'); $result = $query->execute(); -} \ No newline at end of file +} diff --git a/apps/files_trashbin/js/disableDefaultActions.js b/apps/files_trashbin/js/disableDefaultActions.js index df08bfb1a50..afa80cacd6b 100644 --- a/apps/files_trashbin/js/disableDefaultActions.js +++ b/apps/files_trashbin/js/disableDefaultActions.js @@ -1,4 +1,4 @@ /* disable download and sharing actions */ var disableDownloadActions = true; var disableSharing = true; -var trashBinApp = true; \ No newline at end of file +var trashBinApp = true; diff --git a/apps/files_versions/appinfo/routes.php b/apps/files_versions/appinfo/routes.php index 8cef57c9e4d..38c288adf9d 100644 --- a/apps/files_versions/appinfo/routes.php +++ b/apps/files_versions/appinfo/routes.php @@ -6,4 +6,4 @@ */ // Register with the capabilities API -OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH); \ No newline at end of file +OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH); diff --git a/apps/files_versions/lib/capabilities.php b/apps/files_versions/lib/capabilities.php index 3251a07b6ae..45d7dd3fb02 100644 --- a/apps/files_versions/lib/capabilities.php +++ b/apps/files_versions/lib/capabilities.php @@ -20,4 +20,4 @@ class Capabilities { )); } -} \ No newline at end of file +} diff --git a/apps/user_ldap/ajax/clearMappings.php b/apps/user_ldap/ajax/clearMappings.php index 5dab39839b6..9118d58c5cf 100644 --- a/apps/user_ldap/ajax/clearMappings.php +++ b/apps/user_ldap/ajax/clearMappings.php @@ -32,4 +32,4 @@ if(\OCA\user_ldap\lib\Helper::clearMapping($subject)) { } else { $l=OC_L10N::get('user_ldap'); OCP\JSON::error(array('message' => $l->t('Failed to clear the mappings.'))); -} \ No newline at end of file +} diff --git a/apps/user_ldap/ajax/getConfiguration.php b/apps/user_ldap/ajax/getConfiguration.php index dfae68d2dc9..baca588976f 100644 --- a/apps/user_ldap/ajax/getConfiguration.php +++ b/apps/user_ldap/ajax/getConfiguration.php @@ -28,4 +28,4 @@ OCP\JSON::callCheck(); $prefix = $_POST['ldap_serverconfig_chooser']; $connection = new \OCA\user_ldap\lib\Connection($prefix); -OCP\JSON::success(array('configuration' => $connection->getConfiguration())); \ No newline at end of file +OCP\JSON::success(array('configuration' => $connection->getConfiguration())); diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php index 17e78f87072..1c68b2e9a76 100644 --- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php +++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php @@ -31,4 +31,4 @@ sort($serverConnections); $lk = array_pop($serverConnections); $ln = intval(str_replace('s', '', $lk)); $nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT); -OCP\JSON::success(array('configPrefix' => $nk)); \ No newline at end of file +OCP\JSON::success(array('configPrefix' => $nk)); diff --git a/apps/user_ldap/ajax/setConfiguration.php b/apps/user_ldap/ajax/setConfiguration.php index 206487c7e0a..d850bda2470 100644 --- a/apps/user_ldap/ajax/setConfiguration.php +++ b/apps/user_ldap/ajax/setConfiguration.php @@ -30,4 +30,4 @@ $prefix = $_POST['ldap_serverconfig_chooser']; $connection = new \OCA\user_ldap\lib\Connection($prefix); $connection->setConfiguration($_POST); $connection->saveConfiguration(); -OCP\JSON::success(); \ No newline at end of file +OCP\JSON::success(); diff --git a/apps/user_ldap/css/settings.css b/apps/user_ldap/css/settings.css index 185952e14bb..431e064def8 100644 --- a/apps/user_ldap/css/settings.css +++ b/apps/user_ldap/css/settings.css @@ -18,4 +18,4 @@ .ldapwarning { margin-left: 1.4em; color: #FF3B3B; -} \ No newline at end of file +} diff --git a/apps/user_ldap/group_proxy.php b/apps/user_ldap/group_proxy.php index 75e7cd46336..eb6f176c58c 100644 --- a/apps/user_ldap/group_proxy.php +++ b/apps/user_ldap/group_proxy.php @@ -198,4 +198,4 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { //it's the same across all our user backends obviously return $this->refBackend->implementsActions($actions); } -} \ No newline at end of file +} diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js index 52d5dbc48d9..78c9719480d 100644 --- a/apps/user_ldap/js/settings.js +++ b/apps/user_ldap/js/settings.js @@ -204,4 +204,4 @@ $(document).ready(function() { LdapConfiguration.refreshConfig(); } }); -}); \ No newline at end of file +}); diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/proxy.php index c80e2163475..ae3e3be7361 100644 --- a/apps/user_ldap/lib/proxy.php +++ b/apps/user_ldap/lib/proxy.php @@ -101,4 +101,4 @@ abstract class Proxy { public function clearCache() { $this->cache->clear($this->getCacheKey(null)); } -} \ No newline at end of file +} diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php index 73cc0963182..0722d8871a4 100644 --- a/apps/user_ldap/user_proxy.php +++ b/apps/user_ldap/user_proxy.php @@ -198,4 +198,4 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { return $this->refBackend->hasUserListings(); } -} \ No newline at end of file +} diff --git a/core/css/auth.css b/core/css/auth.css index bce7fa7b711..0adc10c77d9 100644 --- a/core/css/auth.css +++ b/core/css/auth.css @@ -36,4 +36,4 @@ h2 img { font-size:1.2em; margin:.7em; padding:0; -} \ No newline at end of file +} diff --git a/core/js/jquery.infieldlabel.js b/core/js/jquery.infieldlabel.js index 8a76da1b140..fad15102bcb 100644 --- a/core/js/jquery.infieldlabel.js +++ b/core/js/jquery.infieldlabel.js @@ -174,4 +174,4 @@ }); }; -}(jQuery)); \ No newline at end of file +}(jQuery)); diff --git a/core/js/jquery.inview.js b/core/js/jquery.inview.js index 9687cd83368..511ae95415e 100644 --- a/core/js/jquery.inview.js +++ b/core/js/jquery.inview.js @@ -131,4 +131,4 @@ // By the way, iOS (iPad, iPhone, ...) seems to not execute, or at least delays // intervals while the user scrolls. Therefore the inview event might fire a bit late there setInterval(checkInView, 250); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/core/js/oc-requesttoken.js b/core/js/oc-requesttoken.js index f4cf286b8aa..6cc6b5a855b 100644 --- a/core/js/oc-requesttoken.js +++ b/core/js/oc-requesttoken.js @@ -1,3 +1,3 @@ $(document).bind('ajaxSend', function(elm, xhr, s) { xhr.setRequestHeader('requesttoken', oc_requesttoken); -}); \ No newline at end of file +}); diff --git a/core/js/visitortimezone.js b/core/js/visitortimezone.js index 58a1e9ea355..ee0105c783d 100644 --- a/core/js/visitortimezone.js +++ b/core/js/visitortimezone.js @@ -1,4 +1,4 @@ $(document).ready(function () { var visitortimezone = (-new Date().getTimezoneOffset() / 60); $('#timezone-offset').val(visitortimezone); -}); \ No newline at end of file +}); diff --git a/core/lostpassword/templates/email.php b/core/lostpassword/templates/email.php index b65049feffe..3dbae4bfc69 100644 --- a/core/lostpassword/templates/email.php +++ b/core/lostpassword/templates/email.php @@ -1,2 +1,2 @@ t('Use the following link to reset your password: {link}')); \ No newline at end of file +echo str_replace('{link}', $_['link'], $l->t('Use the following link to reset your password: {link}')); diff --git a/core/routes.php b/core/routes.php index be19b66bf72..dd8222d4378 100644 --- a/core/routes.php +++ b/core/routes.php @@ -73,4 +73,4 @@ $this->create('app_script', '/apps/{app}/{file}') // used for heartbeat $this->create('heartbeat', '/heartbeat')->action(function(){ // do nothing -}); \ No newline at end of file +}); diff --git a/cron.php b/cron.php index fbea7f26aed..d39800c8849 100644 --- a/cron.php +++ b/cron.php @@ -121,4 +121,4 @@ try { } catch (Exception $ex) { \OCP\Util::writeLog('cron', $ex->getMessage(), \OCP\Util::FATAL); -} \ No newline at end of file +} diff --git a/lib/files/storage/commontest.php b/lib/files/storage/commontest.php index fbdb7fbf110..c3f1eb31955 100644 --- a/lib/files/storage/commontest.php +++ b/lib/files/storage/commontest.php @@ -77,4 +77,4 @@ class CommonTest extends \OC\Files\Storage\Common{ public function touch($path, $mtime=null) { return $this->storage->touch($path, $mtime); } -} \ No newline at end of file +} diff --git a/lib/geo.php b/lib/geo.php index 4eb785da355..ed01ad0b616 100644 --- a/lib/geo.php +++ b/lib/geo.php @@ -28,4 +28,4 @@ class OC_Geo{ reset($variances); return current($variances); } -} \ No newline at end of file +} diff --git a/lib/ocs/result.php b/lib/ocs/result.php index 729c39056d9..84f06fa01c7 100644 --- a/lib/ocs/result.php +++ b/lib/ocs/result.php @@ -94,4 +94,4 @@ class OC_OCS_Result{ } -} \ No newline at end of file +} diff --git a/lib/public/groupinterface.php b/lib/public/groupinterface.php index 97833028118..5603faa8265 100644 --- a/lib/public/groupinterface.php +++ b/lib/public/groupinterface.php @@ -28,4 +28,4 @@ namespace OCP; -interface GroupInterface extends \OC_Group_Interface {} \ No newline at end of file +interface GroupInterface extends \OC_Group_Interface {} diff --git a/lib/public/userinterface.php b/lib/public/userinterface.php index b73a8f8d8b0..53d9faf7a5e 100644 --- a/lib/public/userinterface.php +++ b/lib/public/userinterface.php @@ -28,4 +28,4 @@ namespace OCP; -interface UserInterface extends \OC_User_Interface {} \ No newline at end of file +interface UserInterface extends \OC_User_Interface {} diff --git a/lib/user/http.php b/lib/user/http.php index 944ede73a0b..1e044ed4188 100644 --- a/lib/user/http.php +++ b/lib/user/http.php @@ -103,4 +103,4 @@ class OC_User_HTTP extends OC_User_Backend { return false; } } -} \ No newline at end of file +} diff --git a/lib/user/interface.php b/lib/user/interface.php index b1e19aea7fb..c72bdfaf3fd 100644 --- a/lib/user/interface.php +++ b/lib/user/interface.php @@ -77,4 +77,4 @@ interface OC_User_Interface { * @return boolean if users can be listed or not */ public function hasUserListings(); -} \ No newline at end of file +} diff --git a/lib/vobject/compoundproperty.php b/lib/vobject/compoundproperty.php index d702ab802e0..7fe42574bed 100644 --- a/lib/vobject/compoundproperty.php +++ b/lib/vobject/compoundproperty.php @@ -67,4 +67,4 @@ class CompoundProperty extends \Sabre\VObject\Property\Compound { } -} \ No newline at end of file +} diff --git a/lib/vobject/stringproperty.php b/lib/vobject/stringproperty.php index b98a8f26c2b..a9d63a0a789 100644 --- a/lib/vobject/stringproperty.php +++ b/lib/vobject/stringproperty.php @@ -77,4 +77,4 @@ class StringProperty extends \Sabre\VObject\Property { } -} \ No newline at end of file +} diff --git a/ocs/routes.php b/ocs/routes.php index 5fcf05e4f99..1ea698c7a83 100644 --- a/ocs/routes.php +++ b/ocs/routes.php @@ -74,4 +74,4 @@ OC_API::register( array('OC_OCS_Cloud', 'getCapabilities'), 'core', OC_API::USER_AUTH - ); \ No newline at end of file + ); diff --git a/public.php b/public.php index 0154b59cce3..1781632bc78 100644 --- a/public.php +++ b/public.php @@ -28,4 +28,4 @@ try { OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); OC_Template::printExceptionErrorPage($ex); -} \ No newline at end of file +} diff --git a/remote.php b/remote.php index ec0f2ecef72..2d0088cd903 100644 --- a/remote.php +++ b/remote.php @@ -46,4 +46,4 @@ try { OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); OC_Template::printExceptionErrorPage($ex); -} \ No newline at end of file +} diff --git a/search/css/results.css b/search/css/results.css index 30cc352fd7b..4ae7d67afb3 100644 --- a/search/css/results.css +++ b/search/css/results.css @@ -66,4 +66,4 @@ #searchresults tr.current { background-color:#ddd; -} \ No newline at end of file +} diff --git a/settings/ajax/setsecurity.php b/settings/ajax/setsecurity.php index 16a85aade81..675d7eced47 100644 --- a/settings/ajax/setsecurity.php +++ b/settings/ajax/setsecurity.php @@ -10,4 +10,4 @@ OCP\JSON::callCheck(); OC_Config::setValue( 'forcessl', filter_var($_POST['enforceHTTPS'], FILTER_VALIDATE_BOOLEAN)); -echo 'true'; \ No newline at end of file +echo 'true'; diff --git a/settings/ajax/updateapp.php b/settings/ajax/updateapp.php index 300e8642515..91c342d5d07 100644 --- a/settings/ajax/updateapp.php +++ b/settings/ajax/updateapp.php @@ -12,4 +12,4 @@ if($result !== false) { } else { $l = OC_L10N::get('settings'); OC_JSON::error(array("data" => array( "message" => $l->t("Couldn't update app.") ))); -} \ No newline at end of file +} diff --git a/settings/js/apps-custom.php b/settings/js/apps-custom.php index d827dfc7058..c25148cdde5 100644 --- a/settings/js/apps-custom.php +++ b/settings/js/apps-custom.php @@ -23,4 +23,4 @@ foreach($combinedApps as $app) { echo("\n"); } -echo ("var appid =".json_encode($_GET['appid']).";"); \ No newline at end of file +echo ("var appid =".json_encode($_GET['appid']).";"); diff --git a/settings/js/isadmin.php b/settings/js/isadmin.php index 8b31f8a7cf9..13a8ba1d312 100644 --- a/settings/js/isadmin.php +++ b/settings/js/isadmin.php @@ -17,4 +17,4 @@ if (OC_User::isAdminUser(OC_User::getUser())) { echo("var isadmin = true;"); } else { echo("var isadmin = false;"); -} \ No newline at end of file +} diff --git a/status.php b/status.php index bac01c11b28..179fe3f49f2 100644 --- a/status.php +++ b/status.php @@ -39,4 +39,4 @@ try { } catch (Exception $ex) { OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); -} \ No newline at end of file +} diff --git a/tests/lib/app.php b/tests/lib/app.php index 5396db8143e..52eade90a6e 100644 --- a/tests/lib/app.php +++ b/tests/lib/app.php @@ -79,4 +79,4 @@ class Test_App extends PHPUnit_Framework_TestCase { $this->assertFalse(OC_App::isAppVersionCompatible($oc, $app)); } -} \ No newline at end of file +} diff --git a/tests/lib/archive/zip.php b/tests/lib/archive/zip.php index e049a899d88..195e3450f3f 100644 --- a/tests/lib/archive/zip.php +++ b/tests/lib/archive/zip.php @@ -19,4 +19,4 @@ class Test_Archive_ZIP extends Test_Archive { return new OC_Archive_ZIP(OCP\Files::tmpFile('.zip')); } } -} \ No newline at end of file +} diff --git a/tests/lib/geo.php b/tests/lib/geo.php index 2c3611c092e..1c56a976129 100644 --- a/tests/lib/geo.php +++ b/tests/lib/geo.php @@ -20,4 +20,4 @@ class Test_Geo extends PHPUnit_Framework_TestCase { $expected = 'Pacific/Enderbury'; $this->assertEquals($expected, $result); } -} \ No newline at end of file +} diff --git a/tests/lib/vobject.php b/tests/lib/vobject.php index f28d22a1fcd..db5b0f99f06 100644 --- a/tests/lib/vobject.php +++ b/tests/lib/vobject.php @@ -35,4 +35,4 @@ class Test_VObject extends PHPUnit_Framework_TestCase { $parts = $property->getParts(); $this->assertEquals('Marketing;Sales', $parts[2]); } -} \ No newline at end of file +} -- cgit v1.2.3 From 1793ec1d5dcbdf806817da1674562ef6a02b39b0 Mon Sep 17 00:00:00 2001 From: Owen Winkler Date: Sun, 18 Aug 2013 05:17:28 -0400 Subject: Fixed inconsistent spacing. --- core/js/js.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index 75a2b51a43f..d580b6113e6 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -69,7 +69,7 @@ function initL10N(app) { var code = 'var plural; var nplurals; '+pf+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) };'; t.plural_function = new Function("n", code); } else { - console.log("Syntax error in language file. Plural-Forms header is invalid ["+ t.plural_forms+"]"); + console.log("Syntax error in language file. Plural-Forms header is invalid ["+t.plural_forms+"]"); } } } -- cgit v1.2.3