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
mahara
mahara
Commits
1bbe83a3
Commit
1bbe83a3
authored
Aug 14, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Aug 14, 2015
Browse files
Merge "Bug 1483964: Adjusting the confirm copy to use the new modal way"
parents
1915377f
919b1a52
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/js/viewmenu.js
View file @
1bbe83a3
...
...
@@ -94,38 +94,21 @@ jQuery(function($j) {
});
}
$j
(
"
.copyview
"
).
each
(
function
()
{
$j
(
this
).
click
(
function
(
e
)
{
if
(
e
.
target
.
href
.
match
(
/collection=
(
.*
)
/
))
{
e
.
preventDefault
();
// We need to let user choose from collection or view only
var
collection
=
e
.
target
.
href
.
match
(
/collection=
(
.*
)
/
)[
1
];
if
(
!
$j
(
'
#dialog-confirm
'
).
length
)
{
$j
(
'
body
'
).
append
(
'
<div id="dialog-confirm" title="
'
+
get_string
(
'
confirmcopytitle
'
)
+
'
">
'
+
get_string
(
'
confirmcopydesc
'
)
+
'
</div>
'
);
}
$j
(
'
#dialog-confirm
'
).
dialog
({
resizable
:
false
,
height
:
200
,
modal
:
true
,
buttons
:
[
{
text
:
get_string
(
'
View
'
),
click
:
function
()
{
// drop the collection bit from the url
var
url
=
e
.
target
.
href
.
replace
(
/collection=
(
.*
)
/
,
''
);
window
.
location
=
url
;
}
},
{
text
:
get_string
(
'
Collection
'
),
click
:
function
()
{
window
.
location
=
e
.
target
.
href
;
}
}
]
});
}
});
var
copyurl
=
$j
(
"
#copyview-button
"
).
attr
(
'
href
'
);
$j
(
"
#copyview-button
"
).
on
(
'
click
'
,
function
(
event
)
{
if
(
event
.
currentTarget
.
href
.
match
(
/collection=
(
.*
)
/
))
{
event
.
preventDefault
();
event
.
stopPropagation
();
$j
(
"
#copyview-form
"
).
modal
(
'
show
'
);
}
});
$j
(
"
#copy-view-button
"
).
on
(
'
click
'
,
function
()
{
// drop the collection bit from the url
var
url
=
copyurl
.
replace
(
/collection=
(
.*
)
/
,
''
);
window
.
location
=
url
;
});
$j
(
"
#copy-collection-button
"
).
on
(
'
click
'
,
function
()
{
window
.
location
=
copyurl
;
});
// Set up the onclick method for all comment reply buttons
...
...
htdocs/theme/raw/templates/view/view.tpl
View file @
1bbe83a3
...
...
@@ -28,7 +28,7 @@
{/
strip
}{/
if
}
{
if
$copyurl
}{
strip
}
<a
title=
"
{
str
tag
=
copythisview
section
=
view
}
"
href=
"
{
$copyurl
}
"
class=
"btn btn-default"
>
<a
id=
"copyview-button"
title=
"
{
str
tag
=
copythisview
section
=
view
}
"
href=
"
{
$copyurl
}
"
class=
"btn btn-default"
>
<span
class=
"text-success icon icon-files-o icon-lg prs"
></span>
{
str
tag
=
copy
section
=
mahara
}
</a>
...
...
@@ -165,6 +165,26 @@
</div>
</div>
{/
if
}
<div
class=
"modal fade"
id=
"copyview-form"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
>
<span
class=
"icon icon-lg icon-flag text-danger prs"
></span>
{
str
tag
=
confirmcopytitle
section
=
view
}
</h4>
</div>
<div
class=
"modal-body"
>
<p>
{
str
tag
=
confirmcopydesc
section
=
view
}
</p>
<div
class=
"btn-group"
>
<button
id=
"copy-collection-button"
type=
"button"
class=
"btn btn-default"
><span
class=
"icon icon-folder-open text-success"
></span>
{
str
tag
=
Collection
section
=
collection
}
</button>
<button
id=
"copy-view-button"
type=
"button"
class=
"btn btn-default"
><span
class=
"icon icon-file-text text-success"
></span>
{
str
tag
=
view
}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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