Skip to content

Commit

Permalink
Merge branch 'master' into editor
Browse files Browse the repository at this point in the history
	static/plugin_smarteditor_widget/smarteditor.coffee

Conflicts:
	static/plugin_smarteditor_widget/smarteditor.coffee
	static/plugin_smarteditor_widget/smarteditor.css
	static/plugin_smarteditor_widget/smarteditor_models.akamon.coffee
	static/plugin_smarteditor_widget/smarteditor_models.akamon.js
  • Loading branch information
root committed Jun 8, 2012
2 parents 7c5a6d1 + 4b731c6 commit bae6c3d
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 65 deletions.
12 changes: 8 additions & 4 deletions modules/plugin_managed_html.py
Expand Up @@ -285,9 +285,9 @@ def use_grid(self, args):
raise HTTP(200, self._history_grid(args=args))
_files = [
URL(APP, 'static', 'plugin_managed_html/managed_html.css'),
URL(APP, 'static', 'plugin_bootstrap2/bootstrap.min.css'),
# URL(APP, 'static', 'plugin_bootstrap2/bootstrap.min.css'),
URL(APP, 'static', 'plugin_bootstrap2/bootstrap.min.js'),
URL(APP, 'static', 'plugin_bootstrap2/bootstrap-responsive.min.css'),
# URL(APP, 'static', 'plugin_bootstrap2/bootstrap-responsive.min.css'),
URL(APP, 'static', 'plugin_managed_html/jquery.spinner.js'),
URL(APP, 'static', 'plugin_managed_html/aop.min.js'),
URL(APP, 'static', 'plugin_elrte_widget/js/jquery-ui-1.8.16.custom.min.js'),
Expand All @@ -296,7 +296,7 @@ def use_grid(self, args):
URL(APP, 'static', 'plugin_smarteditor_widget/underscore.js'),
URL(APP, 'static', 'plugin_smarteditor_widget/backbone.js'),
URL(APP, 'static', 'plugin_smarteditor_widget/backbone-forms.js'),
URL(APP, 'static', 'plugin_smarteditor_widget/backbone-forms.css'),
# URL(APP, 'static', 'plugin_smarteditor_widget/backbone-forms.css'),
URL(APP, 'static', 'plugin_smarteditor_widget/smarteditor.coffee'),
]
_files = _files+self.settings.smarteditor_plugins
Expand Down Expand Up @@ -764,7 +764,11 @@ def load_handlebars(self, this, **kwdargs):

def url_helper(self, this, **kwdargs):
if 'page' in kwdargs:
href = current.response.page_url(kwdargs['page'], kwdargs.get('tenant', None))
_arg0 = current.request.args(0)
if _arg0 and (EDIT_MODE in _arg0):
href = '{{url page="%s" tenant="%s"}}'%(kwdargs['page'], kwdargs['tenant'])
else:
href = current.response.page_url(kwdargs['page'], kwdargs.get('tenant', None))
else:
href = ""
current.response.write(XML(href).xml(), escape=False)
Expand Down
235 changes: 179 additions & 56 deletions static/plugin_smarteditor_widget/smarteditor.css
@@ -1,3 +1,4 @@
/* 要素のハイライト */
._current_editable {
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset, 0 0 15px rgba(236, 82, 82, 0.6);
}
Expand All @@ -10,11 +11,48 @@ div.span1, div.span2, div.span3, div.span4, div.span5, div.span6, div.span7, div
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset, 0 0 15px rgba(82, 82, 236, 0.6);
}

