Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
680ec056
Commit
680ec056
authored
Mar 12, 2015
by
Robin McCorkell
Committed by
Vincent Petry
Mar 12, 2015
Browse files
Implement priority on client side in hidden input
parent
ce94a998
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/files_external/js/settings.js
View file @
680ec056
...
...
@@ -332,6 +332,13 @@ GlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
*/
applicableGroups
:
null
,
/**
* Storage priority
*
* @type int
*/
priority
:
null
,
/**
* Returns the data from this object
*
...
...
@@ -342,6 +349,7 @@ GlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
return
_
.
extend
(
data
,
{
applicableUsers
:
this
.
applicableUsers
,
applicableGroups
:
this
.
applicableGroups
,
priority
:
this
.
priority
,
});
}
});
...
...
@@ -546,6 +554,8 @@ MountConfigListView.prototype = {
highlightInput
(
newElement
);
$td
.
append
(
newElement
);
});
var
priorityEl
=
$
(
'
<input type="hidden" class="priority" value="
'
+
parameters
[
'
priority
'
]
+
'
" />
'
);
$tr
.
append
(
priorityEl
);
if
(
parameters
[
'
custom
'
]
&&
$el
.
find
(
'
tbody tr.
'
+
backendClass
.
replace
(
/
\\
/g
,
'
\\\\
'
)).
length
===
1
)
{
OC
.
addScript
(
'
files_external
'
,
parameters
[
'
custom
'
]);
}
...
...
@@ -627,6 +637,8 @@ MountConfigListView.prototype = {
storage
.
applicableUsers
=
users
;
storage
.
applicableGroups
=
groups
;
storage
.
priority
=
$tr
.
find
(
'
input.priority
'
).
val
();
}
return
storage
;
...
...
apps/files_external/templates/settings.php
View file @
680ec056
...
...
@@ -90,6 +90,9 @@
print_unescaped
(
json_encode
(
$mount
[
'applicable'
][
'users'
]));
?>
'
>
<input
type=
"hidden"
class=
"applicableUsers"
style=
"width:20em;"
value=
""
/>
</td>
<?php
if
(
isset
(
$mount
[
'priority'
]))
:
?>
<input
type=
"hidden"
class=
"priority"
value=
"
<?php
p
(
$mount
[
'priority'
])
?>
"
/>
<?php
endif
;
?>
<?php
endif
;
?>
<td
<?php
if
(
isset
(
$mount
[
'mountpoint'
]))
:
?>
class=
"remove"
<?php
else
:
?>
style=
"visibility:hidden;"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment