Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
88e338ec
Commit
88e338ec
authored
13 years ago
by
Michael Gapczynski
Browse files
Options
Downloads
Patches
Plain Diff
Only show can edit (if not checked) and unshare button on hover
parent
7c840e9b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/files_sharing/css/sharing.css
+2
-2
2 additions, 2 deletions
apps/files_sharing/css/sharing.css
apps/files_sharing/js/share.js
+30
-8
30 additions, 8 deletions
apps/files_sharing/js/share.js
with
32 additions
and
10 deletions
apps/files_sharing/css/sharing.css
+
2
−
2
View file @
88e338ec
...
...
@@ -2,7 +2,7 @@
-moz-box-shadow
:
0
1px
1px
#777
;
-webkit-box-shadow
:
0
1px
1px
#777
;
box-shadow
:
0
1px
1px
#777
;
-moz-border-radius-bottomleft
:
1em
;
-webkit-border-bottom-left-radius
:
1em
;
border-bottom-left-radius
:
1em
;
-moz-border-radius-bottomright
:
1em
;
-webkit-border-bottom-right-radius
:
1em
;
border-bottom-right-radius
:
1em
;
}
#shared_list
>
ul
{
list-style-type
:
none
;
}
#public
{
border-top
:
1px
solid
#ddd
;
margin-top
:
1em
;
padding-top
:
0.5em
;
}
#shared_list
{
padding
:
0.5em
;
list-style-type
:
none
;
}
#public
{
border-top
:
1px
solid
#ddd
;
padding-top
:
0.5em
;
}
a
.unshare
{
float
:
right
;
display
:
inline
;
margin
:
0
.5em
;
padding
:
.3em
.3em
0
.3em
!important
;
}
a
.unshare
:hover
{
background
:
#fff
;
-moz-box-shadow
:
0
0
10px
#fff
;
-webkit-box-shadow
:
0
0
10px
#fff
;
box-shadow
:
0
0
10px
#fff
;
-moz-border-radius
:
10px
;
-webkit-border-radius
:
10px
;
border-radius
:
10px
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
apps/files_sharing/js/share.js
+
30
−
8
View file @
88e338ec
...
...
@@ -37,12 +37,32 @@ $(document).ready(function() {
type
:
'
POST
'
,
url
:
OC
.
linkTo
(
'
files_sharing
'
,
'
ajax/share.php
'
),
cache
:
false
,
data
:
data
data
:
data
,
success
:
function
()
{
$
(
'
#uid_shared_with option[value="
'
+
uid_shared_with
+
'
"]
'
).
remove
();
$
(
'
#uid_shared_with
'
).
trigger
(
'
liszt:updated
'
);
var
list
=
"
<li data-uid_shared_with='
"
+
uid_shared_with
+
"
'>
"
;
list
+=
uid_shared_with
;
list
+=
"
<input type='checkbox' name='permissions' class='permissions' style='display:none;' /><label>can edit</label>
"
;
list
+=
"
<a href='' title='Unshare' class='unshare' data-uid_shared_with='
"
+
uid_shared_with
+
"
' style='display:none;'><img class='svg' src='
"
+
OC
.
imagePath
(
'
core
'
,
'
actions/delete
'
)
+
"
'/></a>
"
;
list
+=
"
</li>
"
;
$
(
list
).
prependTo
(
'
#shared_list
'
);
}
});
});
$
(
'
#shared_list > li
'
).
live
(
'
mouseenter
'
,
function
(
event
)
{
$
(
'
:hidden
'
,
this
).
show
();
});
$
(
'
#shared_list > li
'
).
live
(
'
mouseleave
'
,
function
(
event
)
{
$
(
'
a
'
,
this
).
hide
();
if
(
!
$
(
'
input:[type=checkbox]
'
,
this
).
is
(
'
:checked
'
))
{
$
(
'
input:[type=checkbox]
'
,
this
).
hide
();
$
(
'
label
'
,
this
).
hide
();
}
});
$
(
'
.permissions
'
).
live
(
'
change
'
,
function
()
{
var
permissions
;
if
(
$
(
this
)
.
checked
)
{
if
(
this
.
checked
)
{
permissions
=
1
;
}
else
{
permissions
=
0
;
...
...
@@ -118,13 +138,13 @@ function createShareDropdown(filenames, files) {
html
+=
"
<select data-placeholder='User or Group' style='width:220px;' id='uid_shared_with' class='chzen-select'>
"
;
html
+=
"
<option value=''></option>
"
;
html
+=
"
</select>
"
;
html
+=
"
<
div
id='shared_list'></
div
>
"
;
html
+=
"
<
ul
id='shared_list'></
ul
>
"
;
html
+=
"
</div>
"
;
html
+=
"
<div id='public'>
"
;
html
+=
"
<input type='checkbox' name='makelink' id='makelink' value='1' /><label for='makelink'>make public</label>
"
;
html
+=
"
<input type='checkbox' name='public_link_write' id='public_link_write' value='1' /><label for='public_link_write'>allow upload</label>
"
;
html
+=
"
<br />
"
;
html
+=
"
<input id='link' style='display:none;width:
10
0%' />
"
;
html
+=
"
<input id='link' style='display:none;
width:
9
0%
;
' />
"
;
html
+=
"
</div>
"
;
$
(
'
tr[data-file="
'
+
filenames
+
'
"]
'
).
addClass
(
'
mouseOver
'
);
$
(
html
).
appendTo
(
$
(
'
tr[data-file="
'
+
filenames
+
'
"] td.filename
'
));
...
...
@@ -138,7 +158,7 @@ function createShareDropdown(filenames, files) {
});
$
.
getJSON
(
OC
.
linkTo
(
'
files_sharing
'
,
'
ajax/getitem.php
'
),
{
source
:
files
},
function
(
users
)
{
if
(
users
)
{
var
list
=
"
<ul>
"
;
var
list
;
$
.
each
(
users
,
function
(
index
,
row
)
{
$
(
'
#uid_shared_with option[value="
'
+
row
.
uid_shared_with
+
'
"]
'
).
remove
();
if
(
typeof
(
index
)
==
'
string
'
)
{
...
...
@@ -148,16 +168,18 @@ function createShareDropdown(filenames, files) {
list
+=
"
<li data-uid_shared_with='
"
+
row
.
uid_shared_with
+
"
'>
"
;
list
+=
row
.
uid_shared_with
;
var
checked
;
var
style
;
if
(
row
.
permissions
>
0
)
{
checked
=
"
checked='checked'
"
;
}
else
{
style
=
"
style='display:none;'
"
;
}
list
+=
"
<input type='checkbox' name='permissions' id='
"
+
index
+
"
' class='permissions'
"
+
checked
+
"
/><label for='
"
+
index
+
"
'>can edit</label>
"
;
list
+=
"
<a href='' title='Unshare' class='unshare' data-uid_shared_with='
"
+
row
.
uid_shared_with
+
"
'><img class='svg' src='
"
+
OC
.
imagePath
(
'
core
'
,
'
actions/delete
'
)
+
"
'/></a>
"
;
list
+=
"
<input type='checkbox' name='permissions' id='
"
+
index
+
"
' class='permissions'
"
+
checked
+
"
"
+
style
+
"
/><label for='
"
+
index
+
"
'
"
+
style
+
"
>can edit</label>
"
;
list
+=
"
<a href='' title='Unshare' class='unshare' data-uid_shared_with='
"
+
row
.
uid_shared_with
+
"
'
style='display:none;'
><img class='svg' src='
"
+
OC
.
imagePath
(
'
core
'
,
'
actions/delete
'
)
+
"
'/></a>
"
;
list
+=
"
</li>
"
;
}
});
list
+=
"
</ul>
"
;
$
(
list
).
appendTo
(
'
#shared_list
'
);
$
(
'
#uid_shared_with
'
).
trigger
(
'
liszt:updated
'
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment