Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2015-08-12 18:48:26 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
8d72883dcb83e64a263bcfbedf883c6e6c2eb663
8d72883d
1 parent
9f95cbcb
Started react implementation
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
89 additions
and
25 deletions
.gitignore
app/Http/routes.php
config/app.php
gulpfile.js
resources/assets/js/image-manager.js
resources/assets/sass/image-manager.scss
resources/views/base.blade.php
resources/views/home.blade.php
.gitignore
View file @
8d72883
...
...
@@ -6,5 +6,6 @@ Homestead.yaml
.idea
/public/plugins
/public/css
/public/js/all*
/public/bower
/storage/images
\ No newline at end of file
...
...
app/Http/routes.php
View file @
8d72883
...
...
@@ -78,7 +78,10 @@ Route::group(['middleware' => 'auth'], function() {
Route
::
get
(
'/pages/search/all'
,
'PageController@searchAll'
);
Route
::
get
(
'/'
,
function
()
{
return
view
(
'base'
);
return
view
(
'home'
);
});
Route
::
get
(
'/home'
,
function
()
{
return
view
(
'home'
);
});
...
...
config/app.php
View file @
8d72883
...
...
@@ -78,7 +78,7 @@ return [
|
*/
'key'
=>
env
(
'APP_KEY'
,
'
SomeRandomString
'
),
'key'
=>
env
(
'APP_KEY'
,
'
AbAZchsay4uBTU33RubBzLKw203yqSqr
'
),
'cipher'
=>
'AES-256-CBC'
,
...
...
gulpfile.js
View file @
8d72883
var
elixir
=
require
(
'laravel-elixir'
);
//require('laravel-elixir-livereload');
/*
|--------------------------------------------------------------------------
...
...
@@ -13,5 +12,6 @@ var elixir = require('laravel-elixir');
*/
elixir
(
function
(
mix
)
{
mix
.
sass
(
'styles.scss'
);
//.livereload();
mix
.
sass
(
'styles.scss'
);
mix
.
babel
(
'image-manager.js'
);
});
...
...
resources/assets/js/image-manager.js
0 → 100644
View file @
8d72883
class
ImageList
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
images
:
[],
hasMore
:
false
,
page
:
0
};
}
componentDidMount
()
{
$
.
getJSON
(
'/images/all'
,
data
=>
{
this
.
setState
({
images
:
data
.
images
,
hasMore
:
data
.
hasMore
});
});
}
loadMore
()
{
this
.
state
.
page
++
;
$
.
getJSON
(
'/images/all/'
+
this
.
state
.
page
,
data
=>
{
this
.
setState
({
images
:
this
.
state
.
images
.
concat
(
data
.
images
),
hasMore
:
data
.
hasMore
});
});
}
render
()
{
var
images
=
this
.
state
.
images
.
map
(
function
(
image
)
{
return
(
<
div
key
=
{
image
.
id
}
>
<
img
src
=
{
image
.
thumbnail
}
/
>
<
/div
>
);
});
return
(
<
div
className
=
"image-list"
>
{
images
}
<
div
className
=
"load-more"
onClick
=
{
this
.
loadMore
}
>
Load
More
<
/div
>
<
/div
>
);
}
}
class
ImageManager
extends
React
.
Component
{
render
()
{
return
(
<
div
id
=
"image-manager"
>
<
ImageList
/>
<
/div
>
);
}
}
React
.
render
(
<
ImageManager
/>
,
document
.
getElementById
(
'container'
)
);
\ No newline at end of file
resources/assets/sass/image-manager.scss
View file @
8d72883
...
...
@@ -9,7 +9,7 @@
border-radius
:
4px
;
box-shadow
:
0
0
15px
0
rgba
(
0
,
0
,
0
,
0
.3
);
overflow
:
hidden
;
.image-
manager-display
img
{
.image-
list
img
{
border-radius
:
0
;
float
:
left
;
margin
:
1px
;
...
...
@@ -36,34 +36,23 @@
pointer-events
:
none
;
}
}
.image-manager-left
{
background-color
:
#FFF
;
.image-manager-display-wrap
{
height
:
100%
;
padding-top
:
87px
;
position
:
absolute
;
top
:
0
;
width
:
100%
;
}
.image-manager-display
{
height
:
100%
;
width
:
100%
;
text-align
:
left
;
position
:
relative
;
.image-manager-display-wrap
{
height
:
100%
;
padding-top
:
87px
;
position
:
absolute
;
top
:
0
;
width
:
100%
;
}
.image-manager-display
{
height
:
100%
;
width
:
100%
;
text-align
:
left
;
overflow-y
:
scroll
;
}
.image-manager-header
{
z-index
:
50
;
position
:
relative
;
}
overflow-y
:
scroll
;
}
#image-manager
.load-more
{
width
:
150px
;
height
:
150px
;
display
:
none
;
display
:
block
;
float
:
left
;
text-align
:
center
;
background-color
:
#888
;
...
...
resources/views/base.blade.php
View file @
8d72883
...
...
@@ -10,6 +10,7 @@
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"
></script>
<script
src=
"/bower/bootstrap/dist/js/bootstrap.js"
></script>
<script
src=
"/bower/jquery-sortable/source/js/jquery-sortable.js"
></script>
<script
src=
"https://fb.me/react-0.13.3.js"
></script>
<script>
$
.
fn
.
smoothScrollTo
=
function
()
{
if
(
this
.
length
===
0
)
return
;
...
...
@@ -62,5 +63,7 @@
</section>
@yield('bottom')
<script
src=
"/js/all.js"
></script>
</body>
</html>
...
...
resources/views/home.blade.php
0 → 100644
View file @
8d72883
@extends('base')
@section('content')
<div
id=
"container"
></div>
@stop
\ No newline at end of file
Please
register
or
sign in
to post a comment