diff --git a/admin/css/ie7.css b/admin/css/ie7.css index aaf3eef74..555b52021 100644 --- a/admin/css/ie7.css +++ b/admin/css/ie7.css @@ -20,6 +20,7 @@ html { overflow: hidden; } .jstree li a .ui-icon { text-indent: 0px !important; } +.cms table.ss-gridfield-table tbody td { width: auto; } .cms table.ss-gridfield-table tr th.extra span input { height: 23px; } .ss-gridfield-button-filter.ss-ui-button { margin: -1px -5px; background: #e6e6e6 url(../images/filter-icons.png) no-repeat -40px 6px; filter: none; } diff --git a/admin/css/screen.css b/admin/css/screen.css index 4a8c71756..613a35646 100644 --- a/admin/css/screen.css +++ b/admin/css/screen.css @@ -35,7 +35,7 @@ If more variables exist in the future, consider creating a variables file.*/ /** ---------------------------------------------------- Double tone borders http://daverupert.com/2011/06/two-tone-borders-with-css3/ ----------------------------------------------------- */ /** ----------------------------- Sprite images ----------------------------- */ /** Helper SCSS file for generating sprites for the interface. */ -.btn-icon-sprite, .ui-state-default .btn-icon-accept, .ui-state-default .btn-icon-accept_disabled, .ui-state-default .btn-icon-add, .ui-state-default .btn-icon-add_disabled, .ui-state-default .btn-icon-addpage, .ui-state-default .btn-icon-addpage_disabled, .ui-state-default .btn-icon-arrow-circle-135-left, .ui-state-default .btn-icon-back, .ui-state-default .btn-icon-back_disabled, .ui-state-default .btn-icon-chain--arrow, .ui-state-default .btn-icon-chain--exclamation, .ui-state-default .btn-icon-chain--minus, .ui-state-default .btn-icon-chain--pencil, .ui-state-default .btn-icon-chain--plus, .ui-state-default .btn-icon-chain-small, .ui-state-default .btn-icon-chain-unchain, .ui-state-default .btn-icon-chain, .ui-state-default .btn-icon-cross-circle, .ui-state-default .btn-icon-cross-circle_disabled, .ui-state-default .btn-icon-decline, .ui-state-default .btn-icon-decline_disabled, .ui-state-default .btn-icon-download-csv, .ui-state-default .btn-icon-drive-upload, .ui-state-default .btn-icon-drive-upload_disabled, .ui-state-default .btn-icon-magnifier, .ui-state-default .btn-icon-minus-circle, .ui-state-default .btn-icon-minus-circle_disabled, .ui-state-default .btn-icon-navigation, .ui-state-default .btn-icon-navigation_disabled, .ui-state-default .btn-icon-network-cloud, .ui-state-default .btn-icon-network-cloud_disabled, .ui-state-default .btn-icon-pencil, .ui-state-default .btn-icon-pencil_disabled, .ui-state-default .btn-icon-plug-disconnect-prohibition, .ui-state-default .btn-icon-plug-disconnect-prohibition_disabled, .ui-state-default .btn-icon-preview, .ui-state-default .btn-icon-preview_disabled, .ui-state-default .btn-icon-settings, .ui-state-default .btn-icon-settings_disabled, .ui-state-default .btn-icon-unpublish, .ui-state-default .btn-icon-unpublish_disabled { background: url('../images/btn-icon-sb5d07676ff.png') no-repeat; } +.btn-icon-sprite, .ui-state-default .btn-icon-accept, .ui-state-default .btn-icon-accept_disabled, .ui-state-default .btn-icon-add, .ui-state-default .btn-icon-add_disabled, .ui-state-default .btn-icon-addpage, .ui-state-default .btn-icon-addpage_disabled, .ui-state-default .btn-icon-arrow-circle-135-left, .ui-state-default .btn-icon-back, .ui-state-default .btn-icon-back_disabled, .ui-state-default .btn-icon-chain--arrow, .ui-state-default .btn-icon-chain--exclamation, .ui-state-default .btn-icon-chain--minus, .ui-state-default .btn-icon-chain--pencil, .ui-state-default .btn-icon-chain--plus, .ui-state-default .btn-icon-chain-small, .ui-state-default .btn-icon-chain-unchain, .ui-state-default .btn-icon-chain, .ui-state-default .btn-icon-cross-circle, .ui-state-default .btn-icon-cross-circle_disabled, .ui-state-default .btn-icon-decline, .ui-state-default .btn-icon-decline_disabled, .ui-state-default .btn-icon-download-csv, .ui-state-default .btn-icon-drive-upload, .ui-state-default .btn-icon-drive-upload_disabled, .ui-state-default .btn-icon-magnifier, .ui-state-default .btn-icon-minus-circle, .ui-state-default .btn-icon-minus-circle_disabled, .ui-state-default .btn-icon-navigation, .ui-state-default .btn-icon-navigation_disabled, .ui-state-default .btn-icon-network-cloud, .ui-state-default .btn-icon-network-cloud_disabled, .ui-state-default .btn-icon-pencil, .ui-state-default .btn-icon-pencil_disabled, .ui-state-default .btn-icon-plug-disconnect-prohibition, .ui-state-default .btn-icon-plug-disconnect-prohibition_disabled, .ui-state-default .btn-icon-preview, .ui-state-default .btn-icon-preview_disabled, .ui-state-default .btn-icon-settings, .ui-state-default .btn-icon-settings_disabled, .ui-state-default .btn-icon-unpublish, .ui-state-default .btn-icon-unpublish_disabled { background: url('../images/btn-icon-sc495ceeeca.png') no-repeat; } .ui-state-default .btn-icon-accept { background-position: 0 0; } .ui-state-default .btn-icon-accept_disabled { background-position: 0 -17px; } @@ -45,39 +45,39 @@ If more variables exist in the future, consider creating a variables file.*/ .ui-state-default .btn-icon-addpage_disabled { background-position: 0 -88px; } .ui-state-default .btn-icon-arrow-circle-135-left { background-position: 0 -104px; } .ui-state-default .btn-icon-back { background-position: 0 -120px; } -.ui-state-default .btn-icon-back_disabled { background-position: 0 -135px; } -.ui-state-default .btn-icon-chain--arrow { background-position: 0 -150px; } -.ui-state-default .btn-icon-chain--exclamation { background-position: 0 -166px; } -.ui-state-default .btn-icon-chain--minus { background-position: 0 -182px; } -.ui-state-default .btn-icon-chain--pencil { background-position: 0 -198px; } -.ui-state-default .btn-icon-chain--plus { background-position: 0 -214px; } -.ui-state-default .btn-icon-chain-small { background-position: 0 -230px; } -.ui-state-default .btn-icon-chain-unchain { background-position: 0 -246px; } -.ui-state-default .btn-icon-chain { background-position: 0 -262px; } -.ui-state-default .btn-icon-cross-circle { background-position: 0 -278px; } -.ui-state-default .btn-icon-cross-circle_disabled { background-position: 0 -294px; } -.ui-state-default .btn-icon-decline { background-position: 0 -310px; } -.ui-state-default .btn-icon-decline_disabled { background-position: 0 -327px; } -.ui-state-default .btn-icon-download-csv { background-position: 0 -344px; } -.ui-state-default .btn-icon-drive-upload { background-position: 0 -362px; } -.ui-state-default .btn-icon-drive-upload_disabled { background-position: 0 -378px; } -.ui-state-default .btn-icon-magnifier { background-position: 0 -394px; } -.ui-state-default .btn-icon-minus-circle { background-position: 0 -410px; } -.ui-state-default .btn-icon-minus-circle_disabled { background-position: 0 -426px; } -.ui-state-default .btn-icon-navigation { background-position: 0 -442px; } -.ui-state-default .btn-icon-navigation_disabled { background-position: 0 -458px; } -.ui-state-default .btn-icon-network-cloud { background-position: 0 -474px; } -.ui-state-default .btn-icon-network-cloud_disabled { background-position: 0 -490px; } -.ui-state-default .btn-icon-pencil { background-position: 0 -506px; } -.ui-state-default .btn-icon-pencil_disabled { background-position: 0 -522px; } -.ui-state-default .btn-icon-plug-disconnect-prohibition { background-position: 0 -538px; } -.ui-state-default .btn-icon-plug-disconnect-prohibition_disabled { background-position: 0 -554px; } -.ui-state-default .btn-icon-preview { background-position: 0 -570px; } -.ui-state-default .btn-icon-preview_disabled { background-position: 0 -587px; } -.ui-state-default .btn-icon-settings { background-position: 0 -604px; } -.ui-state-default .btn-icon-settings_disabled { background-position: 0 -620px; } -.ui-state-default .btn-icon-unpublish { background-position: 0 -636px; } -.ui-state-default .btn-icon-unpublish_disabled { background-position: 0 -654px; } +.ui-state-default .btn-icon-back_disabled { background-position: 0 -136px; } +.ui-state-default .btn-icon-chain--arrow { background-position: 0 -151px; } +.ui-state-default .btn-icon-chain--exclamation { background-position: 0 -167px; } +.ui-state-default .btn-icon-chain--minus { background-position: 0 -183px; } +.ui-state-default .btn-icon-chain--pencil { background-position: 0 -199px; } +.ui-state-default .btn-icon-chain--plus { background-position: 0 -215px; } +.ui-state-default .btn-icon-chain-small { background-position: 0 -231px; } +.ui-state-default .btn-icon-chain-unchain { background-position: 0 -247px; } +.ui-state-default .btn-icon-chain { background-position: 0 -263px; } +.ui-state-default .btn-icon-cross-circle { background-position: 0 -279px; } +.ui-state-default .btn-icon-cross-circle_disabled { background-position: 0 -295px; } +.ui-state-default .btn-icon-decline { background-position: 0 -311px; } +.ui-state-default .btn-icon-decline_disabled { background-position: 0 -328px; } +.ui-state-default .btn-icon-download-csv { background-position: 0 -345px; } +.ui-state-default .btn-icon-drive-upload { background-position: 0 -363px; } +.ui-state-default .btn-icon-drive-upload_disabled { background-position: 0 -379px; } +.ui-state-default .btn-icon-magnifier { background-position: 0 -395px; } +.ui-state-default .btn-icon-minus-circle { background-position: 0 -411px; } +.ui-state-default .btn-icon-minus-circle_disabled { background-position: 0 -427px; } +.ui-state-default .btn-icon-navigation { background-position: 0 -443px; } +.ui-state-default .btn-icon-navigation_disabled { background-position: 0 -459px; } +.ui-state-default .btn-icon-network-cloud { background-position: 0 -475px; } +.ui-state-default .btn-icon-network-cloud_disabled { background-position: 0 -491px; } +.ui-state-default .btn-icon-pencil { background-position: 0 -507px; } +.ui-state-default .btn-icon-pencil_disabled { background-position: 0 -523px; } +.ui-state-default .btn-icon-plug-disconnect-prohibition { background-position: 0 -539px; } +.ui-state-default .btn-icon-plug-disconnect-prohibition_disabled { background-position: 0 -555px; } +.ui-state-default .btn-icon-preview { background-position: 0 -571px; } +.ui-state-default .btn-icon-preview_disabled { background-position: 0 -588px; } +.ui-state-default .btn-icon-settings { background-position: 0 -605px; } +.ui-state-default .btn-icon-settings_disabled { background-position: 0 -621px; } +.ui-state-default .btn-icon-unpublish { background-position: 0 -637px; } +.ui-state-default .btn-icon-unpublish_disabled { background-position: 0 -655px; } .icon { text-indent: -9999px; border: none; outline: none; } .icon.icon-24 { width: 24px; height: 24px; background: url('../images/menu-icons/24x24-s546fcae8fd.png'); } @@ -178,7 +178,7 @@ form.small .field input.text, form.small .field textarea, form.small .field sele .cms input.loading, .cms button.loading, .cms input.ui-state-default.loading, .cms .ui-widget-content input.ui-state-default.loading, .cms .ui-widget-header input.ui-state-default.loading { color: #525252; border-color: #d5d3d3; cursor: default; } .cms input.loading .ui-icon, .cms button.loading .ui-icon, .cms input.ui-state-default.loading .ui-icon, .cms .ui-widget-content input.ui-state-default.loading .ui-icon, .cms .ui-widget-header input.ui-state-default.loading .ui-icon { background: transparent url(../../images/network-save.gif) no-repeat 0 0; } .cms input.loading.ss-ui-action-constructive .ui-icon, .cms button.loading.ss-ui-action-constructive .ui-icon { background: transparent url(../../images/network-save-constructive.gif) no-repeat 0 0; } -.cms .ss-ui-button { font-weight: bold; text-decoration: none; line-height: 16px; color: #393939; border: 1px solid #c0c0c2; border-bottom: 1px solid #a6a6a9; cursor: pointer; text-shadow: white 0 1px 1px; background-color: #e6e6e6; background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5ZDlkOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #d9d9d9)); background: -webkit-linear-gradient(#ffffff, #d9d9d9); background: -moz-linear-gradient(#ffffff, #d9d9d9); background: -o-linear-gradient(#ffffff, #d9d9d9); background: -ms-linear-gradient(#ffffff, #d9d9d9); background: linear-gradient(#ffffff, #d9d9d9); /* constructive */ /* destructive */ } +.cms .ss-ui-button { margin-top: 0px; font-weight: bold; text-decoration: none; line-height: 16px; color: #393939; border: 1px solid #c0c0c2; border-bottom: 1px solid #a6a6a9; cursor: pointer; text-shadow: white 0 1px 1px; background-color: #e6e6e6; background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5ZDlkOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #d9d9d9)); background: -webkit-linear-gradient(#ffffff, #d9d9d9); background: -moz-linear-gradient(#ffffff, #d9d9d9); background: -o-linear-gradient(#ffffff, #d9d9d9); background: -ms-linear-gradient(#ffffff, #d9d9d9); background: linear-gradient(#ffffff, #d9d9d9); /* constructive */ /* destructive */ } .cms .ss-ui-button.buttonset { margin: 0 -1px; } .cms .ss-ui-button.ui-state-hover, .cms .ss-ui-button:hover { text-decoration: none; background-color: white; background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2U2ZTZlNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #e6e6e6)); background: -webkit-linear-gradient(#ffffff, #e6e6e6); background: -moz-linear-gradient(#ffffff, #e6e6e6); background: -o-linear-gradient(#ffffff, #e6e6e6); background: -ms-linear-gradient(#ffffff, #e6e6e6); background: linear-gradient(#ffffff, #e6e6e6); -moz-box-shadow: 0 0 5px #b3b3b3; -webkit-box-shadow: 0 0 5px #b3b3b3; -o-box-shadow: 0 0 5px #b3b3b3; box-shadow: 0 0 5px #b3b3b3; } .cms .ss-ui-button:active, .cms .ss-ui-button:focus, .cms .ss-ui-button.ui-state-active, .cms .ss-ui-button.ui-state-focus { border: 1px solid #b3b3b3; background-color: white; background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2U2ZTZlNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #e6e6e6)); background: -webkit-linear-gradient(#ffffff, #e6e6e6); background: -moz-linear-gradient(#ffffff, #e6e6e6); background: -o-linear-gradient(#ffffff, #e6e6e6); background: -ms-linear-gradient(#ffffff, #e6e6e6); background: linear-gradient(#ffffff, #e6e6e6); -moz-box-shadow: 0 0 5px #b3b3b3 inset; -webkit-box-shadow: 0 0 5px #b3b3b3 inset; -o-box-shadow: 0 0 5px #b3b3b3 inset; box-shadow: 0 0 5px #b3b3b3 inset; } @@ -256,13 +256,13 @@ body.cms { overflow: hidden; } .cms-content-header { padding: 0px 8px 8px; height: 32px; z-index: 60; background-image: url(../images/textures/cms_content_header.png); background-repeat: repeat; } .cms-content-header a { color: #1556b2; } .cms-content-header .backlink { float: left; margin-top: 7px; } -.cms-content-header .backlink span.btn-icon-back { height: 15px; } +.cms-content-header .backlink span.btn-icon-back { height: 16px; } .cms-content-header h2 { float: left; padding: 8px 8px 0 8px; font-size: 14px; line-height: 24px; font-weight: bold; text-shadow: #bfcad2 1px 1px 0; max-width: 400px; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; o-text-overflow: ellipsis; } .cms-content-header > div { width: 9999em; overflow: hidden; } .cms-content-header .cms-content-header-tabs { position: fixed; right: 40px; } -.cms-content-header .cms-content-header-tabs .ui-tabs-nav li a { font-weight: bold; line-height: 16px; padding: 12px 20px 11px; } +.cms-content-header .cms-content-header-tabs .ui-tabs-nav li a { font-weight: bold; line-height: 16px; padding: 12px 20px 12px; } .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-state-default, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-widget-content .ui-state-default, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-widget-header .ui-state-default { border-top: none; } -.cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-state-active, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-widget-content .ui-state-active, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-widget-header .ui-state-active { border-top: none; } +.cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-state-active, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-widget-content .ui-state-active, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-widget-header .ui-state-active { border-top: none; padding-bottom: 0px; } .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-corner-all, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-corner-top, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-corner-right, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-corner-tr { border-radius: 0; } .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-corner-all, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-corner-top, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-corner-left, .cms-content-header .cms-content-header-tabs .ui-tabs-nav .ui-corner-tl { border-radius: 0; } @@ -312,6 +312,9 @@ body.cms { overflow: hidden; } /** -------------------------------------------- "Add page" dialog -------------------------------------------- */ .cms-page-add-form-dialog { display: none; } +.cms-add-form .step-label .flyout { height: 17px; padding-top: 5px; } +.cms-add-form .step-label .title { padding-top: 5px; font-weight: bold; text-shadow: 1px 1px 0 white; } +.cms-add-form ul.SelectionGroup { padding-left: 28px; } .cms-add-form .parent-mode { padding: 8px; overflow: auto; } .cms-add-form #PageType li { float: none; width: 100%; padding: 9px 0 9px 15px; overflow: hidden; border-bottom-width: 2px; border-bottom: 2px groove rgba(255, 255, 255, 0.8); -webkit-border-image: url(../images/textures/bg_fieldset_elements_border.png) 2 stretch stretch; border-image: url(../images/textures/bg_fieldset_elements_border.png) 2 stretch stretch; } .cms-add-form #PageType li:last-child { border-bottom: none; } @@ -394,6 +397,12 @@ body.cms { overflow: hidden; } .cms-preview-header { background-color: #FFBE66; padding: 10px; font-weight: bold; } /** -------------------------------------------- Member Profile -------------------------------------------- */ +form.member-profile-form { padding: 0 16px 0 0; } +form.member-profile-form .ui-tabs-nav .ui-state-default, form.member-profile-form .ui-tabs-nav .ui-widget-content .ui-state-default, form.member-profile-form .ui-tabs-nav .ui-widget-header .ui-state-default { border-top: none; } +form.member-profile-form #Root_Permissions { clear: both; padding: 16px; } +form.member-profile-form #Root_Main { clear: both; padding: 16px; } +form.member-profile-form #Root_Main .cms-help-toggle { text-indent: -9999em; display: inline-block; width: 20px; background: url(../images/question.png) no-repeat 0px 0px; } +form.member-profile-form #FavouritePageID { margin-top: 8px; } form.member-profile-form #CsvFile .middleColumn { background: none !important; } form.member-profile-form .advanced h4 { margin-bottom: .5em; } form.member-profile-form .Actions { text-align: left; border: 0; } @@ -406,12 +415,15 @@ form.member-profile-form #Groups .middleColumn { margin-left: 0; width: 100%; } form.member-profile-form #Groups .middleColumn .TreeDropdownField { width: 90%; max-width: 90%; } form.member-profile-form #Permissions .optionset li { float: none; width: auto; } form.member-profile-form .ui-tabs-nav li { margin: 0 0 -1px 0; } -form.member-profile-form .ui-corner-all, form.member-profile-form .ui-corner-top, form.member-profile-form .ui-corner-right, form.member-profile-form .ui-corner-tr { border-radius: 0; } -form.member-profile-form .ui-corner-all, form.member-profile-form .ui-corner-top, form.member-profile-form .ui-corner-left, form.member-profile-form .ui-corner-tl { border-radius: 0; } +form.member-profile-form .ui-tabs-nav .ui-corner-all, form.member-profile-form .ui-tabs-nav .ui-corner-top, form.member-profile-form .ui-tabs-nav .ui-corner-right, form.member-profile-form .ui-tabs-nav .ui-corner-tr { border-radius: 0; } +form.member-profile-form .ui-tabs-nav .ui-corner-all, form.member-profile-form .ui-tabs-nav .ui-corner-top, form.member-profile-form .ui-tabs-nav .ui-corner-left, form.member-profile-form .ui-tabs-nav .ui-corner-tl { border-radius: 0; } .cms .cms-content { border-right: 1px solid rgba(201, 205, 206, 0.8); -moz-box-shadow: 3px 0 4px rgba(0, 0, 0, 0.15); -webkit-box-shadow: 3px 0 4px rgba(0, 0, 0, 0.15); -o-box-shadow: 3px 0 4px rgba(0, 0, 0, 0.15); box-shadow: 3px 0 4px rgba(0, 0, 0, 0.15); -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; -ms-border-radius: 0; -khtml-border-radius: 0; border-radius: 0; } -.cms .cms-content-fields { /* always show a y scroll bar as popups like TreeDropdowns can trigger longer pages and the extra scroll bar doesn't fire our sizing bar */ overflow-y: auto; overflow-x: auto; background: none; width: 100%; } -.cms .cms-content-fields .aligned-right-label { margin-left: 184px; padding: 8px 0; } +.cms .cms-content-fields { overflow-y: auto; overflow-x: auto; background: none; width: 100%; } +.cms .cms-content-fields #Root_Main .confirmedpassword { border-bottom: none; box-shadow: none; } +.cms .cms-content-fields #Root_Main .customFormat { max-width: 80px; } +.cms .cms-content-fields #Root_Main .cms-help-toggle { text-indent: -9999em; display: inline-block; width: 20px; background: url(../images/question.png) no-repeat 0px 0px; } +.cms .cms-content-fields #Root_Permissions ul.optionset li { float: none; } /** -------------------------------------------- "Settings" Form -------------------------------------------- */ #CanViewType .optionset li, #CanEditType .optionset li, #CanCreateTopLevelType .optionset li { float: none; width: auto; white-space: nowrap; } @@ -450,6 +462,8 @@ form.member-profile-form .ui-corner-all, form.member-profile-form .ui-corner-top .cms .ui-widget-overlay { background-color: #000; background-image: none; } +.cms .ui-dialog .ss-ui-dialog.ui-dialog-content { padding-top: 0px; } + .ui-dialog { background: url("../images/textures/bg_cms_main_content.png") repeat left top #f0f3f4; border: 3px solid #000 !important; border-radius: 8px; overflow: visible; padding: 0; } .ui-dialog .ui-dialog-titlebar.ui-widget-header { font-size: 14px; background-color: #92a5b2; padding: 4px 4px 4px 16px; border-bottom: 2px solid #8399a7; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2NlZDdkYyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzkyYTViMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ced7dc), color-stop(100%, #92a5b2)); background-image: -webkit-linear-gradient(#ced7dc, #92a5b2); background-image: -moz-linear-gradient(#ced7dc, #92a5b2); background-image: -o-linear-gradient(#ced7dc, #92a5b2); background-image: -ms-linear-gradient(#ced7dc, #92a5b2); background-image: linear-gradient(#ced7dc, #92a5b2); } .ui-dialog.loading { background-image: url(../images/spinner.gif); background-position: 50% 50%; background-repeat: no-repeat; } @@ -461,7 +475,7 @@ body.cms-dialog { overflow: auto; background: url("../images/textures/bg_cms_mai .cms-dialog-content .ss-tabset { z-index: 60; -moz-border-radius: none; -webkit-border-radius: none; -o-border-radius: none; -ms-border-radius: none; -khtml-border-radius: none; border-radius: none; } .cms-dialog-content .ss-tabset .tab { background: none; overflow-y: auto; } .cms-dialog-content .ss-tabset.ui-tabs { background: none; } -.cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav { padding: 8px 0 0 0; border: none; } +.cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav { border: none; padding: 0 40px 0 0; float: right; } .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav li { font-weight: bold; line-height: 16px; padding: 11px 12px 9px; border-bottom: 2px solid #B3B3B3; } .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: -1px; } .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav li:first-child { margin-left: 15px; } @@ -517,6 +531,9 @@ form.import-form ul li { margin-left: 20px; } form.import-form p { margin-bottom: 5px; } form.import-form label.left { width: 250px; } +/** -------------------------------------------- Page Edit Controller -------------------------------------------- */ +.cms-container .CMSMain.CMSPageEditController { margin-left: -1px; } + /** This file defines the jstree base styling (see http://jstree.com), as well as any customizations (see bottom of file). The styles are usually added through jstree.js on DOM load, but we need it earlier in order to correctly display the uninitialized tree. */ .cms .jstree ul, .TreeDropdownField .treedropdownfield-panel .jstree ul { display: block; margin: 0; padding: 0; background: none; list-style-type: none; } .cms .jstree li, .TreeDropdownField .treedropdownfield-panel .jstree li { display: block; margin: 0; padding: 0; list-style-type: none; display: block; min-height: 18px; line-height: 18px; white-space: nowrap; margin-left: 18px; min-width: 18px; } @@ -605,8 +622,8 @@ form.import-form label.left { width: 250px; } .tree-holder.jstree-apple li, .cms-tree.jstree-apple li { padding: 0px; clear: left; } .tree-holder.jstree-apple ins, .cms-tree.jstree-apple ins { background-color: transparent; background-image: url(../images/sitetree_ss_default_icons.png); } .tree-holder.jstree-apple li.jstree-checked > a, .tree-holder.jstree-apple li.jstree-checked > a:link, .cms-tree.jstree-apple li.jstree-checked > a, .cms-tree.jstree-apple li.jstree-checked > a:link { background-color: #efe999; } -.tree-holder.jstree-apple .jstree-closed > ins, .cms-tree.jstree-apple .jstree-closed > ins { background-position: 0 0; } -.tree-holder.jstree-apple .jstree-open > ins, .cms-tree.jstree-apple .jstree-open > ins { background-position: -20px 0; } +.tree-holder.jstree-apple .jstree-closed > ins, .cms-tree.jstree-apple .jstree-closed > ins { background-position: 0 0; cursor: pointer; } +.tree-holder.jstree-apple .jstree-open > ins, .cms-tree.jstree-apple .jstree-open > ins { background-position: -20px 0; cursor: pointer; } a .jstree-pageicon { display: block; float: left; width: 16px; height: 16px; margin-right: 4px; background-color: transparent; background-image: url(../images/sitetree_ss_pageclass_icons_default.png); background-repeat: no-repeat; } diff --git a/admin/images/btn-icon-sb5d07676ff.png b/admin/images/btn-icon-sb5d07676ff.png deleted file mode 100644 index 6e9b49a31..000000000 Binary files a/admin/images/btn-icon-sb5d07676ff.png and /dev/null differ diff --git a/admin/images/btn-icon-sc495ceeeca.png b/admin/images/btn-icon-sc495ceeeca.png new file mode 100644 index 000000000..7f27b0297 Binary files /dev/null and b/admin/images/btn-icon-sc495ceeeca.png differ diff --git a/admin/images/btn-icon/addpage.png b/admin/images/btn-icon/addpage.png index 3dae3ddcc..554433e84 100644 Binary files a/admin/images/btn-icon/addpage.png and b/admin/images/btn-icon/addpage.png differ diff --git a/admin/images/btn-icon/back.png b/admin/images/btn-icon/back.png old mode 100644 new mode 100755 index 019b175ca..e3f39762c Binary files a/admin/images/btn-icon/back.png and b/admin/images/btn-icon/back.png differ diff --git a/admin/images/question.png b/admin/images/question.png new file mode 100755 index 000000000..f51f15ba3 Binary files /dev/null and b/admin/images/question.png differ diff --git a/admin/javascript/LeftAndMain.js b/admin/javascript/LeftAndMain.js index 2fb797a6d..b8c77f4f0 100644 --- a/admin/javascript/LeftAndMain.js +++ b/admin/javascript/LeftAndMain.js @@ -18,6 +18,18 @@ jQuery.noConflict(); spinner.show(); }; + // apply an select element only when it is ready, ie. when it is rendered into a template + // with css applied and got a width value. + var applyChosen = function(el){ + if(el.outerWidth()){ + el.chosen().addClass("has-chzn"); + // Copy over title attribute if required + if(el.attr('title')) el.siblings('.chzn-container').attr('title', el.attr('title')); + } else { + setTimeout(function() {applyChosen(el);},500); + } + }; + $(window).bind('resize', positionLoadingSpinner).trigger('resize'); // global ajax error handlers @@ -456,8 +468,8 @@ jQuery.noConflict(); // Explicitly disable default placeholder if no custom one is defined if(!this.data('placeholder')) this.data('placeholder', ' '); - // Apply chosen - this.chosen().addClass("has-chzn"); + // Apply Chosen + applyChosen(this); this._super(); } diff --git a/admin/javascript/ModelAdmin.js b/admin/javascript/ModelAdmin.js index a5b8a9b37..306c584e1 100644 --- a/admin/javascript/ModelAdmin.js +++ b/admin/javascript/ModelAdmin.js @@ -4,6 +4,13 @@ (function($) { $.entwine('ss', function($){ + $('#cms-content-tools #Form_SearchForm').entwine({ + onsubmit: function(e) { + //We need to trigger handleStateChange() explicitly, otherwise handleStageChange() + //doesn't called if landing from another section of cms + this.trigger('beforeSubmit'); + } + }); /** * Class: .importSpec @@ -21,6 +28,5 @@ this._super(); } }); - }); })(jQuery); \ No newline at end of file diff --git a/admin/scss/_forms.scss b/admin/scss/_forms.scss index 641431145..520dd5292 100644 --- a/admin/scss/_forms.scss +++ b/admin/scss/_forms.scss @@ -275,7 +275,7 @@ form.small .field, .field.small { } .ss-ui-button { - + margin-top:0px; &.buttonset { margin: 0 -1px; // hack to avoid double borders } diff --git a/admin/scss/_style.scss b/admin/scss/_style.scss index dce375150..77c6f9a06 100644 --- a/admin/scss/_style.scss +++ b/admin/scss/_style.scss @@ -100,7 +100,7 @@ body.cms { float:left; margin-top:$grid-x - 1; span.btn-icon-back { - height:15px; + height:16px; } } @@ -129,7 +129,7 @@ body.cms { a { font-weight: bold; line-height: $grid-y * 2; - padding: ($grid-y * 2 - 4) ($grid-x * 2 + 4) $grid-y + 3; + padding: $grid-y*1.5 $grid-x*2.5 $grid-y*1.5; } } @@ -147,6 +147,7 @@ body.cms { border: { top:none; } + padding-bottom:0px; } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { border-radius:0; @@ -407,6 +408,20 @@ body.cms { } .cms-add-form { + .step-label { + .flyout { + height:17px; //centres number within the grey arrow + padding-top:5px; + } + .title { + padding-top:5px; //aligns label with point of arrow + font-weight:bold; //to match pagetype label + @include text-shadow(1px 1px 0 $color-text-shadow); + } + } + ul.SelectionGroup { + padding-left:28px; + } .parent-mode { padding: $grid-x; overflow: auto; @@ -822,7 +837,37 @@ body.cms { * -------------------------------------------- */ form.member-profile-form { - + padding: 0 $grid-x*2 0 0; + .ui-tabs-nav { + .ui-state-default, + .ui-widget-content .ui-state-default, + .ui-widget-header .ui-state-default { + border: { + top:none; + } + } + } + + #Root_Permissions { + clear:both; + padding: $grid-x*2; + } + + #Root_Main { + clear:both; + padding: $grid-x*2; + .cms-help-toggle { + text-indent: -9999em; + display: inline-block; + width: 20px; + background:url(../images/question.png) no-repeat 0px 0px; + } + } + + #FavouritePageID { + margin-top:$grid-y; + } + #CsvFile .middleColumn { background: none !important; } @@ -888,13 +933,13 @@ form.member-profile-form { li { margin:0 0 -1px 0; } - } - .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { - border-radius:0; - } + .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { + border-radius:0; + } - .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { - border-radius:0; + .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { + border-radius:0; + } } } @@ -907,17 +952,32 @@ form.member-profile-form { } .cms-content-fields { - /* always show a y scroll bar as popups like TreeDropdowns - can trigger longer pages and the extra scroll bar doesn't - fire our sizing bar */ + // always show a y scroll bar as popups like TreeDropdowns + // can trigger longer pages and the extra scroll bar doesn't fire our sizing bar overflow-y: auto; overflow-x: auto; background: none; width:100%; - .aligned-right-label { - margin-left:$grid-x*23; - padding:$grid-x 0; + #Root_Main { + .confirmedpassword { + border-bottom:none; + box-shadow:none; + } + .customFormat { + max-width:80px; + } + .cms-help-toggle { + text-indent: -9999em; + display: inline-block; + width: 20px; + background:url(../images/question.png) no-repeat 0px 0px; + } } + #Root_Permissions{ + ul.optionset li { + float:none; + } + } } } @@ -1092,6 +1152,10 @@ form.member-profile-form { background-image: none; } +.cms .ui-dialog .ss-ui-dialog.ui-dialog-content { + padding-top: 0px; //removes padding so that tabs are flush with header +} + // Elements with this class can either frame inline markup or an iframe, // most styles should be applied to .cms-dialog instead (which declares the content in the frame) .ui-dialog { @@ -1147,8 +1211,9 @@ body.cms-dialog { background: none; .ui-tabs-nav { - padding: $grid-x 0 0 0; border: none; + padding: 0 $grid-x*5 0 0; //allows for 40px gap to the right of tabs to match the tabs on main CMS + float: right; li { &.ui-tabs-selected { @@ -1391,5 +1456,14 @@ form.import-form { label.left { width: 250px; } + } +/** -------------------------------------------- + * Page Edit Controller + * -------------------------------------------- */ + +.cms-container .CMSMain.CMSPageEditController { + // Fix pixel gap between nav tree and main page header + margin-left:-1px; +} diff --git a/admin/scss/_tree.scss b/admin/scss/_tree.scss index a1214e79a..00b48c807 100644 --- a/admin/scss/_tree.scss +++ b/admin/scss/_tree.scss @@ -541,11 +541,13 @@ } & .jstree-closed > ins { - background-position:0 0; + background-position:0 0; + cursor:pointer; } & .jstree-open > ins { - background-position:-20px 0; + background-position:-20px 0; + cursor:pointer; } } diff --git a/admin/scss/ie7.scss b/admin/scss/ie7.scss index b25afb383..1f7e9b434 100644 --- a/admin/scss/ie7.scss +++ b/admin/scss/ie7.scss @@ -68,10 +68,16 @@ html { text-indent: 0px !important; } -//fix for filter and reset icons on datagrid - -.cms table.ss-gridfield-table tr th.extra span input { - height:23px; +.cms table.ss-gridfield-table { + tbody td { + // Overrule width: 100% setting to trigger "shrink fit" + // of button row, which IE7 doesn't support + width: auto; + } + tr th.extra span input { + //fix for filter and reset icons on datagrid + height:23px; + } } .ss-gridfield-button-filter.ss-ui-button { diff --git a/admin/templates/Includes/LeftAndMain_Menu.ss b/admin/templates/Includes/LeftAndMain_Menu.ss index 9e5abf2f1..45b5d6cb9 100644 --- a/admin/templates/Includes/LeftAndMain_Menu.ss +++ b/admin/templates/Includes/LeftAndMain_Menu.ss @@ -58,7 +58,7 @@ diff --git a/admin/thirdparty/chosen/.piston.yml b/admin/thirdparty/chosen/.piston.yml index 65c32c6f1..a9041863d 100644 --- a/admin/thirdparty/chosen/.piston.yml +++ b/admin/thirdparty/chosen/.piston.yml @@ -1,7 +1,7 @@ --- format: 1 handler: - commit: 880a30dcb49555996a875cf4474999a2341aa055 + commit: f584bc49d6de7cf68475c3e51baa4cf2008a130e branch: master lock: false repository_class: Piston::Git::Repository diff --git a/admin/thirdparty/chosen/VERSION b/admin/thirdparty/chosen/VERSION index c81aa44af..e3e180701 100644 --- a/admin/thirdparty/chosen/VERSION +++ b/admin/thirdparty/chosen/VERSION @@ -1 +1 @@ -0.9.7 +0.9.8 diff --git a/admin/thirdparty/chosen/chosen/chosen-sprite.png b/admin/thirdparty/chosen/chosen/chosen-sprite.png index 231fe9055..113dc9885 100644 Binary files a/admin/thirdparty/chosen/chosen/chosen-sprite.png and b/admin/thirdparty/chosen/chosen/chosen-sprite.png differ diff --git a/admin/thirdparty/chosen/chosen/chosen.css b/admin/thirdparty/chosen/chosen/chosen.css index a90506fd6..36abf3412 100644 --- a/admin/thirdparty/chosen/chosen/chosen.css +++ b/admin/thirdparty/chosen/chosen/chosen.css @@ -51,6 +51,9 @@ color: #444444; text-decoration: none; } +.chzn-container-single .chzn-default { + color: #999; +} .chzn-container-single .chzn-single span { margin-right: 26px; display: block; @@ -68,7 +71,7 @@ width: 12px; height: 13px; font-size: 1px; - background: url(chosen-sprite.png) right top no-repeat; + background: url('chosen-sprite.png') right top no-repeat; } .chzn-container-single .chzn-single abbr:hover { background-position: right -11px; @@ -206,7 +209,7 @@ width: 12px; height: 13px; font-size: 1px; - background: url(chosen-sprite.png) right top no-repeat; + background: url('chosen-sprite.png') right top no-repeat; } .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover { background-position: right -11px; diff --git a/admin/thirdparty/chosen/chosen/chosen.jquery.js b/admin/thirdparty/chosen/chosen/chosen.jquery.js index bb3c1ee4e..52959dfb3 100644 --- a/admin/thirdparty/chosen/chosen/chosen.jquery.js +++ b/admin/thirdparty/chosen/chosen/chosen.jquery.js @@ -1,5 +1,15 @@ -//based on version 0.9.7 and applied a very simple patch that fix percentaage width support on select tag -//the patch has been documented https://github.com/harvesthq/chosen/issues/300. +// Chosen, a Select Box Enhancer for jQuery and Protoype +// by Patrick Filler for Harvest, http://getharvest.com +// +// Version 0.9.8 +// Full source at https://github.com/harvesthq/chosen +// Copyright (c) 2011 Harvest http://getharvest.com + +// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md +// This file is generated by `cake build`, do not edit it by hand. + +// based on version 0.9.7, applied a very simple patch that fix percentaage width support on select tag +// the patch has been documented https://github.com/harvesthq/chosen/issues/300. (function() { var SelectParser; @@ -123,6 +133,7 @@ Copyright (c) 2011 by Harvest this.result_single_selected = null; this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false; this.disable_search_threshold = this.options.disable_search_threshold || 0; + this.search_contains = this.options.search_contains || false; this.choices = 0; return this.results_none_found = this.options.no_results_text || "No results match"; }; @@ -303,7 +314,7 @@ Copyright (c) 2011 by Harvest if (this.is_multiple) { container_div.html('
'); } else { - container_div.html('' + this.default_text + '
'); + container_div.html('' + this.default_text + '
'); } this.form_field_jq.hide().after(container_div); this.container = $('#' + this.container_id); @@ -411,7 +422,9 @@ Copyright (c) 2011 by Harvest var target_closelink; if (!this.is_disabled) { target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false; - if (evt && evt.type === "mousedown") evt.stopPropagation(); + if (evt && evt.type === "mousedown" && !this.results_showing) { + evt.stopPropagation(); + } if (!this.pending_destroy_click && !target_closelink) { if (!this.active_field) { if (this.is_multiple) this.search_field.val(""); @@ -498,7 +511,7 @@ Copyright (c) 2011 by Harvest if (data.selected && this.is_multiple) { this.choice_build(data); } else if (data.selected && !this.is_multiple) { - this.selected_item.find("span").text(data.text); + this.selected_item.removeClass("chzn-default").find("span").text(data.text); if (this.allow_single_deselect) this.single_deselect_control_build(); } } @@ -544,7 +557,8 @@ Copyright (c) 2011 by Harvest }; Chosen.prototype.results_show = function() { - var dd_top; + //patch applied: https://github.com/harvesthq/chosen/issues/300, add variable declaration dd_width + var dd_top, dd_width; if (!this.is_multiple) { this.selected_item.addClass("chzn-single-with-drop"); if (this.result_single_selected) { @@ -552,6 +566,8 @@ Copyright (c) 2011 by Harvest } } dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1; + //patch applied: https://github.com/harvesthq/chosen/issues/300, add variable assignment dd_width + dd_width = this.container.width() - get_side_border_padding(this.dropdown); this.dropdown.css({ "top": dd_top + "px", "left": 0 @@ -662,6 +678,7 @@ Copyright (c) 2011 by Harvest Chosen.prototype.results_reset = function(evt) { this.form_field.options[0].selected = true; this.selected_item.find("span").text(this.default_text); + if (!this.is_multiple) this.selected_item.addClass("chzn-default"); this.show_search_field_default(); $(evt.target).remove(); this.form_field_jq.trigger("change"); @@ -679,6 +696,7 @@ Copyright (c) 2011 by Harvest } else { this.search_results.find(".result-selected").removeClass("result-selected"); this.result_single_selected = high; + this.selected_item.removeClass("chzn-default"); } high.addClass("result-selected"); position = high_id.substr(high_id.lastIndexOf("_") + 1); @@ -726,11 +744,12 @@ Copyright (c) 2011 by Harvest }; Chosen.prototype.winnow_results = function() { - var found, option, part, parts, regex, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref; + var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref; this.no_results_clear(); results = 0; searchText = this.search_field.val() === this.default_text ? "" : $('
').text($.trim(this.search_field.val())).html(); - regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); + regexAnchor = this.search_contains ? "" : "^"; + regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); _ref = this.results_data; for (_i = 0, _len = _ref.length; _i < _len; _i++) { diff --git a/admin/thirdparty/chosen/chosen/chosen.jquery.min.js b/admin/thirdparty/chosen/chosen/chosen.jquery.min.js index 930fb9a50..9e4d23e70 100644 --- a/admin/thirdparty/chosen/chosen/chosen.jquery.min.js +++ b/admin/thirdparty/chosen/chosen/chosen.jquery.min.js @@ -1,10 +1,11 @@ // Chosen, a Select Box Enhancer for jQuery and Protoype // by Patrick Filler for Harvest, http://getharvest.com // -// Version 0.9.7 +// Version 0.9.8 // Full source at https://github.com/harvesthq/chosen // Copyright (c) 2011 Harvest http://getharvest.com // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md // This file is generated by `cake build`, do not edit it by hand. -((function(){var a;a=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return a.nodeName==="OPTGROUP"?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:a.label,children:0,disabled:a.disabled}),f=a.childNodes,g=[];for(d=0,e=f.length;d"+a.html+"")},a.prototype.results_update_field=function(){return this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.keyup_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale();switch(b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:a.preventDefault();if(this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.generate_field_id=function(){var a;return a=this.generate_random_id(),this.form_field.id=a,a},a.prototype.generate_random_char=function(){var a,b,c;return a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ",c=Math.floor(Math.random()*a.length),b=a.substring(c,c+1)},a}(),b.AbstractChosen=a}.call(this),function(){var a,b,c,d,e=Object.prototype.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=this,a=jQuery,a.fn.extend({chosen:function(c){return!a.browser.msie||a.browser.version!=="6.0"&&a.browser.version!=="7.0"?a(this).each(function(d){if(!a(this).hasClass("chzn-done"))return new b(this,c)}):this}}),b=function(b){function e(){e.__super__.constructor.apply(this,arguments)}return f(e,b),e.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},e.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},e.prototype.set_up_html=function(){var b,d,e,f;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/(:|\.)/g,"_"):this.generate_field_id(),this.container_id+="_chzn",this.f_width=this.form_field_jq.outerWidth(),this.default_text=this.form_field_jq.data("placeholder")?this.form_field_jq.data("placeholder"):this.default_text_default,b=a("
",{id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+this.f_width+"px;"}),this.is_multiple?b.html('
    '):b.html(''+this.default_text+'
      '),this.form_field_jq.hide().after(b),this.container=a("#"+this.container_id),this.container.addClass("chzn-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.find("div.chzn-drop").first(),d=this.container.height(),e=this.f_width-c(this.dropdown),this.dropdown.css({width:e+"px",top:d+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),f=e-c(this.search_container)-c(this.search_field),this.search_field.css({width:f+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},e.prototype.register_observers=function(){var a=this;return this.container.mousedown(function(b){return a.container_mousedown(b)}),this.container.mouseup(function(b){return a.container_mouseup(b)}),this.container.mouseenter(function(b){return a.mouse_enter(b)}),this.container.mouseleave(function(b){return a.mouse_leave(b)}),this.search_results.mouseup(function(b){return a.search_results_mouseup(b)}),this.search_results.mouseover(function(b){return a.search_results_mouseover(b)}),this.search_results.mouseout(function(b){return a.search_results_mouseout(b)}),this.form_field_jq.bind("liszt:updated",function(b){return a.results_update_field(b)}),this.search_field.blur(function(b){return a.input_blur(b)}),this.search_field.keyup(function(b){return a.keyup_checker(b)}),this.search_field.keydown(function(b){return a.keydown_checker(b)}),this.is_multiple?(this.search_choices.click(function(b){return a.choices_click(b)}),this.search_field.focus(function(b){return a.input_focus(b)})):this.container.click(function(a){return a.preventDefault()})},e.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},e.prototype.container_mousedown=function(b){var c;if(!this.is_disabled)return c=b!=null?a(b.target).hasClass("search-choice-close"):!1,b&&b.type==="mousedown"&&b.stopPropagation(),!this.pending_destroy_click&&!c?(this.active_field?!this.is_multiple&&b&&(a(b.target)[0]===this.selected_item[0]||a(b.target).parents("a.chzn-single").length)&&(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},e.prototype.container_mouseup=function(a){if(a.target.nodeName==="ABBR")return this.results_reset(a)},e.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},e.prototype.close_field=function(){return a(document).unbind("click",this.click_test_action),this.is_multiple||(this.selected_item.attr("tabindex",this.search_field.attr("tabindex")),this.search_field.attr("tabindex",-1)),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},e.prototype.activate_field=function(){return!this.is_multiple&&!this.active_field&&(this.search_field.attr("tabindex",this.selected_item.attr("tabindex")),this.selected_item.attr("tabindex",-1)),this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},e.prototype.test_active_click=function(b){return a(b.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},e.prototype.results_build=function(){var a,b,c,e,f;this.parsing=!0,this.results_data=d.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.find("span").text(this.default_text),this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),a="",f=this.results_data;for(c=0,e=f.length;c'+a("
      ").text(b.label).html()+"")},e.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight();if(b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(c'+b.html+''),d=a("#"+c).find("a").first(),d.click(function(a){return e.choice_destroy_link_click(a)})},e.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),this.is_disabled?b.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(a(b.target)))},e.prototype.choice_destroy=function(a){return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),this.result_deselect(a.attr("rel")),a.parents("li").first().remove()},e.prototype.results_reset=function(b){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.show_search_field_default(),a(b.target).remove(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},e.prototype.result_select=function(a){var b,c,d,e;if(this.result_highlight)return b=this.result_highlight,c=b.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(b):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=b),b.addClass("result-selected"),e=c.substr(c.lastIndexOf("_")+1),d=this.results_data[e],d.selected=!0,this.form_field.options[d.options_index].selected=!0,this.is_multiple?this.choice_build(d):(this.selected_item.find("span").first().text(d.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!a.metaKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.result_activate=function(a){return a.addClass("active-result")},e.prototype.result_deactivate=function(a){return a.removeClass("active-result")},e.prototype.result_deselect=function(b){var c,d;return d=this.results_data[b],d.selected=!1,this.form_field.options[d.options_index].selected=!1,c=a("#"+this.container_id+"_o_"+b),c.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('')},e.prototype.winnow_results=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;this.no_results_clear(),i=0,j=this.search_field.val()===this.default_text?"":a("
      ").text(a.trim(this.search_field.val())).html(),f=new RegExp("^"+j.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),m=new RegExp(j.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),r=this.results_data;for(n=0,p=r.length;n=0||c.html.indexOf("[")===0){e=c.html.replace(/\[|\]/g,"").split(" ");if(e.length)for(o=0,q=e.length;o"+c.html.substr(k+j.length),l=l.substr(0,k)+""+l.substr(k)):l=c.html,g.html(l),this.result_activate(g),c.group_array_index!=null&&a("#"+this.results_data[c.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&h===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(g))}}return i<1&&j.length?this.no_results(j):this.winnow_results_set_highlight()},e.prototype.winnow_results_clear=function(){var b,c,d,e,f;this.search_field.val(""),c=this.search_results.find("li"),f=[];for(d=0,e=c.length;d'+this.results_none_found+' ""'),c.find("span").first().html(b),this.search_results.append(c)},e.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},e.prototype.keydown_arrow=function(){var b,c;this.result_highlight?this.results_showing&&(c=this.result_highlight.nextAll("li.active-result").first(),c&&this.result_do_highlight(c)):(b=this.search_results.find("li.active-result").first(),b&&this.result_do_highlight(a(b)));if(!this.results_showing)return this.results_show()},e.prototype.keyup_arrow=function(){var a;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},e.prototype.keydown_backstroke=function(){return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(this.pending_backstroke=this.search_container.siblings("li.search-choice").last(),this.pending_backstroke.addClass("search-choice-focus"))},e.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},e.prototype.keydown_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale(),b!==8&&this.pending_backstroke&&this.clear_backstroke();switch(b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},e.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(i=0,j=g.length;i",{style:f}),c.text(this.search_field.val()),a("body").append(c),h=c.width()+25,c.remove(),h>this.f_width-10&&(h=this.f_width-10),this.search_field.css({width:h+"px"}),b=this.container.height(),this.dropdown.css({top:b+"px"})}},e.prototype.generate_random_id=function(){var b;b="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(a("#"+b).length>0)b+=this.generate_random_char();return b},e}(AbstractChosen),c=function(a){var b;return b=a.outerWidth()-a.width()},d.get_side_border_padding=c}.call(this) \ No newline at end of file +((function(){var a;a=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return a.nodeName==="OPTGROUP"?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:a.label,children:0,disabled:a.disabled}),f=a.childNodes,g=[];for(d=0,e=f.length;d"+a.html+"")},a.prototype.results_update_field=function(){return this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.keyup_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale();switch(b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:a.preventDefault();if(this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.generate_field_id=function(){var a;return a=this.generate_random_id(),this.form_field.id=a,a},a.prototype.generate_random_char=function(){var a,b,c;return a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ",c=Math.floor(Math.random()*a.length),b=a.substring(c,c+1)},a}(),b.AbstractChosen=a}.call(this),function(){var a,b,c,d,e=Object.prototype.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=this,a=jQuery,a.fn.extend({chosen:function(c){return!a.browser.msie||a.browser.version!=="6.0"&&a.browser.version!=="7.0"?a(this).each(function(d){if(!a(this).hasClass("chzn-done"))return new b(this,c)}):this}}),b=function(b){function e(){e.__super__.constructor.apply(this,arguments)}return f(e,b),e.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},e.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},e.prototype.set_up_html=function(){var b,d,e,f;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/(:|\.)/g,"_"):this.generate_field_id(),this.container_id+="_chzn",this.f_width=this.form_field_jq.outerWidth(),this.default_text=this.form_field_jq.data("placeholder")?this.form_field_jq.data("placeholder"):this.default_text_default,b=a("
      ",{id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+this.f_width+"px;"}),this.is_multiple?b.html('
        '):b.html(''+this.default_text+'
          '),this.form_field_jq.hide().after(b),this.container=a("#"+this.container_id),this.container.addClass("chzn-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.find("div.chzn-drop").first(),d=this.container.height(),e=this.f_width-c(this.dropdown),this.dropdown.css({width:e+"px",top:d+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),f=e-c(this.search_container)-c(this.search_field),this.search_field.css({width:f+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},e.prototype.register_observers=function(){var a=this;return this.container.mousedown(function(b){return a.container_mousedown(b)}),this.container.mouseup(function(b){return a.container_mouseup(b)}),this.container.mouseenter(function(b){return a.mouse_enter(b)}),this.container.mouseleave(function(b){return a.mouse_leave(b)}),this.search_results.mouseup(function(b){return a.search_results_mouseup(b)}),this.search_results.mouseover(function(b){return a.search_results_mouseover(b)}),this.search_results.mouseout(function(b){return a.search_results_mouseout(b)}),this.form_field_jq.bind("liszt:updated",function(b){return a.results_update_field(b)}),this.search_field.blur(function(b){return a.input_blur(b)}),this.search_field.keyup(function(b){return a.keyup_checker(b)}),this.search_field.keydown(function(b){return a.keydown_checker(b)}),this.is_multiple?(this.search_choices.click(function(b){return a.choices_click(b)}),this.search_field.focus(function(b){return a.input_focus(b)})):this.container.click(function(a){return a.preventDefault()})},e.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},e.prototype.container_mousedown=function(b){var c;if(!this.is_disabled)return c=b!=null?a(b.target).hasClass("search-choice-close"):!1,b&&b.type==="mousedown"&&!this.results_showing&&b.stopPropagation(),!this.pending_destroy_click&&!c?(this.active_field?!this.is_multiple&&b&&(a(b.target)[0]===this.selected_item[0]||a(b.target).parents("a.chzn-single").length)&&(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},e.prototype.container_mouseup=function(a){if(a.target.nodeName==="ABBR")return this.results_reset(a)},e.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},e.prototype.close_field=function(){return a(document).unbind("click",this.click_test_action),this.is_multiple||(this.selected_item.attr("tabindex",this.search_field.attr("tabindex")),this.search_field.attr("tabindex",-1)),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},e.prototype.activate_field=function(){return!this.is_multiple&&!this.active_field&&(this.search_field.attr("tabindex",this.selected_item.attr("tabindex")),this.selected_item.attr("tabindex",-1)),this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},e.prototype.test_active_click=function(b){return a(b.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},e.prototype.results_build=function(){var a,b,c,e,f;this.parsing=!0,this.results_data=d.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.find("span").text(this.default_text),this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),a="",f=this.results_data;for(c=0,e=f.length;c'+a("
          ").text(b.label).html()+"")},e.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight();if(b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(c'+b.html+''),d=a("#"+c).find("a").first(),d.click(function(a){return e.choice_destroy_link_click(a)})},e.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),this.is_disabled?b.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(a(b.target)))},e.prototype.choice_destroy=function(a){return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),this.result_deselect(a.attr("rel")),a.parents("li").first().remove()},e.prototype.results_reset=function(b){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),a(b.target).remove(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},e.prototype.result_select=function(a){var b,c,d,e;if(this.result_highlight)return b=this.result_highlight,c=b.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(b):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=b,this.selected_item.removeClass("chzn-default")),b.addClass("result-selected"),e=c.substr(c.lastIndexOf("_")+1),d=this.results_data[e],d.selected=!0,this.form_field.options[d.options_index].selected=!0,this.is_multiple?this.choice_build(d):(this.selected_item.find("span").first().text(d.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!a.metaKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.result_activate=function(a){return a.addClass("active-result")},e.prototype.result_deactivate=function(a){return a.removeClass("active-result")},e.prototype.result_deselect=function(b){var c,d;return d=this.results_data[b],d.selected=!1,this.form_field.options[d.options_index].selected=!1,c=a("#"+this.container_id+"_o_"+b),c.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('')},e.prototype.winnow_results=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;this.no_results_clear(),j=0,k=this.search_field.val()===this.default_text?"":a("
          ").text(a.trim(this.search_field.val())).html(),g=this.search_contains?"":"^",f=new RegExp(g+k.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),n=new RegExp(k.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),s=this.results_data;for(o=0,q=s.length;o=0||c.html.indexOf("[")===0){e=c.html.replace(/\[|\]/g,"").split(" ");if(e.length)for(p=0,r=e.length;p"+c.html.substr(l+k.length),m=m.substr(0,l)+""+m.substr(l)):m=c.html,h.html(m),this.result_activate(h),c.group_array_index!=null&&a("#"+this.results_data[c.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&i===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(h))}}return j<1&&k.length?this.no_results(k):this.winnow_results_set_highlight()},e.prototype.winnow_results_clear=function(){var b,c,d,e,f;this.search_field.val(""),c=this.search_results.find("li"),f=[];for(d=0,e=c.length;d'+this.results_none_found+' ""'),c.find("span").first().html(b),this.search_results.append(c)},e.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},e.prototype.keydown_arrow=function(){var b,c;this.result_highlight?this.results_showing&&(c=this.result_highlight.nextAll("li.active-result").first(),c&&this.result_do_highlight(c)):(b=this.search_results.find("li.active-result").first(),b&&this.result_do_highlight(a(b)));if(!this.results_showing)return this.results_show()},e.prototype.keyup_arrow=function(){var a;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},e.prototype.keydown_backstroke=function(){return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(this.pending_backstroke=this.search_container.siblings("li.search-choice").last(),this.pending_backstroke.addClass("search-choice-focus"))},e.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},e.prototype.keydown_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale(),b!==8&&this.pending_backstroke&&this.clear_backstroke();switch(b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},e.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(i=0,j=g.length;i",{style:f}),c.text(this.search_field.val()),a("body").append(c),h=c.width()+25,c.remove(),h>this.f_width-10&&(h=this.f_width-10),this.search_field.css({width:h+"px"}),b=this.container.height(),this.dropdown.css({top:b+"px"})}},e.prototype.generate_random_id=function(){var b;b="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(a("#"+b).length>0)b+=this.generate_random_char();return b},e}(AbstractChosen),c=function(a){var b;return b=a.outerWidth()-a.width()},d.get_side_border_padding=c}.call(this) + diff --git a/admin/thirdparty/chosen/chosen/chosen.proto.js b/admin/thirdparty/chosen/chosen/chosen.proto.js index e141a6924..0cbad475a 100644 --- a/admin/thirdparty/chosen/chosen/chosen.proto.js +++ b/admin/thirdparty/chosen/chosen/chosen.proto.js @@ -1,7 +1,7 @@ // Chosen, a Select Box Enhancer for jQuery and Protoype // by Patrick Filler for Harvest, http://getharvest.com // -// Version 0.9.7 +// Version 0.9.8 // Full source at https://github.com/harvesthq/chosen // Copyright (c) 2011 Harvest http://getharvest.com @@ -129,6 +129,7 @@ Copyright (c) 2011 by Harvest this.result_single_selected = null; this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false; this.disable_search_threshold = this.options.disable_search_threshold || 0; + this.search_contains = this.options.search_contains || false; this.choices = 0; return this.results_none_found = this.options.no_results_text || "No results match"; }; @@ -281,7 +282,7 @@ Copyright (c) 2011 by Harvest Chosen.prototype.set_default_values = function() { Chosen.__super__.set_default_values.call(this); - this.single_temp = new Template('#{default}
            '); + this.single_temp = new Template('#{default}
              '); this.multi_temp = new Template('
                '); this.choice_temp = new Template('
              • #{choice}
              • '); return this.no_results_temp = new Template('
              • ' + this.results_none_found + ' "#{terms}"
              • '); @@ -407,7 +408,7 @@ Copyright (c) 2011 by Harvest var target_closelink; if (!this.is_disabled) { target_closelink = evt != null ? evt.target.hasClassName("search-choice-close") : false; - if (evt && evt.type === "mousedown") evt.stop(); + if (evt && evt.type === "mousedown" && !this.results_showing) evt.stop(); if (!this.pending_destroy_click && !target_closelink) { if (!this.active_field) { if (this.is_multiple) this.search_field.clear(); @@ -493,7 +494,7 @@ Copyright (c) 2011 by Harvest if (data.selected && this.is_multiple) { this.choice_build(data); } else if (data.selected && !this.is_multiple) { - this.selected_item.down("span").update(data.html); + this.selected_item.removeClassName("chzn-default").down("span").update(data.html); if (this.allow_single_deselect) this.single_deselect_control_build(); } } @@ -659,6 +660,7 @@ Copyright (c) 2011 by Harvest Chosen.prototype.results_reset = function(evt) { this.form_field.options[0].selected = true; this.selected_item.down("span").update(this.default_text); + if (!this.is_multiple) this.selected_item.addClassName("chzn-default"); this.show_search_field_default(); evt.target.remove(); if (typeof Event.simulate === 'function') this.form_field.simulate("change"); @@ -674,6 +676,7 @@ Copyright (c) 2011 by Harvest this.result_deactivate(high); } else { this.search_results.descendants(".result-selected").invoke("removeClassName", "result-selected"); + this.selected_item.removeClassName("chzn-default"); this.result_single_selected = high; } high.addClassName("result-selected"); @@ -726,11 +729,12 @@ Copyright (c) 2011 by Harvest }; Chosen.prototype.winnow_results = function() { - var found, option, part, parts, regex, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref; + var found, option, part, parts, regex, regexAnchor, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref; this.no_results_clear(); results = 0; searchText = this.search_field.value === this.default_text ? "" : this.search_field.value.strip().escapeHTML(); - regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); + regexAnchor = this.search_contains ? "" : "^"; + regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); _ref = this.results_data; for (_i = 0, _len = _ref.length; _i < _len; _i++) { diff --git a/admin/thirdparty/chosen/chosen/chosen.proto.min.js b/admin/thirdparty/chosen/chosen/chosen.proto.min.js index 8e80774f1..0f8257239 100644 --- a/admin/thirdparty/chosen/chosen/chosen.proto.min.js +++ b/admin/thirdparty/chosen/chosen/chosen.proto.min.js @@ -1,10 +1,10 @@ // Chosen, a Select Box Enhancer for jQuery and Protoype // by Patrick Filler for Harvest, http://getharvest.com // -// Version 0.9.7 +// Version 0.9.8 // Full source at https://github.com/harvesthq/chosen // Copyright (c) 2011 Harvest http://getharvest.com // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md // This file is generated by `cake build`, do not edit it by hand. -((function(){var a;a=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return a.nodeName==="OPTGROUP"?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:a.label,children:0,disabled:a.disabled}),f=a.childNodes,g=[];for(d=0,e=f.length;d"+a.html+"")},a.prototype.results_update_field=function(){return this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.keyup_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale();switch(b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:a.preventDefault();if(this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.generate_field_id=function(){var a;return a=this.generate_random_id(),this.form_field.id=a,a},a.prototype.generate_random_char=function(){var a,b,c;return a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ",c=Math.floor(Math.random()*a.length),b=a.substring(c,c+1)},a}(),b.AbstractChosen=a}.call(this),function(){var a,b,c,d=Object.prototype.hasOwnProperty,e=function(a,b){function e(){this.constructor=a}for(var c in b)d.call(b,c)&&(a[c]=b[c]);return e.prototype=b.prototype,a.prototype=new e,a.__super__=b.prototype,a};c=this,a=function(a){function d(){d.__super__.constructor.apply(this,arguments)}return e(d,a),d.prototype.setup=function(){return this.is_rtl=this.form_field.hasClassName("chzn-rtl")},d.prototype.finish_setup=function(){return this.form_field.addClassName("chzn-done")},d.prototype.set_default_values=function(){return d.__super__.set_default_values.call(this),this.single_temp=new Template('#{default}
                  '),this.multi_temp=new Template('
                    '),this.choice_temp=new Template('
                  • #{choice}
                  • '),this.no_results_temp=new Template('
                  • '+this.results_none_found+' "#{terms}"
                  • ')},d.prototype.set_up_html=function(){var a,c,d,e,f;return this.container_id=this.form_field.identify().replace(/(:|\.)/g,"_")+"_chzn",this.f_width=this.form_field.getStyle("width")?parseInt(this.form_field.getStyle("width"),10):this.form_field.getWidth(),c={id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+this.f_width+"px"},this.default_text=this.form_field.readAttribute("data-placeholder")?this.form_field.readAttribute("data-placeholder"):this.default_text_default,a=this.is_multiple?(new Element("div",c)).update(this.multi_temp.evaluate({"default":this.default_text})):(new Element("div",c)).update(this.single_temp.evaluate({"default":this.default_text})),this.form_field.hide().insert({after:a}),this.container=$(this.container_id),this.container.addClassName("chzn-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.down("div.chzn-drop"),d=this.container.getHeight(),e=this.f_width-b(this.dropdown),this.dropdown.setStyle({width:e+"px",top:d+"px"}),this.search_field=this.container.down("input"),this.search_results=this.container.down("ul.chzn-results"),this.search_field_scale(),this.search_no_results=this.container.down("li.no-results"),this.is_multiple?(this.search_choices=this.container.down("ul.chzn-choices"),this.search_container=this.container.down("li.search-field")):(this.search_container=this.container.down("div.chzn-search"),this.selected_item=this.container.down(".chzn-single"),f=e-b(this.search_container)-b(this.search_field),this.search_field.setStyle({width:f+"px"})),this.results_build(),this.set_tab_index(),this.form_field.fire("liszt:ready",{chosen:this})},d.prototype.register_observers=function(){var a=this;return this.container.observe("mousedown",function(b){return a.container_mousedown(b)}),this.container.observe("mouseup",function(b){return a.container_mouseup(b)}),this.container.observe("mouseenter",function(b){return a.mouse_enter(b)}),this.container.observe("mouseleave",function(b){return a.mouse_leave(b)}),this.search_results.observe("mouseup",function(b){return a.search_results_mouseup(b)}),this.search_results.observe("mouseover",function(b){return a.search_results_mouseover(b)}),this.search_results.observe("mouseout",function(b){return a.search_results_mouseout(b)}),this.form_field.observe("liszt:updated",function(b){return a.results_update_field(b)}),this.search_field.observe("blur",function(b){return a.input_blur(b)}),this.search_field.observe("keyup",function(b){return a.keyup_checker(b)}),this.search_field.observe("keydown",function(b){return a.keydown_checker(b)}),this.is_multiple?(this.search_choices.observe("click",function(b){return a.choices_click(b)}),this.search_field.observe("focus",function(b){return a.input_focus(b)})):this.container.observe("click",function(a){return a.preventDefault()})},d.prototype.search_field_disabled=function(){this.is_disabled=this.form_field.disabled;if(this.is_disabled)return this.container.addClassName("chzn-disabled"),this.search_field.disabled=!0,this.is_multiple||this.selected_item.stopObserving("focus",this.activate_action),this.close_field();this.container.removeClassName("chzn-disabled"),this.search_field.disabled=!1;if(!this.is_multiple)return this.selected_item.observe("focus",this.activate_action)},d.prototype.container_mousedown=function(a){var b;if(!this.is_disabled)return b=a!=null?a.target.hasClassName("search-choice-close"):!1,a&&a.type==="mousedown"&&a.stop(),!this.pending_destroy_click&&!b?(this.active_field?!this.is_multiple&&a&&(a.target===this.selected_item||a.target.up("a.chzn-single"))&&this.results_toggle():(this.is_multiple&&this.search_field.clear(),document.observe("click",this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},d.prototype.container_mouseup=function(a){if(a.target.nodeName==="ABBR")return this.results_reset(a)},d.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClassName("chzn-container-active"))return this.close_field()},d.prototype.close_field=function(){return document.stopObserving("click",this.click_test_action),this.is_multiple||(this.selected_item.tabIndex=this.search_field.tabIndex,this.search_field.tabIndex=-1),this.active_field=!1,this.results_hide(),this.container.removeClassName("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},d.prototype.activate_field=function(){return!this.is_multiple&&!this.active_field&&(this.search_field.tabIndex=this.selected_item.tabIndex,this.selected_item.tabIndex=-1),this.container.addClassName("chzn-container-active"),this.active_field=!0,this.search_field.value=this.search_field.value,this.search_field.focus()},d.prototype.test_active_click=function(a){return a.target.up("#"+this.container_id)?this.active_field=!0:this.close_field()},d.prototype.results_build=function(){var a,b,d,e,f;this.parsing=!0,this.results_data=c.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.select("li.search-choice").invoke("remove"),this.choices=0):this.is_multiple||(this.selected_item.down("span").update(this.default_text),this.form_field.options.length<=this.disable_search_threshold?this.container.addClassName("chzn-container-single-nosearch"):this.container.removeClassName("chzn-container-single-nosearch")),a="",f=this.results_data;for(d=0,e=f.length;d'+a.label.escapeHTML()+"")},d.prototype.result_do_highlight=function(a){var b,c,d,e,f;this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClassName("highlighted"),d=parseInt(this.search_results.getStyle("maxHeight"),10),f=this.search_results.scrollTop,e=d+f,c=this.result_highlight.positionedOffset().top,b=c+this.result_highlight.getHeight();if(b>=e)return this.search_results.scrollTop=b-d>0?b-d:0;if(c0&&this.search_field.value.length<1&&this.results_hide(),this.result_deselect(a.readAttribute("rel")),a.up("li").remove()},d.prototype.results_reset=function(a){this.form_field.options[0].selected=!0,this.selected_item.down("span").update(this.default_text),this.show_search_field_default(),a.target.remove(),typeof Event.simulate=="function"&&this.form_field.simulate("change");if(this.active_field)return this.results_hide()},d.prototype.result_select=function(a){var b,c,d;if(this.result_highlight)return b=this.result_highlight,this.result_clear_highlight(),this.is_multiple?this.result_deactivate(b):(this.search_results.descendants(".result-selected").invoke("removeClassName","result-selected"),this.result_single_selected=b),b.addClassName("result-selected"),d=b.id.substr(b.id.lastIndexOf("_")+1),c=this.results_data[d],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.is_multiple?this.choice_build(c):(this.selected_item.down("span").update(c.html),this.allow_single_deselect&&this.single_deselect_control_build()),(!a.metaKey||!this.is_multiple)&&this.results_hide(),this.search_field.value="",typeof Event.simulate=="function"&&this.form_field.simulate("change"),this.search_field_scale()},d.prototype.result_activate=function(a){return a.addClassName("active-result")},d.prototype.result_deactivate=function(a){return a.removeClassName("active-result")},d.prototype.result_deselect=function(a){var b,c;return c=this.results_data[a],c.selected=!1,this.form_field.options[c.options_index].selected=!1,b=$(this.container_id+"_o_"+a),b.removeClassName("result-selected").addClassName("active-result").show(),this.result_clear_highlight(),this.winnow_results(),typeof Event.simulate=="function"&&this.form_field.simulate("change"),this.search_field_scale()},d.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&!this.selected_item.down("abbr"))return this.selected_item.down("span").insert({after:''})},d.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;this.no_results_clear(),g=0,h=this.search_field.value===this.default_text?"":this.search_field.value.strip().escapeHTML(),e=new RegExp("^"+h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),k=new RegExp(h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),p=this.results_data;for(l=0,n=p.length;l=0||b.html.indexOf("[")===0){d=b.html.replace(/\[|\]/g,"").split(" ");if(d.length)for(m=0,o=d.length;m"+b.html.substr(i+h.length),j=j.substr(0,i)+""+j.substr(i)):j=b.html,$(f).innerHTML!==j&&$(f).update(j),this.result_activate($(f)),b.group_array_index!=null&&$(this.results_data[b.group_array_index].dom_id).setStyle({display:"list-item"})):($(f)===this.result_highlight&&this.result_clear_highlight(),this.result_deactivate($(f)))}}return g<1&&h.length?this.no_results(h):this.winnow_results_set_highlight()},d.prototype.winnow_results_clear=function(){var a,b,c,d,e;this.search_field.clear(),b=this.search_results.select("li"),e=[];for(c=0,d=b.length;c0&&this.results_hide(),this.result_clear_highlight())},d.prototype.keydown_backstroke=function(){return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.down("a")),this.clear_backstroke()):(this.pending_backstroke=this.search_container.siblings("li.search-choice").last(),this.pending_backstroke.addClassName("search-choice-focus"))},d.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClassName("search-choice-focus"),this.pending_backstroke=null},d.prototype.keydown_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale(),b!==8&&this.pending_backstroke&&this.clear_backstroke();switch(b){case 8:this.backstroke_length=this.search_field.value.length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},d.prototype.search_field_scale=function(){var a,b,c,d,e,f,g,h,i;if(this.is_multiple){c=0,g=0,e="position:absolute; left: -1000px; top: -1000px; display:none;",f=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(h=0,i=f.length;hthis.f_width-10&&(g=this.f_width-10),this.search_field.setStyle({width:g+"px"}),a=this.container.getHeight(),this.dropdown.setStyle({top:a+"px"})}},d}(AbstractChosen),c.Chosen=a,Prototype.Browser.IE&&/MSIE (\d+\.\d+);/.test(navigator.userAgent)&&(Prototype.BrowserFeatures.Version=new Number(RegExp.$1)),b=function(a){var b,c;return b=new Element.Layout(a),c=b.get("border-left")+b.get("border-right")+b.get("padding-left")+b.get("padding-right")},c.get_side_border_padding=b}.call(this) \ No newline at end of file +((function(){var a;a=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return a.nodeName==="OPTGROUP"?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:a.label,children:0,disabled:a.disabled}),f=a.childNodes,g=[];for(d=0,e=f.length;d"+a.html+"")},a.prototype.results_update_field=function(){return this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.keyup_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale();switch(b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:a.preventDefault();if(this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.generate_field_id=function(){var a;return a=this.generate_random_id(),this.form_field.id=a,a},a.prototype.generate_random_char=function(){var a,b,c;return a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ",c=Math.floor(Math.random()*a.length),b=a.substring(c,c+1)},a}(),b.AbstractChosen=a}.call(this),function(){var a,b,c,d=Object.prototype.hasOwnProperty,e=function(a,b){function e(){this.constructor=a}for(var c in b)d.call(b,c)&&(a[c]=b[c]);return e.prototype=b.prototype,a.prototype=new e,a.__super__=b.prototype,a};c=this,a=function(a){function d(){d.__super__.constructor.apply(this,arguments)}return e(d,a),d.prototype.setup=function(){return this.is_rtl=this.form_field.hasClassName("chzn-rtl")},d.prototype.finish_setup=function(){return this.form_field.addClassName("chzn-done")},d.prototype.set_default_values=function(){return d.__super__.set_default_values.call(this),this.single_temp=new Template('#{default}
                      '),this.multi_temp=new Template('
                        '),this.choice_temp=new Template('
                      • #{choice}
                      • '),this.no_results_temp=new Template('
                      • '+this.results_none_found+' "#{terms}"
                      • ')},d.prototype.set_up_html=function(){var a,c,d,e,f;return this.container_id=this.form_field.identify().replace(/(:|\.)/g,"_")+"_chzn",this.f_width=this.form_field.getStyle("width")?parseInt(this.form_field.getStyle("width"),10):this.form_field.getWidth(),c={id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+this.f_width+"px"},this.default_text=this.form_field.readAttribute("data-placeholder")?this.form_field.readAttribute("data-placeholder"):this.default_text_default,a=this.is_multiple?(new Element("div",c)).update(this.multi_temp.evaluate({"default":this.default_text})):(new Element("div",c)).update(this.single_temp.evaluate({"default":this.default_text})),this.form_field.hide().insert({after:a}),this.container=$(this.container_id),this.container.addClassName("chzn-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.down("div.chzn-drop"),d=this.container.getHeight(),e=this.f_width-b(this.dropdown),this.dropdown.setStyle({width:e+"px",top:d+"px"}),this.search_field=this.container.down("input"),this.search_results=this.container.down("ul.chzn-results"),this.search_field_scale(),this.search_no_results=this.container.down("li.no-results"),this.is_multiple?(this.search_choices=this.container.down("ul.chzn-choices"),this.search_container=this.container.down("li.search-field")):(this.search_container=this.container.down("div.chzn-search"),this.selected_item=this.container.down(".chzn-single"),f=e-b(this.search_container)-b(this.search_field),this.search_field.setStyle({width:f+"px"})),this.results_build(),this.set_tab_index(),this.form_field.fire("liszt:ready",{chosen:this})},d.prototype.register_observers=function(){var a=this;return this.container.observe("mousedown",function(b){return a.container_mousedown(b)}),this.container.observe("mouseup",function(b){return a.container_mouseup(b)}),this.container.observe("mouseenter",function(b){return a.mouse_enter(b)}),this.container.observe("mouseleave",function(b){return a.mouse_leave(b)}),this.search_results.observe("mouseup",function(b){return a.search_results_mouseup(b)}),this.search_results.observe("mouseover",function(b){return a.search_results_mouseover(b)}),this.search_results.observe("mouseout",function(b){return a.search_results_mouseout(b)}),this.form_field.observe("liszt:updated",function(b){return a.results_update_field(b)}),this.search_field.observe("blur",function(b){return a.input_blur(b)}),this.search_field.observe("keyup",function(b){return a.keyup_checker(b)}),this.search_field.observe("keydown",function(b){return a.keydown_checker(b)}),this.is_multiple?(this.search_choices.observe("click",function(b){return a.choices_click(b)}),this.search_field.observe("focus",function(b){return a.input_focus(b)})):this.container.observe("click",function(a){return a.preventDefault()})},d.prototype.search_field_disabled=function(){this.is_disabled=this.form_field.disabled;if(this.is_disabled)return this.container.addClassName("chzn-disabled"),this.search_field.disabled=!0,this.is_multiple||this.selected_item.stopObserving("focus",this.activate_action),this.close_field();this.container.removeClassName("chzn-disabled"),this.search_field.disabled=!1;if(!this.is_multiple)return this.selected_item.observe("focus",this.activate_action)},d.prototype.container_mousedown=function(a){var b;if(!this.is_disabled)return b=a!=null?a.target.hasClassName("search-choice-close"):!1,a&&a.type==="mousedown"&&!this.results_showing&&a.stop(),!this.pending_destroy_click&&!b?(this.active_field?!this.is_multiple&&a&&(a.target===this.selected_item||a.target.up("a.chzn-single"))&&this.results_toggle():(this.is_multiple&&this.search_field.clear(),document.observe("click",this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},d.prototype.container_mouseup=function(a){if(a.target.nodeName==="ABBR")return this.results_reset(a)},d.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClassName("chzn-container-active"))return this.close_field()},d.prototype.close_field=function(){return document.stopObserving("click",this.click_test_action),this.is_multiple||(this.selected_item.tabIndex=this.search_field.tabIndex,this.search_field.tabIndex=-1),this.active_field=!1,this.results_hide(),this.container.removeClassName("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},d.prototype.activate_field=function(){return!this.is_multiple&&!this.active_field&&(this.search_field.tabIndex=this.selected_item.tabIndex,this.selected_item.tabIndex=-1),this.container.addClassName("chzn-container-active"),this.active_field=!0,this.search_field.value=this.search_field.value,this.search_field.focus()},d.prototype.test_active_click=function(a){return a.target.up("#"+this.container_id)?this.active_field=!0:this.close_field()},d.prototype.results_build=function(){var a,b,d,e,f;this.parsing=!0,this.results_data=c.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.select("li.search-choice").invoke("remove"),this.choices=0):this.is_multiple||(this.selected_item.down("span").update(this.default_text),this.form_field.options.length<=this.disable_search_threshold?this.container.addClassName("chzn-container-single-nosearch"):this.container.removeClassName("chzn-container-single-nosearch")),a="",f=this.results_data;for(d=0,e=f.length;d'+a.label.escapeHTML()+"")},d.prototype.result_do_highlight=function(a){var b,c,d,e,f;this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClassName("highlighted"),d=parseInt(this.search_results.getStyle("maxHeight"),10),f=this.search_results.scrollTop,e=d+f,c=this.result_highlight.positionedOffset().top,b=c+this.result_highlight.getHeight();if(b>=e)return this.search_results.scrollTop=b-d>0?b-d:0;if(c0&&this.search_field.value.length<1&&this.results_hide(),this.result_deselect(a.readAttribute("rel")),a.up("li").remove()},d.prototype.results_reset=function(a){this.form_field.options[0].selected=!0,this.selected_item.down("span").update(this.default_text),this.is_multiple||this.selected_item.addClassName("chzn-default"),this.show_search_field_default(),a.target.remove(),typeof Event.simulate=="function"&&this.form_field.simulate("change");if(this.active_field)return this.results_hide()},d.prototype.result_select=function(a){var b,c,d;if(this.result_highlight)return b=this.result_highlight,this.result_clear_highlight(),this.is_multiple?this.result_deactivate(b):(this.search_results.descendants(".result-selected").invoke("removeClassName","result-selected"),this.selected_item.removeClassName("chzn-default"),this.result_single_selected=b),b.addClassName("result-selected"),d=b.id.substr(b.id.lastIndexOf("_")+1),c=this.results_data[d],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.is_multiple?this.choice_build(c):(this.selected_item.down("span").update(c.html),this.allow_single_deselect&&this.single_deselect_control_build()),(!a.metaKey||!this.is_multiple)&&this.results_hide(),this.search_field.value="",typeof Event.simulate=="function"&&this.form_field.simulate("change"),this.search_field_scale()},d.prototype.result_activate=function(a){return a.addClassName("active-result")},d.prototype.result_deactivate=function(a){return a.removeClassName("active-result")},d.prototype.result_deselect=function(a){var b,c;return c=this.results_data[a],c.selected=!1,this.form_field.options[c.options_index].selected=!1,b=$(this.container_id+"_o_"+a),b.removeClassName("result-selected").addClassName("active-result").show(),this.result_clear_highlight(),this.winnow_results(),typeof Event.simulate=="function"&&this.form_field.simulate("change"),this.search_field_scale()},d.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&!this.selected_item.down("abbr"))return this.selected_item.down("span").insert({after:''})},d.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;this.no_results_clear(),h=0,i=this.search_field.value===this.default_text?"":this.search_field.value.strip().escapeHTML(),f=this.search_contains?"":"^",e=new RegExp(f+i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),l=new RegExp(i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),q=this.results_data;for(m=0,o=q.length;m=0||b.html.indexOf("[")===0){d=b.html.replace(/\[|\]/g,"").split(" ");if(d.length)for(n=0,p=d.length;n"+b.html.substr(j+i.length),k=k.substr(0,j)+""+k.substr(j)):k=b.html,$(g).innerHTML!==k&&$(g).update(k),this.result_activate($(g)),b.group_array_index!=null&&$(this.results_data[b.group_array_index].dom_id).setStyle({display:"list-item"})):($(g)===this.result_highlight&&this.result_clear_highlight(),this.result_deactivate($(g)))}}return h<1&&i.length?this.no_results(i):this.winnow_results_set_highlight()},d.prototype.winnow_results_clear=function(){var a,b,c,d,e;this.search_field.clear(),b=this.search_results.select("li"),e=[];for(c=0,d=b.length;c0&&this.results_hide(),this.result_clear_highlight())},d.prototype.keydown_backstroke=function(){return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.down("a")),this.clear_backstroke()):(this.pending_backstroke=this.search_container.siblings("li.search-choice").last(),this.pending_backstroke.addClassName("search-choice-focus"))},d.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClassName("search-choice-focus"),this.pending_backstroke=null},d.prototype.keydown_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale(),b!==8&&this.pending_backstroke&&this.clear_backstroke();switch(b){case 8:this.backstroke_length=this.search_field.value.length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},d.prototype.search_field_scale=function(){var a,b,c,d,e,f,g,h,i;if(this.is_multiple){c=0,g=0,e="position:absolute; left: -1000px; top: -1000px; display:none;",f=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(h=0,i=f.length;hthis.f_width-10&&(g=this.f_width-10),this.search_field.setStyle({width:g+"px"}),a=this.container.getHeight(),this.dropdown.setStyle({top:a+"px"})}},d}(AbstractChosen),c.Chosen=a,Prototype.Browser.IE&&/MSIE (\d+\.\d+);/.test(navigator.userAgent)&&(Prototype.BrowserFeatures.Version=new Number(RegExp.$1)),b=function(a){var b,c;return b=new Element.Layout(a),c=b.get("border-left")+b.get("border-right")+b.get("padding-left")+b.get("padding-right")},c.get_side_border_padding=b}.call(this) \ No newline at end of file diff --git a/admin/thirdparty/chosen/coffee/chosen.jquery.coffee b/admin/thirdparty/chosen/coffee/chosen.jquery.coffee index d65d0354a..ae71f9e55 100644 --- a/admin/thirdparty/chosen/coffee/chosen.jquery.coffee +++ b/admin/thirdparty/chosen/coffee/chosen.jquery.coffee @@ -40,7 +40,7 @@ class Chosen extends AbstractChosen if @is_multiple container_div.html '
                          ' else - container_div.html '' + @default_text + '
                            ' + container_div.html '' + @default_text + '
                              ' @form_field_jq.hide().after container_div @container = ($ '#' + @container_id) @@ -108,7 +108,7 @@ class Chosen extends AbstractChosen container_mousedown: (evt) -> if !@is_disabled target_closelink = if evt? then ($ evt.target).hasClass "search-choice-close" else false - if evt and evt.type is "mousedown" + if evt and evt.type is "mousedown" and not @results_showing evt.stopPropagation() if not @pending_destroy_click and not target_closelink if not @active_field @@ -187,7 +187,7 @@ class Chosen extends AbstractChosen if data.selected and @is_multiple this.choice_build data else if data.selected and not @is_multiple - @selected_item.find("span").text data.text + @selected_item.removeClass("chzn-default").find("span").text data.text this.single_deselect_control_build() if @allow_single_deselect this.search_field_disabled() @@ -315,6 +315,7 @@ class Chosen extends AbstractChosen results_reset: (evt) -> @form_field.options[0].selected = true @selected_item.find("span").text @default_text + @selected_item.addClass("chzn-default") if not @is_multiple this.show_search_field_default() $(evt.target).remove(); @form_field_jq.trigger "change" @@ -332,6 +333,7 @@ class Chosen extends AbstractChosen else @search_results.find(".result-selected").removeClass "result-selected" @result_single_selected = high + @selected_item.removeClass("chzn-default") high.addClass "result-selected" @@ -383,7 +385,8 @@ class Chosen extends AbstractChosen results = 0 searchText = if @search_field.val() is @default_text then "" else $('
                              ').text($.trim(@search_field.val())).html() - regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i') + regexAnchor = if @search_contains then "" else "^" + regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i') zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i') for option in @results_data diff --git a/admin/thirdparty/chosen/coffee/chosen.proto.coffee b/admin/thirdparty/chosen/coffee/chosen.proto.coffee index 4c306a766..d63d64047 100644 --- a/admin/thirdparty/chosen/coffee/chosen.proto.coffee +++ b/admin/thirdparty/chosen/coffee/chosen.proto.coffee @@ -16,7 +16,7 @@ class Chosen extends AbstractChosen super() # HTML Templates - @single_temp = new Template('#{default}
                                ') + @single_temp = new Template('#{default}
                                  ') @multi_temp = new Template('
                                    ') @choice_temp = new Template('
                                  • #{choice}
                                  • ') @no_results_temp = new Template('
                                  • ' + @results_none_found + ' "#{terms}"
                                  • ') @@ -101,7 +101,7 @@ class Chosen extends AbstractChosen container_mousedown: (evt) -> if !@is_disabled target_closelink = if evt? then evt.target.hasClassName "search-choice-close" else false - if evt and evt.type is "mousedown" + if evt and evt.type is "mousedown" and not @results_showing evt.stop() if not @pending_destroy_click and not target_closelink if not @active_field @@ -179,7 +179,7 @@ class Chosen extends AbstractChosen if data.selected and @is_multiple this.choice_build data else if data.selected and not @is_multiple - @selected_item.down("span").update( data.html ) + @selected_item.removeClassName("chzn-default").down("span").update( data.html ) this.single_deselect_control_build() if @allow_single_deselect this.search_field_disabled() @@ -308,6 +308,7 @@ class Chosen extends AbstractChosen results_reset: (evt) -> @form_field.options[0].selected = true @selected_item.down("span").update(@default_text) + @selected_item.addClassName("chzn-default") if not @is_multiple this.show_search_field_default() evt.target.remove() @form_field.simulate("change") if typeof Event.simulate is 'function' @@ -322,6 +323,7 @@ class Chosen extends AbstractChosen this.result_deactivate high else @search_results.descendants(".result-selected").invoke "removeClassName", "result-selected" + @selected_item.removeClassName("chzn-default") @result_single_selected = high high.addClassName("result-selected") @@ -374,7 +376,8 @@ class Chosen extends AbstractChosen results = 0 searchText = if @search_field.value is @default_text then "" else @search_field.value.strip().escapeHTML() - regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i') + regexAnchor = if @search_contains then "" else "^" + regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i') zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i') for option in @results_data diff --git a/admin/thirdparty/chosen/coffee/lib/abstract-chosen.coffee b/admin/thirdparty/chosen/coffee/lib/abstract-chosen.coffee index a7c1b01da..dc68b7da9 100644 --- a/admin/thirdparty/chosen/coffee/lib/abstract-chosen.coffee +++ b/admin/thirdparty/chosen/coffee/lib/abstract-chosen.coffee @@ -29,6 +29,7 @@ class AbstractChosen @result_single_selected = null @allow_single_deselect = if @options.allow_single_deselect? and @form_field.options[0]? and @form_field.options[0].text is "" then @options.allow_single_deselect else false @disable_search_threshold = @options.disable_search_threshold || 0 + @search_contains = @options.search_contains || false @choices = 0 @results_none_found = @options.no_results_text or "No results match" diff --git a/admin/thirdparty/chosen/example.proto.html b/admin/thirdparty/chosen/example.proto.html index 77c48c71f..d24a08bbf 100644 --- a/admin/thirdparty/chosen/example.proto.html +++ b/admin/thirdparty/chosen/example.proto.html @@ -1343,7 +1343,7 @@ orgia and The South Sandwich Islands">South Georgia and The South Sandwich Islan

                                    Using Chosen is easy as can be.

                                    1. Download the plugin and copy the chosen files to your app.
                                    2. -
                                    3. Activate the plugin by creating a new instance of Chosen: New Chosen(some_form_field);
                                    4. +
                                    5. Activate the plugin by creating a new instance of Chosen: new Chosen(some_form_field);
                                    6. Disco.
                                    diff --git a/admin/thirdparty/chosen/package.json b/admin/thirdparty/chosen/package.json index a26bb42c8..a97f4f48b 100644 --- a/admin/thirdparty/chosen/package.json +++ b/admin/thirdparty/chosen/package.json @@ -1,7 +1,7 @@ { "author": "harvest", "name": "chosen", - "version": "0.9.7", + "version": "0.9.8", "description": "Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors.", "repository": { "type": "git", diff --git a/css/AssetUploadField.css b/css/AssetUploadField.css index 75de568af..d4d9b52b5 100644 --- a/css/AssetUploadField.css +++ b/css/AssetUploadField.css @@ -6,6 +6,8 @@ /** ----------------------------------------------- Application Logo (CMS Logo) Must be 24px x 24px ------------------------------------------------ */ #AssetUploadField { border-bottom: 0; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; box-shadow: none; } +body.cms.ss-uploadfield-edit-iframe { padding: 16px; overflow: auto; } + .ss-assetuploadfield h3 { border-bottom: 1px solid rgba(201, 205, 206, 0.8); -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); -o-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); margin: 0 0 8px; padding: 0 0 7px; clear: both; } .ss-assetuploadfield .field { border-bottom: 0; } .ss-assetuploadfield .ss-uploadfield-files { margin: 0; padding: 0; } @@ -30,7 +32,7 @@ .ss-assetuploadfield .ss-uploadfield-files .ss-uploadfield-item-cancel { position: absolute; top: 7px; right: 7px; } .ss-assetuploadfield .ss-uploadfield-files .ss-uploadfield-item-cancel button { display: block; overflow: hidden; text-indent: -9999px; padding: 0; margin: 0; border: 0; width: 16px; height: 16px; cursor: pointer; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; box-shadow: none; } .ss-assetuploadfield .ss-uploadfield-files .ss-uploadfield-item-editform { /* don't use display none, for it will break jQuery('iframe').contents().height() */ height: 0; overflow: hidden; clear: both; } -.ss-assetuploadfield .ss-uploadfield-files .ss-uploadfield-item-editform iframe { margin: 16px; width: 100%; } +.ss-assetuploadfield .ss-uploadfield-files .ss-uploadfield-item-editform iframe { width: 100%; } .ss-assetuploadfield .ss-uploadfield-addfile .ss-uploadfield-item-info { float: left; margin: 19px 0 0; } .ss-assetuploadfield .ss-uploadfield-addfile .ss-uploadfield-fromcomputer { position: relative; overflow: hidden; display: block; margin: 0 10px 0 0; } .ss-assetuploadfield .ss-uploadfield-addfile .ss-uploadfield-item-uploador { float: left; font-weight: bold; font-size: 22px; padding: 0 20px; line-height: 70px; display: none; } diff --git a/css/GridField.css b/css/GridField.css index e2e67e4c9..8d8d74f78 100644 --- a/css/GridField.css +++ b/css/GridField.css @@ -12,11 +12,12 @@ .cms table.ss-gridfield-table thead { color: #1d2224; background: transparent; } .cms table.ss-gridfield-table thead tr.filter-header .fieldgroup { max-width: 512px; } .cms table.ss-gridfield-table tbody { background: #FFF; } +.cms table.ss-gridfield-table tbody td { width: 100%; } +.cms table.ss-gridfield-table tbody td.col-buttons { width: auto; text-align: right; white-space: nowrap; } .cms table.ss-gridfield-table tbody td button { border: none; background: none; margin: 0 0 0 2px; padding: 0; width: auto; text-shadow: none; } .cms table.ss-gridfield-table tbody td button.ui-state-hover { background: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } .cms table.ss-gridfield-table tbody td button.ui-state-active { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } -.cms table.ss-gridfield-table tbody td a.edit-link { display: inline-block; width: 16px; height: 20px; text-indent: -9999em; background: url(../images/icons/document--pencil.png) no-repeat 0 1px; } -.cms table.ss-gridfield-table tbody td.col-buttons { white-space: nowrap; } +.cms table.ss-gridfield-table tbody td a.edit-link { display: inline-block; width: 16px; height: 20px; text-indent: 9999em; background: url(../images/icons/document--pencil.png) no-repeat 0 1px; } .cms table.ss-gridfield-table tfoot { color: #1d2224; } .cms table.ss-gridfield-table tfoot tr td { background: #95a5ab; padding: .7em; border-bottom: 1px solid rgba(0, 0, 0, 0.1); } .cms table.ss-gridfield-table tr.title { -moz-border-radius-topleft: 7px; -webkit-border-top-left-radius: 7px; -o-border-top-left-radius: 7px; -ms-border-top-left-radius: 7px; -khtml-border-top-left-radius: 7px; border-top-left-radius: 7px; -moz-border-radius-topright: 7px; -webkit-border-top-right-radius: 7px; -o-border-top-right-radius: 7px; -ms-border-top-right-radius: 7px; -khtml-border-top-right-radius: 7px; border-top-right-radius: 7px; } @@ -45,6 +46,7 @@ .cms table.ss-gridfield-table tr th.action { border-right: 0; } .cms table.ss-gridfield-table tr th.first { -moz-border-radius-topleft: 7px; -webkit-border-top-left-radius: 7px; -o-border-top-left-radius: 7px; -ms-border-top-left-radius: 7px; -khtml-border-top-left-radius: 7px; border-top-left-radius: 7px; } .cms table.ss-gridfield-table tr th.last { -moz-border-radius-topright: 7px; -webkit-border-top-right-radius: 7px; -o-border-top-right-radius: 7px; -ms-border-top-right-radius: 7px; -khtml-border-top-right-radius: 7px; border-top-right-radius: 7px; } +.cms table.ss-gridfield-table tr th button#action_gridfield_relationadd:hover { color: #444 !important; /* Not sure why IE think it needs this */ } .cms table.ss-gridfield-table tr th button:hover { color: #ccc !important; /* Not sure why IE think it needs this */ } .cms table.ss-gridfield-table tr th button.ss-gridfield-sort:hover { color: #fff !important; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } .cms table.ss-gridfield-table tr th button.ss-gridfield-sort { background: transparent url(../images/arrows.png) no-repeat right 6px; border: none; width: 100%; text-align: left; padding: 4px 0; text-shadow: rgba(0, 0, 0, 0.3) 0px -1px 0; color: #fff; -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; -ms-border-radius: 0; -khtml-border-radius: 0; border-radius: 0; } diff --git a/forms/OptionsetField.php b/forms/OptionsetField.php index 50a39f6c0..353f8201d 100644 --- a/forms/OptionsetField.php +++ b/forms/OptionsetField.php @@ -28,10 +28,10 @@ * * * //Database request for the object - * $myDoSet = DataObject::get("FooBars",""); + * $myDoSet = DataList::create("FooBars",""); * if($myDoSet){ * // This returns an array of ID => Title - * $map = $myDoSet->toDropDownMap(); + * $map = $myDoSet->map(); * * // Instantiate the OptionsetField * $FieldList = new FieldList( diff --git a/javascript/lang/en_US.js b/javascript/lang/en_US.js index efabd2c6e..3f5967af8 100644 --- a/javascript/lang/en_US.js +++ b/javascript/lang/en_US.js @@ -11,6 +11,7 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') { 'UNIQUEFIELD.CANNOTLEAVEEMPTY': 'This field cannot be left empty', 'RESTRICTEDTEXTFIELD.CHARCANTBEUSED': "The character '%s' cannot be used in this field", 'UPDATEURL.CONFIRM': 'Would you like me to change the URL to:\n\n%s/\n\nClick Ok to change the URL, click Cancel to leave it as:\n\n%s', + 'UPDATEURL.CONFIRMURLCHANGED':'The URL has been changed to\n"%s"', 'FILEIFRAMEFIELD.DELETEFILE': 'Delete File', 'FILEIFRAMEFIELD.UNATTACHFILE': 'Un-Attach File', 'FILEIFRAMEFIELD.DELETEIMAGE': 'Delete Image', diff --git a/model/DataList.php b/model/DataList.php index 1984af0df..931419c25 100644 --- a/model/DataList.php +++ b/model/DataList.php @@ -658,7 +658,7 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab * * Example: Get members from all Groups: * - * DataObject::get("Group")->relation("Members") + * DataList::Create("Group")->relation("Members") * * @param string $relationName * @return HasManyList|ManyManyList diff --git a/model/DataObject.php b/model/DataObject.php index 24c98d805..451a9905b 100644 --- a/model/DataObject.php +++ b/model/DataObject.php @@ -309,7 +309,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity else $passed = "The value '$record'"; user_error("DataObject::__construct passed $passed. It's supposed to be passed an array, - taken straight from the database. Perhaps you should use DataObject::get_one instead?", E_USER_WARNING); + taken straight from the database. Perhaps you should use DataList::create()->First(); instead?", E_USER_WARNING); $record = null; } @@ -2469,10 +2469,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity } /** - * @deprecated 3.0 Use DataObject::get and DataList to do your querying + * @deprecated 3.0 Use DataList::create and DataList to do your querying */ public function buildSQL($filter = "", $sort = "", $limit = "", $join = "", $restrictClasses = true, $having = "") { - Deprecation::notice('3.0', 'Use DataObject::get and DataList to do your querying instead.'); + Deprecation::notice('3.0', 'Use DataList::create and DataList to do your querying instead.'); return $this->extendedSQL($filter, $sort, $limit, $join, $having); } @@ -2483,10 +2483,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity private static $cache_buildSQL_query; /** - * @deprecated 3.0 Use DataObject::get and DataList to do your querying + * @deprecated 3.0 Use DataList::create and DataList to do your querying */ public function extendedSQL($filter = "", $sort = "", $limit = "", $join = ""){ - Deprecation::notice('3.0', 'Use DataObject::get and DataList to do your querying instead.'); + Deprecation::notice('3.0', 'Use DataList::create and DataList to do your querying instead.'); $dataList = DataObject::get($this->class, $filter, $sort, $join, $limit); return $dataList->dataQuery()->query(); } @@ -2521,10 +2521,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity } /** - * @deprecated 3.0 Use DataObject::get and DataList to do your querying + * @deprecated 3.0 Use DataList::create and DataList to do your querying */ public function Aggregate($class = null) { - Deprecation::notice('3.0', 'Use DataObject::get and DataList to do your querying instead.'); + Deprecation::notice('3.0', 'Use DataList::create and DataList to do your querying instead.'); if($class) { $list = new DataList($class); @@ -2538,19 +2538,18 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity } /** - * @deprecated 3.0 Use DataObject::get and DataList to do your querying + * @deprecated 3.0 Use DataList::create and DataList to do your querying */ public function RelationshipAggregate($relationship) { - Deprecation::notice('3.0', 'Use DataObject::get and DataList to do your querying instead.'); + Deprecation::notice('3.0', 'Use DataList::create and DataList to do your querying instead.'); return $this->$relationship(); } /** - * The internal function that actually performs the querying for get(). - * DataObject::get("Table","filter") is the same as singleton("Table")->instance_get("filter") + * DataList::create("Table")->where("filter") is the same as singleton("Table")->instance_get("filter") * - * @deprecated 3.0 Use DataObject::get and DataList to do your querying + * @deprecated 3.0 Use DataList::create and DataList to do your querying * * @param string $filter A filter to be inserted into the WHERE clause. * @param string $sort A sort expression to be inserted into the ORDER BY clause. If omitted, self::$default_sort will be used. @@ -2561,7 +2560,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity * @return mixed The objects matching the filter, in the class specified by $containerClass */ public function instance_get($filter = "", $sort = "", $join = "", $limit="", $containerClass = "DataObjectSet") { - Deprecation::notice('3.0', 'Use DataObject::get and DataList to do your querying instead.'); + Deprecation::notice('3.0', 'Use DataList::create and DataList to do your querying instead.'); return self::get($this->class, $filter, $sort, $join, $limit, $containerClass); } @@ -2693,7 +2692,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity /** * Does the hard work for get_one() * - * @deprecated 3.0 Use DataObject::get_one() instead + * @deprecated 3.0 Use DataList::create($this->class)->where($filter)->sort($orderby)->First() instead * * @uses DataExtension->augmentSQL() * @@ -2702,7 +2701,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity * @return DataObject The first item matching the query */ public function instance_get_one($filter, $orderby = null) { - Deprecation::notice('3.0', 'Use DataObject::get_one() instead.'); + Deprecation::notice('3.0', 'Use DataList::create($this->class)->where($filter)->sort($orderby)->First() instead.'); return DataObject::get_one($this->class, $filter, true, $orderby); } diff --git a/model/DataQuery.php b/model/DataQuery.php index 2dad960fd..03d32c9f3 100644 --- a/model/DataQuery.php +++ b/model/DataQuery.php @@ -145,7 +145,7 @@ class DataQuery { if($this->dataClass != $baseClass) { // Get the ClassName values to filter to $classNames = ClassInfo::subclassesFor($this->dataClass); - if(!$classNames) user_error("DataObject::get() Can't find data sub-classes for '$callerClass'"); + if(!$classNames) user_error("DataList::create() Can't find data sub-classes for '$callerClass'"); $query->where[] = "\"$baseClass\".\"ClassName\" IN ('" . implode("','", $classNames) . "')"; } } diff --git a/model/Versioned.php b/model/Versioned.php index ce96c9338..fa446fafb 100644 --- a/model/Versioned.php +++ b/model/Versioned.php @@ -1006,7 +1006,7 @@ class Versioned extends DataExtension { } /** - * Return the equivalent of a DataObject::get() call, querying the latest + * Return the equivalent of a DataList::create() call, querying the latest * version of each page stored in the (class)_versions tables. * * In particular, this will query deleted records as well as active ones. diff --git a/scss/AssetUploadField.scss b/scss/AssetUploadField.scss index df2f25d50..9414a01fe 100644 --- a/scss/AssetUploadField.scss +++ b/scss/AssetUploadField.scss @@ -8,6 +8,11 @@ @include box-shadow(none); } +body.cms.ss-uploadfield-edit-iframe { + padding: $grid-x*2; + overflow: auto; +} + .ss-assetuploadfield { h3 { border-bottom: 1px solid $color-shadow-light; @@ -162,7 +167,6 @@ clear: both; iframe { - margin: $grid-x*2; width: 100%; } } diff --git a/scss/GridField.scss b/scss/GridField.scss index d70194d88..c3cea9f9e 100644 --- a/scss/GridField.scss +++ b/scss/GridField.scss @@ -98,6 +98,16 @@ $gf_grid_x: 16px; tbody { background: #FFF; td { + // Give browser some hints on which cols take priority: + // The last column (buttons) should always shrink to fit. + // Overwritten for IE7, which doesn't support this. + width: 100%; + &.col-buttons { + width: auto; + text-align: right; + white-space: nowrap; + } + button { border: none; background: none; @@ -118,13 +128,9 @@ $gf_grid_x: 16px; display:inline-block; width:$gf_grid_x; height:20px; //min height to fit the edit icon - text-indent:-9999em; + text-indent:9999em; background: url(../images/icons/document--pencil.png) no-repeat 0 1px; } - - &.col-buttons { - white-space: nowrap; - } } } @@ -265,6 +271,9 @@ $gf_grid_x: 16px; } button { + &#action_gridfield_relationadd:hover { + color: #444 !important; /* Not sure why IE think it needs this */ + } &:hover { color: #ccc !important; /* Not sure why IE think it needs this */ } diff --git a/security/Group.php b/security/Group.php index ee52b4521..b4b8fde83 100755 --- a/security/Group.php +++ b/security/Group.php @@ -85,7 +85,10 @@ class Group extends DataObject { ) ); - $parentidfield->setRightTitle('' . _t('Group.GroupReminder', 'If you choose a parent group, this group will take all it\'s roles') . ''); + $parentidfield->setAttribute( + 'title', + _t('Group.GroupReminder', 'If you choose a parent group, this group will take all it\'s roles') + ); // Filter permissions // TODO SecurityAdmin coupling, not easy to get to the form fields through GridFieldDetailForm diff --git a/tests/forms/gridfield/GridFieldDeleteActionTest.php b/tests/forms/gridfield/GridFieldDeleteActionTest.php index 3c09d7b6a..b29196cd8 100644 --- a/tests/forms/gridfield/GridFieldDeleteActionTest.php +++ b/tests/forms/gridfield/GridFieldDeleteActionTest.php @@ -31,7 +31,7 @@ class GridFieldDeleteActionTest extends SapphireTest { // Check that there are content $this->assertEquals(4, count($content->getBySelector('.ss-gridfield-item'))); // Make sure that there are no delete buttons - $this->assertEmpty($content->getBySelector('.gridfield-button-delete'), 'Delete buttons should not show when not logged in.'); + $this->assertEquals(0, count($content->getBySelector('.gridfield-button-delete')), 'Delete buttons should not show when not logged in.'); } public function testShowDeleteButtonsWithAdminPermission() { diff --git a/tests/forms/gridfield/GridFieldEditButtonTest.php b/tests/forms/gridfield/GridFieldEditButtonTest.php index 13b3b045b..10cf20d94 100644 --- a/tests/forms/gridfield/GridFieldEditButtonTest.php +++ b/tests/forms/gridfield/GridFieldEditButtonTest.php @@ -32,7 +32,7 @@ class GridFieldEditButtonTest extends SapphireTest { // Check that there are content $this->assertEquals(3, count($content->getBySelector('.ss-gridfield-item'))); // Make sure that there are no edit links - $this->assertEmpty($content->getBySelector('.edit-link'), 'Edit links should not show when not logged in.'); + $this->assertEquals(0, count($content->getBySelector('.edit-link')), 'Edit links should not show when not logged in.'); } public function testShowEditLinksWithAdminPermission() {