diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php index a2eb506f85..d66aab5896 100644 --- a/apps/bookmarks/ajax/addBookmark.php +++ b/apps/bookmarks/ajax/addBookmark.php @@ -30,6 +30,6 @@ $RUNTIME_NOSETUPFS=true; OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('bookmarks'); -require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php'); -$id = addBookmark($_POST['url'], $_POST['title'], $_POST['tags']); +require_once(OC_App::getAppPath('bookmarks').'/bookmarksHelper.php'); +$id = addBookmark($_GET['url'], $_GET['title'], $_GET['tags']); OCP\JSON::success(array('data' => $id)); \ No newline at end of file diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php index fcec2e1ced..439b680dc2 100644 --- a/apps/bookmarks/ajax/editBookmark.php +++ b/apps/bookmarks/ajax/editBookmark.php @@ -40,18 +40,26 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ } $bookmark_id = (int)$_POST["id"]; +$user_id = OCP\USER::getUser(); $query = OCP\DB::prepare(" UPDATE *PREFIX*bookmarks SET url = ?, title =?, lastmodified = $_ut - WHERE id = $bookmark_id + WHERE id = ? + AND user_id = ? "); $params=array( htmlspecialchars_decode($_POST["url"]), htmlspecialchars_decode($_POST["title"]), + $bookmark_id, + $user_id, ); -$query->execute($params); + +$result = $query->execute($params); + +# Abort the operation if bookmark couldn't be set (probably because the user is not allowed to edit this bookmark) +if ($result->numRows() == 0) exit(); # Remove old tags and insert new ones. $query = OCP\DB::prepare(" @@ -66,7 +74,7 @@ $query = OCP\DB::prepare(" (bookmark_id, tag) VALUES (?, ?) "); - + $tags = explode(' ', urldecode($_POST["tags"])); foreach ($tags as $tag) { if(empty($tag)) { diff --git a/apps/bookmarks/templates/list.php b/apps/bookmarks/templates/list.php index fdd2b19f79..4b84b43890 100644 --- a/apps/bookmarks/templates/list.php +++ b/apps/bookmarks/templates/list.php @@ -7,7 +7,7 @@ * See the COPYING-README file. */ ?> - +
@@ -20,7 +20,7 @@ diff --git a/apps/calendar/ajax/calendar/new.php b/apps/calendar/ajax/calendar/new.php index 278c8e5520..e77d4ebff0 100644 --- a/apps/calendar/ajax/calendar/new.php +++ b/apps/calendar/ajax/calendar/new.php @@ -31,7 +31,13 @@ OC_Calendar_Calendar::setCalendarActive($calendarid, 1); $calendar = OC_Calendar_Calendar::find($calendarid); $tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields'); $tmpl->assign('calendar', $calendar); +if(OC_Calendar_Share::allUsersSharedwith($calendarid, OC_Calendar_Share::CALENDAR) == array()){ + $shared = false; +}else{ + $shared = true; +} +$tmpl->assign('shared', $shared); OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), 'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar), -)); \ No newline at end of file +)); diff --git a/apps/calendar/ajax/calendar/update.php b/apps/calendar/ajax/calendar/update.php index 5cf63d396f..a2c898c807 100644 --- a/apps/calendar/ajax/calendar/update.php +++ b/apps/calendar/ajax/calendar/update.php @@ -36,7 +36,13 @@ OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']); $calendar = OC_Calendar_App::getCalendar($calendarid); $tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields'); $tmpl->assign('calendar', $calendar); +if(OC_Calendar_Share::allUsersSharedwith($calendarid, OC_Calendar_Share::CALENDAR) == array()){ + $shared = false; +}else{ + $shared = true; +} +$tmpl->assign('shared', $shared); OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), 'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar), -)); \ No newline at end of file +)); diff --git a/apps/calendar/ajax/event/edit.form.php b/apps/calendar/ajax/event/edit.form.php index 6e5709a18d..26a0cc2a60 100644 --- a/apps/calendar/ajax/event/edit.form.php +++ b/apps/calendar/ajax/event/edit.form.php @@ -27,6 +27,14 @@ $vevent = $object->VEVENT; $dtstart = $vevent->DTSTART; $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); switch($dtstart->getDateType()) { + case Sabre_VObject_Property_DateTime::UTC: + $timeOffset = OC_Calendar_App::$tz*60; + $newDT = $dtstart->getDateTime(); + $newDT->add(new DateInterval("PT" . $timeOffset . "M")); + $dtstart->setDateTime($newDT); + $newDT = $dtend->getDateTime(); + $newDT->add(new DateInterval("PT" . $timeOffset . "M")); + $dtend->setDateTime($newDT); case Sabre_VObject_Property_DateTime::LOCALTZ: case Sabre_VObject_Property_DateTime::LOCAL: $startdate = $dtstart->getDateTime()->format('d-m-Y'); diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index 7178358c7b..ae55cbc02d 100644 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -22,7 +22,7 @@ $calendar_id = (is_null($calendar_id)?strip_tags($_GET['calendar_id']):$calendar $start = (version_compare(PHP_VERSION, '5.3.0', '>='))?DateTime::createFromFormat('U', $_GET['start']):new DateTime('@' . $_GET['start']); $end = (version_compare(PHP_VERSION, '5.3.0', '>='))?DateTime::createFromFormat('U', $_GET['end']):new DateTime('@' . $_GET['end']); -$events = OC_Calendar_App::getrequestedEvents($calendar_id, $start, $end); +$events = OC_Calendar_App::getrequestedEvents($_GET['calendar_id'], $start, $end); $output = array(); foreach($events as $event){ $output = array_merge($output, OC_Calendar_App::generateEventOutput($event, $start, $end)); diff --git a/apps/calendar/appinfo/remote.php b/apps/calendar/appinfo/remote.php index 3bd8737ee9..7ab546245f 100644 --- a/apps/calendar/appinfo/remote.php +++ b/apps/calendar/appinfo/remote.php @@ -7,8 +7,8 @@ */ OCP\App::checkAppEnabled('calendar'); -if(substr($_SERVER["REQUEST_URI"],0,strlen(OC::$APPSWEBROOT . '/apps/calendar/caldav.php')) == OC::$APPSWEBROOT . '/apps/calendar/caldav.php'){ - $baseuri = OC::$APPSWEBROOT . '/apps/calendar/caldav.php'; +if(substr($_SERVER["REQUEST_URI"],0,strlen(OC_App::getAppWebPath('calendar').'/caldav.php')) == OC_App::getAppWebPath('calendar'). '/caldav.php'){ + $baseuri = OC_App::getAppWebPath('calendar').'/caldav.php'; } // only need authentication apps diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 3b1be59381..e17f88e38b 100644 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -207,8 +207,7 @@ Calendar={ } }, showCalDAVUrl:function(username, calname){ - $('#caldav_url').val(totalurl + '/' + username + '/' + calname); - $('#caldav_url').val(encodeURI($('#caldav_url').val())); + $('#caldav_url').val(totalurl + '/' + username + '/' + decodeURIComponent(calname)); $('#caldav_url').show(); $("#caldav_url_close").show(); }, @@ -706,10 +705,12 @@ function ListView(element, calendar) { if (delta) { if (delta < 0){ addDays(t.start, -7); + addDays(t.end, -7); if (!opt('weekends')) { skipWeekend(t.start, delta < 0 ? -1 : 1); } }else{ + addDays(t.start, 7); addDays(t.end, 7); if (!opt('weekends')) { skipWeekend(t.end, delta < 0 ? -1 : 1); diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php index 167382a5e7..8e13b13b8a 100644 --- a/apps/calendar/lib/app.php +++ b/apps/calendar/lib/app.php @@ -338,6 +338,9 @@ class OC_Calendar_App{ $singleevents = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::EVENT, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r'); foreach($singleevents as $singleevent){ $event = OC_Calendar_Object::find($singleevent['eventid']); + if(!array_key_exists('summary', $event)){ + $event['summary'] = self::$l10n->t('unnamed'); + } $event['summary'] .= ' (' . self::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner($event['id']) . ')'; $events[] = $event; } diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php index b725898858..1bfab5cd64 100644 --- a/apps/calendar/lib/calendar.php +++ b/apps/calendar/lib/calendar.php @@ -206,7 +206,7 @@ class OC_Calendar_Calendar{ $stmt->execute(array($id)); OCP\Util::emitHook('OC_Calendar', 'deleteCalendar', $id); - if(count(self::allCalendars()) == 0) { + if(count(self::allCalendars(OCP\USER::getUser())) == 0) { self::addCalendar(OCP\USER::getUser(),'Default calendar'); } diff --git a/apps/calendar/lib/search.php b/apps/calendar/lib/search.php index 6526b4223a..560330f65e 100644 --- a/apps/calendar/lib/search.php +++ b/apps/calendar/lib/search.php @@ -17,6 +17,9 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{ foreach($calendars as $calendar){ $objects = OC_Calendar_Object::all($calendar['id']); foreach($objects as $object){ + if($object['objecttype']!='VEVENT') { + continue; + } if(substr_count(strtolower($object['summary']), strtolower($query)) > 0){ $calendardata = OC_VObject::parse($object['calendardata']); $vevent = $calendardata->VEVENT; @@ -37,7 +40,7 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{ $info = $l->t('Date') . ': ' . $start_dt->format('d.m.y H:i') . ' - ' . $end_dt->format('d.m.y H:i'); } $link = OCP\Util::linkTo('calendar', 'index.php').'?showevent='.urlencode($object['id']); - $results[]=new OC_Search_Result($object['summary'],$info, $link,$l->t('Cal.'));//$name,$text,$link,$type + $results[]=new OC_Search_Result($object['summary'],$info, $link,(string)$l->t('Cal.'));//$name,$text,$link,$type } } } diff --git a/apps/calendar/templates/part.choosecalendar.rowfields.php b/apps/calendar/templates/part.choosecalendar.rowfields.php index 965523f847..4492ce731c 100644 --- a/apps/calendar/templates/part.choosecalendar.rowfields.php +++ b/apps/calendar/templates/part.choosecalendar.rowfields.php @@ -1,8 +1,21 @@ -'; -echo ''; -echo ''; -echo ''; -echo ''; -echo ''; -echo ''; + + > + + + + + + + + + + + + + + + + + + + diff --git a/apps/contacts/appinfo/remote.php b/apps/contacts/appinfo/remote.php index ef50e4ad39..5add3bc688 100644 --- a/apps/contacts/appinfo/remote.php +++ b/apps/contacts/appinfo/remote.php @@ -22,8 +22,8 @@ OCP\App::checkAppEnabled('contacts'); -if(substr($_SERVER["REQUEST_URI"],0,strlen(OC::$APPSWEBROOT . '/apps/contacts/carddav.php')) == OC::$APPSWEBROOT . '/apps/contacts/carddav.php'){ - $baseuri = OC::$APPSWEBROOT . '/apps/contacts/carddav.php'; +if(substr($_SERVER["REQUEST_URI"],0,strlen(OC_App::getAppWebPath('contacts').'/carddav.php')) == OC_App::getAppWebPath('contacts').'/carddav.php'){ + $baseuri = OC_App::getAppWebPath('contacts').'/carddav.php'; } // only need authentication apps diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index 8ab2a3fbb8..6f5602c211 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -77,7 +77,7 @@ Contacts={ } }, showCardDAVUrl:function(username, bookname){ - $('#carddav_url').val(totalurl + '/' + username + '/' + bookname); + $('#carddav_url').val(totalurl + '/' + username + '/' + decodeURIComponent(bookname)); $('#carddav_url').show(); $('#carddav_url_close').show(); }, @@ -256,12 +256,14 @@ Contacts={ } } else { newid = id; + bookid = bookid?bookid:$('#contacts li[data-id="'+newid+'"]').data('bookid'); } var localLoadContact = function(newid, bookid) { if($('.contacts li').length > 0) { - firstitem.addClass('active'); + $('#contacts li[data-id="'+newid+'"]').addClass('active'); $.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':newid},function(jsondata){ if(jsondata.status == 'success'){ + $('#contacts h3[data-id="'+bookid+'"]').trigger('click'); Contacts.UI.Card.loadContact(jsondata.data, bookid); } else { OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); @@ -1503,7 +1505,7 @@ Contacts={ }, Contacts:{ // Reload the contacts list. - update:function(){ + update:function(id){ $.getJSON(OC.filePath('contacts', 'ajax', 'contacts.php'),{},function(jsondata){ if(jsondata.status == 'success'){ $('#contacts').html(jsondata.data.page).ready(function() { @@ -1518,7 +1520,7 @@ Contacts={ })}, 100); setTimeout(Contacts.UI.Contacts.lazyupdate, 500);*/ }); - Contacts.UI.Card.update(); + Contacts.UI.Card.update(id); } else{ OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); @@ -1707,5 +1709,5 @@ $(document).ready(function(){ $('#contacts_propertymenu_dropdown a').keydown(propertyMenuItem); Contacts.UI.loadHandlers(); - Contacts.UI.Contacts.update(); + Contacts.UI.Contacts.update(id); }); diff --git a/apps/contacts/lib/search.php b/apps/contacts/lib/search.php index 19330fa9be..5d9ca97e76 100644 --- a/apps/contacts/lib/search.php +++ b/apps/contacts/lib/search.php @@ -11,8 +11,8 @@ class OC_Search_Provider_Contacts extends OC_Search_Provider{ $vcards = OC_Contacts_VCard::all($addressbook['id']); foreach($vcards as $vcard){ if(substr_count(strtolower($vcard['fullname']), strtolower($query)) > 0){ - $link = OCP\Util::linkTo('contacts', 'index.php').'?id='.urlencode($vcard['id']); - $results[]=new OC_Search_Result($vcard['fullname'],'', $link,$l->t('Contact'));//$name,$text,$link,$type + $link = OCP\Util::linkTo('contacts', 'index.php').'&id='.urlencode($vcard['id']); + $results[]=new OC_Search_Result($vcard['fullname'],'', $link,(string)$l->t('Contact'));//$name,$text,$link,$type } } } diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index d16356d4a5..0d4219c9f2 100644 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -1,6 +1,7 @@
diff --git a/apps/contacts/templates/part.chooseaddressbook.rowfields.php b/apps/contacts/templates/part.chooseaddressbook.rowfields.php index 780920ea3c..2988bb44c5 100644 --- a/apps/contacts/templates/part.chooseaddressbook.rowfields.php +++ b/apps/contacts/templates/part.chooseaddressbook.rowfields.php @@ -2,10 +2,10 @@ " type="checkbox" onClick="Contacts.UI.Addressbooks.activation(this, )" > - + - ');" title="t("CardDav Link"); ?>" class="svg action globe"> + " class="svg action globe"> " title="t("Download"); ?>" class="svg action download"> diff --git a/apps/contacts/templates/part.contacts.php b/apps/contacts/templates/part.contacts.php index f0b14c8e5f..c33c5832e8 100644 --- a/apps/contacts/templates/part.contacts.php +++ b/apps/contacts/templates/part.contacts.php @@ -3,7 +3,7 @@ foreach($_['books'] as $id => $addressbook) { echo '

'.$addressbook['displayname'].'

'; echo ''; } diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php index da4e930f3e..8378507163 100644 --- a/apps/contacts/thumbnail.php +++ b/apps/contacts/thumbnail.php @@ -23,6 +23,7 @@ OCP\JSON::checkLoggedIn(); //OCP\User::checkLoggedIn(); OCP\App::checkAppEnabled('contacts'); +session_close_write(); function getStandardImage(){ //OCP\Response::setExpiresHeader('P10D'); diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php index 43fe2d1fa9..22d9bb4490 100644 --- a/apps/files/templates/part.breadcrumb.php +++ b/apps/files/templates/part.breadcrumb.php @@ -1,6 +1,6 @@
svg" data-dir='' style='background-image:url("")'> - "> + ">
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index 4c0ffa978e..849e88ee0b 100644 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -44,18 +44,16 @@ class OC_Crypt { } public static function init($login,$password) { - $view1=new OC_FilesystemView('/'); - if(!$view1->file_exists('/'.$login)){ - $view1->mkdir('/'.$login); + $view=new OC_FilesystemView('/'); + if(!$view->file_exists('/'.$login)){ + $view->mkdir('/'.$login); } - $view=new OC_FilesystemView('/'.$login); - OC_FileProxy::$enabled=false; - if(!$view->file_exists('/encryption.key')){// does key exist? + if(!$view->file_exists('/'.$login.'/encryption.key')){// does key exist? OC_Crypt::createkey($login,$password); } - $key=$view->file_get_contents('/encryption.key'); + $key=$view->file_get_contents('/'.$login.'/encryption.key'); OC_FileProxy::$enabled=true; $_SESSION['enckey']=OC_Crypt::decrypt($key, $password); } @@ -206,12 +204,16 @@ class OC_Crypt { /** * decrypt data in 8192b sized blocks */ - public static function blockDecrypt($data, $key=''){ + public static function blockDecrypt($data, $key='',$maxLength=0){ $result=''; while(strlen($data)){ $result.=self::decrypt(substr($data,0,8192),$key); $data=substr($data,8192); } - return rtrim($result, "\0"); + if($maxLength>0){ + return substr($result,0,$maxLength); + }else{ + return rtrim($result, "\0"); + } } } diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php index 64fec381de..e002053756 100644 --- a/apps/files_encryption/lib/cryptstream.php +++ b/apps/files_encryption/lib/cryptstream.php @@ -35,6 +35,7 @@ class OC_CryptStream{ private $meta=array();//header/meta for source stream private $count; private $writeCache; + private $size; private static $rootView; public function stream_open($path, $mode, $options, &$opened_path){ @@ -45,8 +46,14 @@ class OC_CryptStream{ if(dirname($path)=='streams' and isset(self::$sourceStreams[basename($path)])){ $this->source=self::$sourceStreams[basename($path)]['stream']; $this->path=self::$sourceStreams[basename($path)]['path']; + $this->size=self::$sourceStreams[basename($path)]['size']; }else{ $this->path=$path; + if($mode=='w' or $mode=='w+' or $mode=='wb' or $mode=='wb+'){ + $this->size=0; + }else{ + $this->size=self::$rootView->filesize($path,$mode); + } OC_FileProxy::$enabled=false;//disable fileproxies so we can open the source file $this->source=self::$rootView->fopen($path,$mode); OC_FileProxy::$enabled=true; @@ -77,14 +84,16 @@ class OC_CryptStream{ OCP\Util::writeLog('files_encryption','php bug 21641 no longer holds, decryption will not work',OCP\Util::FATAL); die(); } + $pos=ftell($this->source); $data=fread($this->source,8192); if(strlen($data)){ $result=OC_Crypt::decrypt($data); }else{ $result=''; } - if($this->stream_eof()){ - $result=rtrim($result, "\0"); + $length=$this->size-$pos; + if($length<8192){ + $result=substr($result,0,$length); } return $result; } @@ -106,8 +115,9 @@ class OC_CryptStream{ $data=substr($block,0,$currentPos%8192).$data; fseek($this->source,-($currentPos%8192),SEEK_CUR); } - while(strlen($data)>0){ - if(strlen($data)<8192){ + $currentPos=ftell($this->source); + while($remainingLength=strlen($data)>0){ + if($remainingLength<8192){ $this->writeCache=$data; $data=''; }else{ @@ -116,6 +126,7 @@ class OC_CryptStream{ $data=substr($data,8192); } } + $this->size=max($this->size,$currentPos+$length); return $length; } @@ -159,7 +170,7 @@ class OC_CryptStream{ public function stream_close(){ $this->flush(); if($this->meta['mode']!='r' and $this->meta['mode']!='rb'){ - OC_FileCache::put($this->path,array('encrypted'=>true),''); + OC_FileCache::put($this->path,array('encrypted'=>true,'size'=>$this->size),''); } return fclose($this->source); } diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index b9e719448a..f25e4a662f 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -66,15 +66,17 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ public function preFile_put_contents($path,&$data){ if(self::shouldEncrypt($path)){ if (!is_resource($data)) {//stream put contents should have been converter to fopen + $size=strlen($data); $data=OC_Crypt::blockEncrypt($data); - OC_FileCache::put($path,array('encrypted'=>true),''); + OC_FileCache::put($path,array('encrypted'=>true,'size'=>$size),''); } } } public function postFile_get_contents($path,$data){ if(self::isEncrypted($path)){ - $data=OC_Crypt::blockDecrypt($data); + $cached=OC_FileCache_Cached::get($path,''); + $data=OC_Crypt::blockDecrypt($data,'',$cached['size']); } return $data; } @@ -108,4 +110,21 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ } return $mime; } + + public function postStat($path,$data){ + if(self::isEncrypted($path)){ + $cached=OC_FileCache_Cached::get($path,''); + $data['size']=$cached['size']; + } + return $data; + } + + public function postFileSize($path,$size){ + if(self::isEncrypted($path)){ + $cached=OC_FileCache_Cached::get($path,''); + return $cached['size']; + }else{ + return $size; + } + } } diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php index 70aa1daf4c..286770a69f 100644 --- a/apps/files_encryption/tests/encryption.php +++ b/apps/files_encryption/tests/encryption.php @@ -66,7 +66,7 @@ class Test_Encryption extends UnitTestCase { $this->assertEqual($decrypted,$source); $encrypted=OC_Crypt::blockEncrypt($source,$key); - $decrypted=OC_Crypt::blockDecrypt($encrypted,$key); + $decrypted=OC_Crypt::blockDecrypt($encrypted,$key,strlen($source)); $this->assertEqual($decrypted,$source); } } diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php index 5616e2091a..fcfc4cfb9f 100644 --- a/apps/files_encryption/tests/proxy.php +++ b/apps/files_encryption/tests/proxy.php @@ -8,10 +8,12 @@ class Test_CryptProxy extends UnitTestCase { private $oldConfig; + private $oldKey; public function setUp(){ $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true'); OCP\Config::setAppValue('files_encryption','enable_encryption','true'); + $this->oldKey=isset($_SESSION['enckey'])?$_SESSION['enckey']:null; //set testing key @@ -36,6 +38,9 @@ class Test_CryptProxy extends UnitTestCase { public function tearDown(){ OCP\Config::setAppValue('files_encryption','enable_encryption',$this->oldConfig); + if(!is_null($this->oldKey)){ + $_SESSION['enckey']=$this->oldKey; + } } public function testSimple(){ @@ -50,6 +55,7 @@ class Test_CryptProxy extends UnitTestCase { $fromFile=OC_Filesystem::file_get_contents('/file'); $this->assertNotEqual($original,$stored); + $this->assertEqual(strlen($original),strlen($fromFile)); $this->assertEqual($original,$fromFile); } @@ -88,6 +94,20 @@ class Test_CryptProxy extends UnitTestCase { $fromFile=OC_Filesystem::file_get_contents('/file'); $this->assertNotEqual($original,$stored); + $this->assertEqual(strlen($original),strlen($fromFile)); $this->assertEqual($original,$fromFile); + + $file=__DIR__.'/zeros'; + $original=file_get_contents($file); + + OC_Filesystem::file_put_contents('/file',$original); + + OC_FileProxy::$enabled=false; + $stored=OC_Filesystem::file_get_contents('/file'); + OC_FileProxy::$enabled=true; + + $fromFile=OC_Filesystem::file_get_contents('/file'); + $this->assertNotEqual($original,$stored); + $this->assertEqual(strlen($original),strlen($fromFile)); } } diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php index 4ffeb6210a..d95ea792f7 100644 --- a/apps/files_encryption/tests/stream.php +++ b/apps/files_encryption/tests/stream.php @@ -10,23 +10,23 @@ class Test_CryptStream extends UnitTestCase { private $tmpFiles=array(); function testStream(){ - $stream=$this->getStream('test1','w'); + $stream=$this->getStream('test1','w',strlen('foobar')); fwrite($stream,'foobar'); fclose($stream); - $stream=$this->getStream('test1','r'); + $stream=$this->getStream('test1','r',strlen('foobar')); $data=fread($stream,6); fclose($stream); $this->assertEqual('foobar',$data); $file=OC::$SERVERROOT.'/3rdparty/MDB2.php'; $source=fopen($file,'r'); - $target=$this->getStream('test2','w'); + $target=$this->getStream('test2','w',0); OCP\Files::streamCopy($source,$target); fclose($target); fclose($source); - $stream=$this->getStream('test2','r'); + $stream=$this->getStream('test2','r',filesize($file)); $data=stream_get_contents($stream); $original=file_get_contents($file); $this->assertEqual(strlen($original),strlen($data)); @@ -37,9 +37,10 @@ class Test_CryptStream extends UnitTestCase { * get a cryptstream to a temporary file * @param string $id * @param string $mode + * @param int size * @return resource */ - function getStream($id,$mode){ + function getStream($id,$mode,$size){ if($id===''){ $id=uniqid(); } @@ -50,7 +51,7 @@ class Test_CryptStream extends UnitTestCase { $file=$this->tmpFiles[$id]; } $stream=fopen($file,$mode); - OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream); + OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream,'size'=>$size); return fopen('crypt://streams/'.$id,$mode); } @@ -58,11 +59,24 @@ class Test_CryptStream extends UnitTestCase { $file=__DIR__.'/binary'; $source=file_get_contents($file); - $stream=$this->getStream('test','w'); + $stream=$this->getStream('test','w',strlen($source)); fwrite($stream,$source); fclose($stream); - $stream=$this->getStream('test','r'); + $stream=$this->getStream('test','r',strlen($source)); + $data=stream_get_contents($stream); + fclose($stream); + $this->assertEqual(strlen($data),strlen($source)); + $this->assertEqual($source,$data); + + $file=__DIR__.'/zeros'; + $source=file_get_contents($file); + + $stream=$this->getStream('test2','w',strlen($source)); + fwrite($stream,$source); + fclose($stream); + + $stream=$this->getStream('test2','r',strlen($source)); $data=stream_get_contents($stream); fclose($stream); $this->assertEqual(strlen($data),strlen($source)); diff --git a/apps/files_encryption/tests/zeros b/apps/files_encryption/tests/zeros new file mode 100644 index 0000000000..ff982acf42 Binary files /dev/null and b/apps/files_encryption/tests/zeros differ diff --git a/apps/files_external/js/google.js b/apps/files_external/js/google.js index 0d65cfda01..84c74c5742 100644 --- a/apps/files_external/js/google.js +++ b/apps/files_external/js/google.js @@ -11,7 +11,7 @@ $(document).ready(function() { window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { params[key] = value; }); - if (params['oauth_token'].length > 1 && decodeURIComponent(params['oauth_token']) == $(token).val() && params['oauth_verifier'].length > 1) { + if (params['oauth_token'] !== undefined && params['oauth_verifier'] !== undefined && decodeURIComponent(params['oauth_token']) == $(token).val()) { var tr = $(this); $.post(OC.filePath('files_external', 'ajax', 'google.php'), { step: 2, oauth_verifier: params['oauth_verifier'], request_token: $(token).val(), request_token_secret: $(token_secret).val() }, function(result) { if (result && result.status == 'success') { diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 870c13b5ae..5b9e00a378 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -157,12 +157,17 @@ class OC_Mount_Config { */ public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) { // Verify that the mount point applies for the current user - if ($isPersonal && $applicable != OCP\User::getUser()) { - return false; + if ($isPersonal) { + if ($applicable != OCP\User::getUser()) { + return false; + } + $mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/'); + } else { + $mountPoint = '/$user/files/'.ltrim($mountPoint, '/'); } $mountPoints = self::readData($isPersonal); // Remove mount point - unset($mountPoints[$mountType][$applicable]['/$user/files/'.$mountPoint]); + unset($mountPoints[$mountType][$applicable][$mountPoint]); // Unset parent arrays if empty if (empty($mountPoints[$mountType][$applicable])) { unset($mountPoints[$mountType][$applicable]); diff --git a/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css b/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css index 5fdf7af14c..6e982805a4 100644 --- a/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css +++ b/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css @@ -35,7 +35,7 @@ left: 0; width: 40px; height: 480px; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox.png'); } #fancybox-overlay { @@ -99,7 +99,7 @@ right: -15px; width: 30px; height: 30px; - background: transparent url('%appswebroot%/apps/files_imageviewer/img/fancybox.png') -40px 0px; + background: transparent url('%appswebroot%/files_imageviewer/img/fancybox.png') -40px 0px; cursor: pointer; z-index: 1103; display: none; @@ -137,7 +137,7 @@ width: 35%; cursor: pointer; outline: none; - background: transparent url('%appswebroot%/apps/files_imageviewer/img/blank.gif'); + background: transparent url('%appswebroot%/files_imageviewer/img/blank.gif'); z-index: 1102; display: none; } @@ -163,12 +163,12 @@ } #fancybox-left-ico { - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox.png'); background-position: -40px -30px; } #fancybox-right-ico { - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox.png'); background-position: -40px -60px; } @@ -199,13 +199,13 @@ top: -20px; left: 0; width: 100%; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox-x.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox-x.png'); } #fancybox-bg-ne { top: -20px; right: -20px; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox.png'); background-position: -40px -162px; } @@ -213,14 +213,14 @@ top: 0; right: -20px; height: 100%; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox-y.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox-y.png'); background-position: -20px 0px; } #fancybox-bg-se { bottom: -20px; right: -20px; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox.png'); background-position: -40px -182px; } @@ -228,14 +228,14 @@ bottom: -20px; left: 0; width: 100%; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox-x.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox-x.png'); background-position: 0px -20px; } #fancybox-bg-sw { bottom: -20px; left: -20px; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox.png'); background-position: -40px -142px; } @@ -243,13 +243,13 @@ top: 0; left: -20px; height: 100%; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox-y.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox-y.png'); } #fancybox-bg-nw { top: -20px; left: -20px; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancybox.png'); background-position: -40px -122px; } @@ -282,7 +282,7 @@ #fancybox-title-over { padding: 10px; - background-image: url('%appswebroot%/apps/files_imageviewer/img/fancy_title_over.png'); + background-image: url('%appswebroot%/files_imageviewer/img/fancy_title_over.png'); display: block; } @@ -306,7 +306,7 @@ #fancybox-title-float-left { padding: 0 0 0 15px; - background: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png') -40px -90px no-repeat; + background: url('%appswebroot%/files_imageviewer/img/fancybox.png') -40px -90px no-repeat; } #fancybox-title-float-main { @@ -314,25 +314,25 @@ line-height: 29px; font-weight: bold; padding: 0 0 3px 0; - background: url('%appswebroot%/apps/files_imageviewer/img/fancybox-x.png') 0px -40px; + background: url('%appswebroot%/files_imageviewer/img/fancybox-x.png') 0px -40px; } #fancybox-title-float-right { padding: 0 0 0 15px; - background: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png') -55px -90px no-repeat; + background: url('%appswebroot%/files_imageviewer/img/fancybox.png') -55px -90px no-repeat; } /* IE6 */ -.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_close.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_close.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_nav_left.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_nav_right.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_nav_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_nav_right.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } -.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_title_left.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_title_main.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_title_right.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } +.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_title_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_title_main.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_title_right.png', sizingMethod='scale'); } .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { height: expression(this.parentNode.clientHeight + "px"); @@ -343,17 +343,17 @@ top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); } -#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_loading.png', sizingMethod='scale'); } +#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_loading.png', sizingMethod='scale'); } /* IE6, IE7, IE8 */ .fancybox-ie .fancybox-bg { background: transparent !important; } -.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_n.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_ne.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_e.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_se.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_s.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_sw.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_w.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_nw.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_shadow_n.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_shadow_ne.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_shadow_e.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_shadow_se.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_shadow_s.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_shadow_sw.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_shadow_w.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/files_imageviewer/img/fancy_shadow_nw.png', sizingMethod='scale'); } diff --git a/apps/files_pdfviewer/js/pdfjs/viewer.js b/apps/files_pdfviewer/js/pdfjs/viewer.js index 8a568e6a74..f49257d792 100644 --- a/apps/files_pdfviewer/js/pdfjs/viewer.js +++ b/apps/files_pdfviewer/js/pdfjs/viewer.js @@ -1871,70 +1871,4 @@ window.addEventListener('DOMMouseScroll', function(evt) { } }, false); -window.addEventListener('keydown', function keydown(evt) { - var handled = false; - var cmd = (evt.ctrlKey ? 1 : 0) | - (evt.altKey ? 2 : 0) | - (evt.shiftKey ? 4 : 0) | - (evt.metaKey ? 8 : 0); - // First, handle the key bindings that are independent whether an input - // control is selected or not. - if (cmd == 1 || cmd == 8) { // either CTRL or META key. - switch (evt.keyCode) { - case 61: // FF/Mac '=' - case 107: // FF '+' and '=' - case 187: // Chrome '+' - PDFView.zoomIn(); - handled = true; - break; - case 109: // FF '-' - case 189: // Chrome '-' - PDFView.zoomOut(); - handled = true; - break; - case 48: // '0' - PDFView.parseScale(kDefaultScale, true); - handled = true; - break; - } - } - - if (handled) { - evt.preventDefault(); - return; - } - - // Some shortcuts should not get handled if a control/input element - // is selected. - var curElement = document.activeElement; - if (curElement && curElement.tagName == 'INPUT') - return; - var controlsElement = document.getElementById('controls'); - while (curElement) { - if (curElement === controlsElement) - return; // ignoring if the 'controls' element is focused - curElement = curElement.parentNode; - } - - if (cmd == 0) { // no control key pressed at all. - switch (evt.keyCode) { - case 37: // left arrow - case 75: // 'k' - case 80: // 'p' - PDFView.page--; - handled = true; - break; - case 39: // right arrow - case 74: // 'j' - case 78: // 'n' - PDFView.page++; - handled = true; - break; - } - } - - if (handled) { - evt.preventDefault(); - } -}); diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index 1ab8c6a257..40a90a1530 100644 --- a/apps/files_sharing/get.php +++ b/apps/files_sharing/get.php @@ -77,7 +77,7 @@ if (isset($_GET['token']) && $source = OC_Share::getSource($_GET['token'])) { header("Content-Length: " . OC_Filesystem::filesize($source)); //download the file @ob_clean(); - OCP\Util::emitHook('OC_Share', 'public-download', array('source'=>$source, 'token'=>$token); + OCP\Util::emitHook('OC_Share', 'public-download', array('source'=>$source, 'token'=>$token)); OC_Filesystem::readfile($source); } } else { diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index 62c86ee18e..fed1b834fa 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -25,7 +25,7 @@ require_once( 'lib_share.php' ); /** * Convert target path to source path and pass the function call to the correct storage provider */ -class OC_Filestorage_Shared extends OC_Filestorage { +class OC_Filestorage_Shared extends OC_Filestorage_Common { private $datadir; private $sourcePaths = array(); @@ -492,7 +492,7 @@ class OC_Filestorage_Shared extends OC_Filestorage { return $this->searchInDir($query); } - private function searchInDir($query, $path = "") { + protected function searchInDir($query, $path = "") { $files = array(); if ($dh = $this->opendir($path)) { while (($filename = readdir($dh)) !== false) { diff --git a/apps/files_texteditor/css/DroidSansMono/stylesheet.css b/apps/files_texteditor/css/DroidSansMono/stylesheet.css index 5bf9122ed7..4d814b262d 100644 --- a/apps/files_texteditor/css/DroidSansMono/stylesheet.css +++ b/apps/files_texteditor/css/DroidSansMono/stylesheet.css @@ -4,11 +4,11 @@ @font-face { font-family: 'Droid Sans Mono'; - src: url('%appswebroot%/apps/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.eot'); - src: url('%appswebroot%/apps/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.eot?#iefix') format('embedded-opentype'), - url('%appswebroot%/apps/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.woff') format('woff'), - url('%appswebroot%/apps/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.ttf') format('truetype'), - url('%appswebroot%/apps/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.svg#DroidSansMonoRegular') format('svg'); + src: url('%appswebroot%/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.eot'); + src: url('%appswebroot%/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.eot?#iefix') format('embedded-opentype'), + url('%appswebroot%/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.woff') format('woff'), + url('%appswebroot%/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.ttf') format('truetype'), + url('%appswebroot%/files_texteditor/css/DroidSansMono/DroidSansMono-webfont.svg#DroidSansMonoRegular') format('svg'); font-weight: normal; font-style: normal; diff --git a/apps/files_texteditor/css/style.css b/apps/files_texteditor/css/style.css index d91a91d18d..82c57b88bb 100644 --- a/apps/files_texteditor/css/style.css +++ b/apps/files_texteditor/css/style.css @@ -1,16 +1,8 @@ #editor{ position: fixed; display: block; - top: 6.5em; - left: 12.5em; -} -#editorwrapper{ - position: absolute; - height: 0; - width: 0; - top: 41px; - left: 160px; - display: none; + top: 6.8em; + left: 13.5em; } #editor_save{ margin-left: 7px; diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js index 70bb74a910..9d168c1c4f 100644 --- a/apps/files_texteditor/js/editor.js +++ b/apps/files_texteditor/js/editor.js @@ -67,7 +67,7 @@ function setSyntaxMode(ext){ function showControls(filename,writeperms){ // Loads the control bar at the top. // Load the new toolbar. - var editorbarhtml = '