Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
xblock-drag-and-drop-v2
Commits
d31dce44
Commit
d31dce44
authored
Jan 18, 2016
by
Tim Krones
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #51 from open-craft/alignment-fix-and-cleanup
Ensure correct alignment of zone labels; remove IE9 shims
parents
5f9d73ac
ca47133e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2 additions
and
150 deletions
+2
-150
drag_and_drop_v2/drag_and_drop_v2.py
+0
-1
drag_and_drop_v2/public/css/drag_and_drop.css
+1
-12
drag_and_drop_v2/public/css/drag_and_drop_edit.css
+0
-11
drag_and_drop_v2/public/js/drag_and_drop_edit.js
+0
-16
drag_and_drop_v2/public/js/vendor/jquery.html5-placeholder-shim.js
+0
-109
drag_and_drop_v2/public/themes/apros.css
+1
-1
No files found.
drag_and_drop_v2/drag_and_drop_v2.py
View file @
d31dce44
...
@@ -198,7 +198,6 @@ class DragAndDropBlock(XBlock, XBlockWithSettingsMixin, ThemableXBlockMixin):
...
@@ -198,7 +198,6 @@ class DragAndDropBlock(XBlock, XBlockWithSettingsMixin, ThemableXBlockMixin):
)
)
js_urls
=
(
js_urls
=
(
'public/js/vendor/jquery-ui-1.10.4.custom.min.js'
,
'public/js/vendor/jquery-ui-1.10.4.custom.min.js'
,
'public/js/vendor/jquery.html5-placeholder-shim.js'
,
'public/js/vendor/handlebars-v1.1.2.js'
,
'public/js/vendor/handlebars-v1.1.2.js'
,
'public/js/drag_and_drop_edit.js'
,
'public/js/drag_and_drop_edit.js'
,
)
)
...
...
drag_and_drop_v2/public/css/drag_and_drop.css
View file @
d31dce44
...
@@ -242,7 +242,7 @@
...
@@ -242,7 +242,7 @@
border
:
2px
solid
#a5a5a5
;
border
:
2px
solid
#a5a5a5
;
}
}
.xblock--drag-and-drop
.zone
p
{
.xblock--drag-and-drop
.
drag-container
.target
.
zone
p
{
width
:
100%
;
width
:
100%
;
font-family
:
Arial
;
font-family
:
Arial
;
font-size
:
16px
;
font-size
:
16px
;
...
@@ -253,17 +253,6 @@
...
@@ -253,17 +253,6 @@
margin-bottom
:
auto
;
margin-bottom
:
auto
;
}
}
/*** IE9 alignment fix ***/
.lt-ie10
.xblock--drag-and-drop
.zone
{
display
:
table
;
}
.lt-ie10
.xblock--drag-and-drop
.zone
p
{
display
:
table-cell
;
vertical-align
:
middle
;
text-align
:
center
;
}
/*** FEEDBACK ***/
/*** FEEDBACK ***/
.xblock--drag-and-drop
.feedback
{
.xblock--drag-and-drop
.feedback
{
...
...
drag_and_drop_v2/public/css/drag_and_drop_edit.css
View file @
d31dce44
...
@@ -50,17 +50,6 @@
...
@@ -50,17 +50,6 @@
margin-bottom
:
auto
;
margin-bottom
:
auto
;
}
}
/*** IE9 alignment fix ***/
.lt-ie10
.xblock--drag-and-drop--editor
.zone
{
display
:
table
;
}
.lt-ie10
.xblock--drag-and-drop--editor
.zone
p
{
display
:
table-cell
;
vertical-align
:
middle
;
text-align
:
center
;
}
/** Builder **/
/** Builder **/
.xblock--drag-and-drop--editor
.hidden
{
.xblock--drag-and-drop--editor
.hidden
{
display
:
none
!important
;
display
:
none
!important
;
...
...
drag_and_drop_v2/public/js/drag_and_drop_edit.js
View file @
d31dce44
...
@@ -87,9 +87,6 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -87,9 +87,6 @@ function DragAndDropEditBlock(runtime, element, params) {
$fbkTab
.
addClass
(
'hidden'
);
$fbkTab
.
addClass
(
'hidden'
);
$zoneTab
.
removeClass
(
'hidden'
);
$zoneTab
.
removeClass
(
'hidden'
);
// Placeholder shim for IE9
$
.
placeholder
.
shim
();
$
(
this
).
one
(
'click'
,
function
(
e
)
{
$
(
this
).
one
(
'click'
,
function
(
e
)
{
// $zoneTab -> $itemTab
// $zoneTab -> $itemTab
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -104,9 +101,6 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -104,9 +101,6 @@ function DragAndDropEditBlock(runtime, element, params) {
$zoneTab
.
addClass
(
'hidden'
);
$zoneTab
.
addClass
(
'hidden'
);
$itemTab
.
removeClass
(
'hidden'
);
$itemTab
.
removeClass
(
'hidden'
);
// Placeholder shim for IE9
$
.
placeholder
.
shim
();
$
(
this
).
addClass
(
'hidden'
);
$
(
this
).
addClass
(
'hidden'
);
$
(
'.save-button'
,
element
).
parent
()
$
(
'.save-button'
,
element
).
parent
()
.
removeClass
(
'hidden'
)
.
removeClass
(
'hidden'
)
...
@@ -148,8 +142,6 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -148,8 +142,6 @@ function DragAndDropEditBlock(runtime, element, params) {
_fn
.
build
.
$el
.
targetImage
.
attr
(
'alt'
,
new_description
);
_fn
.
build
.
$el
.
targetImage
.
attr
(
'alt'
,
new_description
);
_fn
.
data
.
targetImgDescription
=
new_description
;
_fn
.
data
.
targetImgDescription
=
new_description
;
// Placeholder shim for IE9
$
.
placeholder
.
shim
();
})
})
.
on
(
'click'
,
'.display-labels-form input'
,
function
(
e
)
{
.
on
(
'click'
,
'.display-labels-form input'
,
function
(
e
)
{
_fn
.
data
.
displayLabels
=
$
(
'.display-labels-form input'
,
element
).
is
(
':checked'
);
_fn
.
data
.
displayLabels
=
$
(
'.display-labels-form input'
,
element
).
is
(
':checked'
);
...
@@ -211,8 +203,6 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -211,8 +203,6 @@ function DragAndDropEditBlock(runtime, element, params) {
// Add zone div to target
// Add zone div to target
_fn
.
build
.
form
.
zone
.
renderZonesPreview
();
_fn
.
build
.
form
.
zone
.
renderZonesPreview
();
// Placeholder shim for IE9
$
.
placeholder
.
shim
();
},
},
remove
:
function
(
e
)
{
remove
:
function
(
e
)
{
var
$el
=
$
(
e
.
currentTarget
).
closest
(
'.zone-row'
),
var
$el
=
$
(
e
.
currentTarget
).
closest
(
'.zone-row'
),
...
@@ -235,8 +225,6 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -235,8 +225,6 @@ function DragAndDropEditBlock(runtime, element, params) {
_fn
.
build
.
form
.
zone
.
formCount
--
;
_fn
.
build
.
form
.
zone
.
formCount
--
;
_fn
.
build
.
form
.
zone
.
disableDelete
();
_fn
.
build
.
form
.
zone
.
disableDelete
();
// Placeholder shim for IE9
$
.
placeholder
.
shim
();
},
},
enableDelete
:
function
()
{
enableDelete
:
function
()
{
if
(
_fn
.
build
.
form
.
zone
.
formCount
>
1
)
{
if
(
_fn
.
build
.
form
.
zone
.
formCount
>
1
)
{
...
@@ -362,8 +350,6 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -362,8 +350,6 @@ function DragAndDropEditBlock(runtime, element, params) {
$form
.
append
(
tpl
(
ctx
));
$form
.
append
(
tpl
(
ctx
));
_fn
.
build
.
form
.
item
.
enableDelete
();
_fn
.
build
.
form
.
item
.
enableDelete
();
// Placeholder shim for IE9
$
.
placeholder
.
shim
();
},
},
remove
:
function
(
e
)
{
remove
:
function
(
e
)
{
var
$el
=
$
(
e
.
currentTarget
).
closest
(
'.item'
);
var
$el
=
$
(
e
.
currentTarget
).
closest
(
'.item'
);
...
@@ -374,8 +360,6 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -374,8 +360,6 @@ function DragAndDropEditBlock(runtime, element, params) {
_fn
.
build
.
form
.
item
.
count
--
;
_fn
.
build
.
form
.
item
.
count
--
;
_fn
.
build
.
form
.
item
.
disableDelete
();
_fn
.
build
.
form
.
item
.
disableDelete
();
// Placeholder shim for IE9
$
.
placeholder
.
shim
();
},
},
enableDelete
:
function
()
{
enableDelete
:
function
()
{
if
(
_fn
.
build
.
form
.
item
.
count
>
1
)
{
if
(
_fn
.
build
.
form
.
item
.
count
>
1
)
{
...
...
drag_and_drop_v2/public/js/vendor/jquery.html5-placeholder-shim.js
deleted
100644 → 0
View file @
5f9d73ac
(
function
(
$
)
{
// @todo Document this.
$
.
extend
(
$
,{
placeholder
:
{
browser_supported
:
function
()
{
return
this
.
_supported
!==
undefined
?
this
.
_supported
:
(
this
.
_supported
=
!!
(
'placeholder'
in
$
(
'<input type="text">'
)[
0
])
);
},
shim
:
function
(
opts
)
{
var
config
=
{
color
:
'#888'
,
cls
:
'placeholder'
,
selector
:
'input[placeholder], textarea[placeholder]'
};
$
.
extend
(
config
,
opts
);
return
!
this
.
browser_supported
()
&&
$
(
config
.
selector
).
_placeholder_shim
(
config
);
}
}});
$
.
extend
(
$
.
fn
,{
_placeholder_shim
:
function
(
config
)
{
function
calcPositionCss
(
target
)
{
var
op
=
$
(
target
).
offsetParent
().
offset
();
var
ot
=
$
(
target
).
offset
();
return
{
top
:
ot
.
top
-
op
.
top
,
left
:
ot
.
left
-
op
.
left
,
width
:
$
(
target
).
width
()
};
}
function
adjustToResizing
(
label
)
{
var
$target
=
label
.
data
(
'target'
);
if
(
typeof
$target
!==
"undefined"
)
{
label
.
css
(
calcPositionCss
(
$target
));
$
(
window
).
one
(
"resize"
,
function
()
{
adjustToResizing
(
label
);
});
}
}
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
);
if
(
$this
.
is
(
':visible'
)
)
{
if
(
$this
.
data
(
'placeholder'
)
)
{
var
$ol
=
$this
.
data
(
'placeholder'
);
$ol
.
css
(
calcPositionCss
(
$this
));
return
true
;
}
var
possible_line_height
=
{};
if
(
!
$this
.
is
(
'textarea'
)
&&
$this
.
css
(
'height'
)
!=
'auto'
)
{
possible_line_height
=
{
lineHeight
:
$this
.
css
(
'height'
),
whiteSpace
:
'nowrap'
};
}
var
isBorderBox
=
(
$this
.
css
(
'box-sizing'
)
===
'border-box'
);
var
ol
=
$
(
'<label />'
)
.
text
(
$this
.
attr
(
'placeholder'
))
.
addClass
(
config
.
cls
)
.
css
(
$
.
extend
({
position
:
'absolute'
,
display
:
'inline'
,
'float'
:
'none'
,
overflow
:
'hidden'
,
textAlign
:
'left'
,
color
:
config
.
color
,
cursor
:
'text'
,
paddingTop
:
isBorderBox
?
'0'
:
$this
.
css
(
'padding-top'
),
paddingRight
:
$this
.
css
(
'padding-right'
),
paddingBottom
:
isBorderBox
?
'0'
:
$this
.
css
(
'padding-bottom'
),
paddingLeft
:
$this
.
css
(
'padding-left'
),
fontSize
:
$this
.
css
(
'font-size'
),
fontFamily
:
$this
.
css
(
'font-family'
),
fontStyle
:
$this
.
css
(
'font-style'
),
fontWeight
:
$this
.
css
(
'font-weight'
),
textTransform
:
$this
.
css
(
'text-transform'
),
backgroundColor
:
'transparent'
,
zIndex
:
99
},
possible_line_height
))
.
css
(
calcPositionCss
(
this
))
.
attr
(
'for'
,
this
.
id
)
.
data
(
'target'
,
$this
)
.
click
(
function
(){
if
(
!
$
(
this
).
data
(
'target'
).
is
(
':disabled'
))
{
$
(
this
).
data
(
'target'
).
focus
();
}
})
.
insertBefore
(
this
);
$this
.
data
(
'placeholder'
,
ol
)
.
keydown
(
function
(){
ol
.
hide
();
})
.
blur
(
function
()
{
ol
[
$this
.
val
().
length
?
'hide'
:
'show'
]();
}).
triggerHandler
(
'blur'
);
$
(
window
).
one
(
"resize"
,
function
()
{
adjustToResizing
(
ol
);
});
}
});
}
});
})(
jQuery
);
jQuery
(
document
).
add
(
window
).
bind
(
'ready load'
,
function
()
{
if
(
jQuery
.
placeholder
)
{
jQuery
.
placeholder
.
shim
();
}
});
drag_and_drop_v2/public/themes/apros.css
View file @
d31dce44
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
background-color
:
#fff
;
background-color
:
#fff
;
}
}
.themed-xblock.xblock--drag-and-drop
.zone
p
{
.themed-xblock.xblock--drag-and-drop
.
drag-container
.target
.
zone
p
{
font-family
:
Arial
;
font-family
:
Arial
;
font-size
:
16px
;
font-size
:
16px
;
font-weight
:
bold
;
font-weight
:
bold
;
...
...
Write
Preview
Markdown
is supported
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