/* 編集パネル本体 */
.smarteditor-main-panel {
display: none;
position: absolute;
padding: 5px;
margin: 0;
vertical-align: middle;

.smarteditor-main-panel .buttons li {
display: inline;
list-style: none;
position: relative;
background-color: #339BB9;
//background-image: -moz-linear-gradient(center top , #5BC0DE, #339BB9);
background-image: -moz-linear-gradient(center top , #9BD0EE, #63b8e9);
background-repeat: repeat-x;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);

-moz-border-radius: 4px 4px 4px 4px;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
margin-bottom: 18px;
border-style: solid;
border-width: 1px;

z-index: 2000;

background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#5BC0DE), to(#339BB9));
background-image: -moz-linear-gradient(top, #5BC0DE, #339BB9);
background-image: -ms-linear-gradient(top, #5BC0DE, #339BB9);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5BC0DE), color-stop(100%, #339BB9));
background-image: -webkit-linear-gradient(top, #5BC0DE, #339BB9);
background-image: -o-linear-gradient(top, #5BC0DE, #339BB9);
background-image: linear-gradient(top, #5BC0DE, #339BB9);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #339BB9 #339BB9 #22697D;
border-width: 1px;
border-style: solid;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.smartedit .smartedit_buttons {
Expand All @@ -24,6 +62,7 @@ div.span1, div.span2, div.span3, div.span4, div.span5, div.span6, div.span7, div
width: 20em;
}


.smartedit .editing .edit,
.smartedit .revert,
.smartedit .update {
Expand All @@ -40,12 +79,25 @@ div.span1, div.span2, div.span3, div.span4, div.span5, div.span6, div.span7, div
float:left;
}


.smarteditor-main-panel ul {
margin: 0 10px;
padding: 0;
}

.smarteditor-main-panel .buttons li {
display: inline;
list-style: none;
position: relative;
}

.smarteditor-main-panel .ui-btn-closePanel {
margin-top:5px;
margin-right: 5px;
float:left;
}


/* パネル内フォーム(機能停止中) */
.smarteditor-main-panel label {
width: 25%;
line-height: 22px;
Expand Down Expand Up @@ -90,7 +142,6 @@ div.span1, div.span2, div.span3, div.span4, div.span5, div.span6, div.span7, div
margin: 0.4em 0 0 0;
}


.smarteditor-main-panel input,
.smarteditor-main-panel textarea,
.smarteditor-main-panel select,
Expand All @@ -101,56 +152,6 @@ div.span1, div.span2, div.span3, div.span4, div.span5, div.span6, div.span7, div
line-height: 18px;
}

.smarteditor-main-panel {
top:0;
left:0;
display: none;
position: absolute;
padding: 5px;
margin: 0;
vertical-align: middle;

background-color: #339BB9;
//background-image: -moz-linear-gradient(center top , #5BC0DE, #339BB9);
background-image: -moz-linear-gradient(center top , #9BD0EE, #63b8e9);
background-repeat: repeat-x;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);

-moz-border-radius: 4px 4px 4px 4px;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
margin-bottom: 18px;
border-style: solid;
border-width: 1px;

z-index: 2000;

background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#5BC0DE), to(#339BB9));
background-image: -moz-linear-gradient(top, #5BC0DE, #339BB9);
background-image: -ms-linear-gradient(top, #5BC0DE, #339BB9);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5BC0DE), color-stop(100%, #339BB9));
background-image: -webkit-linear-gradient(top, #5BC0DE, #339BB9);
background-image: -o-linear-gradient(top, #5BC0DE, #339BB9);
background-image: linear-gradient(top, #5BC0DE, #339BB9);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #339BB9 #339BB9 #22697D;
border-width: 1px;
border-style: solid;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.smarteditor-main-panel .ui-btn-closePanel {
margin-top:5px;
margin-right: 5px;
float:left;
}

/*********** ui ***********/
.smarteditor-main-panel .ui-icon {
Expand Down Expand Up @@ -345,3 +346,125 @@ border-color: #339BB9 #339BB9 #22697D;

.smarteditor-main-panel .ui-icon-toggleForm{background-position:-801px -5px}
.smarteditor-main-panel .ui-icon-deleteElement{background-position:-180px -2px}





.smarteditor-main-panel .dropdown-menu li {
line-height: 18px;
}

.smarteditor-main-panel .dropdown {
position: relative;
}

.smarteditor-main-panel .dropdown-toggle {
}

.smarteditor-main-panel .dropdown-toggle:active, .open .dropdown-toggle {
outline: 0 none;
}

.smarteditor-main-panel .caret {
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #000000;
content: "";
display: inline-block;
height: 0;
opacity: 0.3;
vertical-align: top;
width: 0;
}

.smarteditor-main-panel .dropdown .caret {
margin-left: 2px;
margin-top: 8px;
}

.smarteditor-main-panel .dropdown:hover .caret, .open.dropdown .caret {
opacity: 1;
}

.smarteditor-main-panel .dropdown-menu {
background-clip: padding-box;
background-color: #FFFFFF;
border-color: rgba(0, 0, 0, 0.2);
border-radius: 0 0 5px 5px;
border-style: solid;
border-width: 1px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
display: none;
float: left;
left: 0;
list-style: none outside none;
margin: 0;
min-width: 160px;
padding: 4px 0;
position: absolute;
top: 100%;
z-index: 1000;
}

.smarteditor-main-panel .dropdown-menu.pull-right {
left: auto;
right: 0;
}

.smarteditor-main-panel .dropdown-menu .divider {
background-color: #E5E5E5;
border-bottom: 1px solid #FFFFFF;
height: 1px;
margin: 8px 1px;
overflow: hidden;
}

.smarteditor-main-panel .dropdown-menu a {
clear: both;
color: #333333;
display: block;
font-weight: normal;
line-height: 18px;
padding: 3px 15px;
white-space: nowrap;
}

.smarteditor-main-panel .dropdown-menu li > a:hover,
.smarteditor-main-panel .dropdown-menu .active > a,
.smarteditor-main-panel .dropdown-menu .active > a:hover {
background-color: #0088CC;
color: #FFFFFF;
text-decoration: none;
}

.smarteditor-main-panel .dropdown.open {
}

.smarteditor-main-panel .dropdown.open .dropdown-toggle {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.3);
color: #FFFFFF;
}

.smarteditor-main-panel .dropdown.open .dropdown-menu {
display: block;
}

.smarteditor-main-panel .pull-right .dropdown-menu {
left: auto;
right: 0;
}

.smarteditor-main-panel .dropup .caret,
.smarteditor-main-panel .navbar-fixed-bottom .dropdown .caret {
border-bottom: 4px solid #000000;
border-top: 0 none;
content: "↑";
}

.smarteditor-main-panel .dropup .dropdown-menu,
.smarteditor-main-panel .navbar-fixed-bottom .dropdown .dropdown-menu {
bottom: 100%;
margin-bottom: 1px;
top: auto;
}
Expand Up @@ -153,7 +153,7 @@ class ManagedHTMLView extends SmartEditor.ElementView
if closest.length>0 && closest[0]==@el
smartEditor.setTargetElement(elm)
else
smartEditor.setTargetElement(@$el)
smartEditor.setTargetElement(@el)
@

html_editor: =>
Expand Down Expand Up @@ -207,6 +207,7 @@ class ManagedHTMLView extends SmartEditor.ElementView
@model.trigger 'updatedSchema'
$('#'+@el.form_id).remove()
@$el.addClass('managed_html_content_block_pending')
smartEditor.setTargetElement(@el)
dialog.remove()
dialog.show()
@
Expand Down Expand Up @@ -307,7 +308,7 @@ class ManagedHTMLView extends SmartEditor.ElementView
$('#'+el.form_id).remove()
#ヒストリバックは公開前の編集とみなす
self.$el.addClass('managed_html_content_block_pending')
smartEditor.setTargetElement(self.$el)
smartEditor.setTargetElement(self.el)
dialog.show()
@

Expand Down
7 changes: 4 additions & 3 deletions static/plugin_smarteditor_widget/smarteditor_models.akamon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bae6c3d

Please sign in to comment.