Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/apps.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/reader
diff options
context:
space:
mode:
authorpriyanka-m <priyanka.menghani@gmail.com>2012-11-21 12:18:32 +0400
committerpriyanka-m <priyanka.menghani@gmail.com>2012-11-21 12:18:32 +0400
commitbafead52d709e03fc3d65d0c2d1ea4704c6ae5f4 (patch)
treebdd33fc5813a158ae4226d6fb5603a9c25145b6f /reader
parentc648a4d481ca7ed58f70232ed6bd042541104f39 (diff)
Added feature for searching of eBooks among uploaded ones
Diffstat (limited to 'reader')
-rw-r--r--reader/ajax/canvas_saver.php2
-rwxr-xr-xreader/appinfo/app.php5
-rw-r--r--reader/css/reader.css9
-rwxr-xr-xreader/index.php1
-rwxr-xr-xreader/js/integrate.js2
-rw-r--r--reader/lib/thumbnail.php3
-rwxr-xr-xreader/templates/index.php12
7 files changed, 21 insertions, 13 deletions
diff --git a/reader/ajax/canvas_saver.php b/reader/ajax/canvas_saver.php
index 78fa5b5ac..6c8f9e217 100644
--- a/reader/ajax/canvas_saver.php
+++ b/reader/ajax/canvas_saver.php
@@ -11,7 +11,7 @@
$save_dir = OCP\Config::getSystemValue("datadirectory").'/'. $owner .'/reader';
$save_dir .= $location;
$thumb_file = $save_dir . $title;
- if (!is_dir($save_dir)) {
+ if (!is_dir($save_dir)) {
mkdir($save_dir, 0777, true);
}
$image = new OC_Image($filteredData);
diff --git a/reader/appinfo/app.php b/reader/appinfo/app.php
index 506cd34e6..fd55a8755 100755
--- a/reader/appinfo/app.php
+++ b/reader/appinfo/app.php
@@ -1,4 +1,6 @@
<?php
+OC::$CLASSPATH['OC_ReaderSearchProvider'] = 'apps/reader/lib/search.php';
+
OCP\App::register(array(
'order' => 20,
'id' => 'reader',
@@ -10,5 +12,8 @@ OCP\App::addNavigationEntry( array(
'href' => OCP\Util::linkTo('reader', 'index.php'),
'icon' => OCP\Util::imagePath( 'reader', 'reader.png' ),
'name'=>'Reader'));
+
+OC_Search::registerProvider('OC_ReaderSearchProvider');
+?>
diff --git a/reader/css/reader.css b/reader/css/reader.css
index 8edfbd55a..69a08285f 100644
--- a/reader/css/reader.css
+++ b/reader/css/reader.css
@@ -1,12 +1,13 @@
-div#controls{z-index:1000;}
-
+div#controls{z-index:60;}
div.crumb { float:left; display:block; background:no-repeat right 0; padding:.75em 1.5em 0 1em; height:2.9em;}
div.crumb:first-child { padding-left:1em; }
div.crumb.last { font-weight:bold; }
-table { white-space:normal; position:absolute; top:40px; left:5px;font-family:Arial;}
+table#readerContent { white-space:normal; position:absolute; top:40px; left:5px;font-family:Arial;}
-tbody tr { background:white; float:left; height:150px;font-size:12px;}
+table { position:relative; top:7px; width:100%;}
+tbody tr { background-color:#fff; height:2.5em;}
+tbody#fileList tr { background:white; float:left; height:150px;font-size:12px;}
tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#ffffff; }
.thumbnail:not([data-loaded]) { background-color: white; }
diff --git a/reader/index.php b/reader/index.php
index 4fa3801ab..b8358433c 100755
--- a/reader/index.php
+++ b/reader/index.php
@@ -21,4 +21,5 @@ $dir = empty($_GET['dir'])?'/':$_GET['dir'];
$tmpl = new OCP\Template( 'reader', 'index', 'user' );
$tmpl->assign('dir', $dir);
$tmpl->printPage();
+
?>
diff --git a/reader/js/integrate.js b/reader/js/integrate.js
index aac47d8ba..79dec7ef6 100755
--- a/reader/js/integrate.js
+++ b/reader/js/integrate.js
@@ -58,7 +58,7 @@ function getAction(mime,type) {
}
else {
name = function (filename){
- window.location=OC.linkTo('reader', 'index.php') + '?dir='+
+ window.location=OC.linkTo('reader', 'index.php') + '&dir='+
encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+
encodeURIComponent(filename) + '/';
}
diff --git a/reader/lib/thumbnail.php b/reader/lib/thumbnail.php
index 04dafaa06..3b3cd946d 100644
--- a/reader/lib/thumbnail.php
+++ b/reader/lib/thumbnail.php
@@ -25,7 +25,8 @@
$path = OCP\Config::getSystemValue("datadirectory").'/'. $owner .'/reader';
$path .= $current_dir.$dir;
if (!is_dir($path)) {
- return false;
+ mkdir($path, 0777, true);
+ return true;
}
else
return true;
diff --git a/reader/templates/index.php b/reader/templates/index.php
index c4b9a0738..e17a0e1bb 100755
--- a/reader/templates/index.php
+++ b/reader/templates/index.php
@@ -2,7 +2,6 @@
<META HTTP-EQUIV="Expires" CONTENT="-1">
<script type="text/javascript">
// Specify the main script used to create a new PDF.JS web worker.
- // In production, change this to point to the combined `pdf.js` file.
PDFJS.workerSrc = 'apps/reader/js/pdf.js';
</script>
@@ -12,7 +11,7 @@
include('apps/reader/lib/thumbnail.php');
// Get the current directory.
$current_dir = empty($_['dir'])?'/':$_['dir'];
- $base_url = OCP\Util::linkTo('reader', 'index.php').'?dir=';
+ $base_url = OCP\Util::linkTo('reader', 'index.php').'&dir=';
$curr_path = '';
$path = explode( '/', trim($current_dir,'/'));
@@ -52,7 +51,7 @@
}
?>
-<table>
+<table id = "readerContent">
<tbody id = "fileList">
<?php
@@ -104,7 +103,7 @@
<!-- Display folder name-->
<tr id = "row" data-file="<?php echo $r[0];?>" data-type="dir">
<td class = "filename svg">
- <a class = "dirs" id = "<?php echo $r[0];?>" href = "<?php echo OCP\Util::linkTo('reader', 'index.php').'?dir='.$current_dir.$r[0].'/';?>">
+ <a class = "dirs" id = "<?php echo $r[0];?>" href = "<?php echo OCP\Util::linkTo('reader', 'index.php').'&dir='.$current_dir.$r[0].'/';?>">
<center>
<span class = "nametext">
<?php echo htmlspecialchars($r[0]);?>
@@ -120,7 +119,8 @@
$img = 1;
// Display thumbnails of 3 pdf pages to show a folder.
foreach ($r[1] as $thumbs) {
- echo '<img id = "img'.$img.'" src = "'.\OCP\Util::linkTo('reader', 'ajax/thumbnail.php').'&filepath='.urlencode($current_dir.$r[0].'/'.rtrim($thumbs,'pdf').'png').'" style = "position:absolute; top:20px; left:10px; margin-left:'.$margin.'px; z-index:'.(100-$margin).';">';
+ $path1 = \OCP\Util::linkTo('reader', 'ajax/thumbnail.php').'&filepath='.urlencode($current_dir.$r[0].'/'.rtrim($thumbs,'pdf').'png');
+ echo '<img id = "img'.$img.'" src = "'.$path1.'" style = "position:absolute; top:20px; left:10px; margin-left:'.$margin.'px; z-index:'.(50-$margin).';">';
$margin = $margin + 5;
$img = $img + 1;
}
@@ -131,7 +131,7 @@
</td>
</tr><?php
}
- ?>
+ ?>
</tbody>
</table>