diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 4f779239..6241a069 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -736,6 +736,23 @@ function updateSynapsePermission(edge, permission) { }); } +function updateMapPermission(mapid, permission) { + var mdata = { "map": { "permission": permission } }; + $.ajax({ + type: "PUT", + dataType: 'json', + url: "/maps/" + mapid, + data: mdata, + success: function(data) { + $('.mapPermission').removeClass('commons public private minimize').addClass( permission ); + $('.mapPermission .permissionSelect').remove(); + }, + error: function(){ + alert('failed to update permission'); + } + }); +} + function MconsoleReset() { var tX = Mconsole.canvas.translateOffsetX; diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index d86f7da5..172b98e3 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1569,24 +1569,29 @@ background-position: 16px 6px; background-size: 27px 27px; position:relative; } -.mapContributors .tip { +.infoStatIcon .tip { display: none; position: absolute; background: white; min-width: 180px; max-width:250px; text-align:center; -top: 38px; -left: 6px; color: black; border-radius: 4px; font-size: 15px !important; -font-family: 'LatoLight'; +font-family: 'LatoRegular'; line-height: 17px; padding: 3px 5px 2px; -border: 1px solid black; z-index: 100; } +.mapContributors .tip { + top: 38px; + left: 6px; +} +.mapPermission .tip { + top: 0; + right: 32px; +} .mapInfoBox .hoverForTip:hover .tip { display:block; } @@ -1602,8 +1607,13 @@ background-position: 18px 6px; background-size: 27px 27px; } .mapPermission { -background-position: 10px center; +background-position: 0 center; background-size: 30px 30px; +width: 30px; +height: 30px; +padding: 0; +margin: 5px 30px 5px 10px; +position: relative; } .mapPermission.commons { background-image:url(MMCCicon_commons.png); @@ -1615,6 +1625,47 @@ background-size: 30px 30px; background-image:url(MMCCicon_private.png); } +.yourMap .mapPermission:hover { + background-image: url(/assets/MMCCicon_maximize_arrow.png); + cursor:pointer; +} +.yourMap .mapPermission.minimize { + background-image: url(MMCCicon_minimize_arrow.png) !important; + cursor: pointer; +} +.mapPermission .permissionSelect { + list-style: none; + width: 30px; + height: 60px; + position: relative; + top: 30px; +} +.mapPermission .permissionSelect li { + width: 30px; + height: 30px; + background-repeat: no-repeat; + background-position: center center; + background-size: 30px 30px; +} +.mapPermission .permissionSelect .commons { + background-image: url(MMCCicon_commons.png); +} +.mapPermission .permissionSelect .public { + background-image: url(MMCCicon_public.png); +} +.mapPermission .permissionSelect .private { + background-image: url(MMCCicon_private.png); +} +.mapPermission .permissionSelect .commons:hover { + background-image: url(MMCCicon_commons_black.png); +} +.mapPermission .permissionSelect .public:hover { + background-image: url(MMCCicon_public_black.png); +} +.mapPermission .permissionSelect .private:hover { + background-image: url(MMCCicon_private_black.png); +} + .mapInfoBox .mapInfoDesc { font-style: italic; color: #BBB; diff --git a/app/views/maps/_homemap.html.erb b/app/views/maps/_homemap.html.erb index 94472968..de583376 100644 --- a/app/views/maps/_homemap.html.erb +++ b/app/views/maps/_homemap.html.erb @@ -8,7 +8,7 @@