Merge branch 'develop' into feature/better.select
This commit is contained in:
commit
966dd79187
10 changed files with 102 additions and 16 deletions
BIN
app/assets/images/pincarousel_sprite.png
Normal file
BIN
app/assets/images/pincarousel_sprite.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 822 B |
|
@ -180,8 +180,10 @@ jQuery.browser = browser;
|
||||||
if (options.mouseWheel)
|
if (options.mouseWheel)
|
||||||
{
|
{
|
||||||
// START METAMAPS CODE
|
// START METAMAPS CODE
|
||||||
/*$('body').bind('mousewheel',this,function(event, delta) {
|
$('body').bind('mousewheel',this,function(event, delta) {
|
||||||
if (Metamaps.Create.newTopic.beingCreated && !Metamaps.Create.isSwitchingSet) {
|
if (Metamaps.Create.newTopic.beingCreated &&
|
||||||
|
!Metamaps.Create.isSwitchingSet &&
|
||||||
|
!Metamaps.Create.newTopic.pinned) {
|
||||||
event.data.rotate(delta);
|
event.data.rotate(delta);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -426,4 +428,4 @@ jQuery.browser = browser;
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
|
@ -2454,7 +2454,7 @@ Extras.Classes.Navigation = new Class({
|
||||||
// START METAMAPS CODE
|
// START METAMAPS CODE
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (e.target.id != 'infovis-canvas') return;
|
if (e.target.id != 'infovis-canvas') return;
|
||||||
if (Metamaps.Create.newTopic.beingCreated) return;
|
if (Metamaps.Create.newTopic.beingCreated && !Metamaps.Create.newTopic.pinned) return;
|
||||||
// END METAMAPS CODE
|
// END METAMAPS CODE
|
||||||
|
|
||||||
//$.event.stop($.event.get(e, win));
|
//$.event.stop($.event.get(e, win));
|
||||||
|
|
|
@ -163,6 +163,16 @@ Metamaps.Create = {
|
||||||
})
|
})
|
||||||
|
|
||||||
Metamaps.Create.newTopic.initSelector()
|
Metamaps.Create.newTopic.initSelector()
|
||||||
|
$('.pinCarousel').click(function() {
|
||||||
|
if (Metamaps.Create.newTopic.pinned) {
|
||||||
|
$('.pinCarousel').removeClass('isPinned')
|
||||||
|
Metamaps.Create.newTopic.pinned = false
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('.pinCarousel').addClass('isPinned')
|
||||||
|
Metamaps.Create.newTopic.pinned = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
var topicBloodhound = new Bloodhound({
|
var topicBloodhound = new Bloodhound({
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
||||||
|
@ -217,6 +227,7 @@ Metamaps.Create = {
|
||||||
x: null,
|
x: null,
|
||||||
y: null,
|
y: null,
|
||||||
addSynapse: false,
|
addSynapse: false,
|
||||||
|
pinned: false,
|
||||||
initSelector: function () {
|
initSelector: function () {
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
React.createElement(Metamaps.ReactComponents.MetacodeSelect, {
|
React.createElement(Metamaps.ReactComponents.MetacodeSelect, {
|
||||||
|
@ -272,8 +283,15 @@ Metamaps.Create = {
|
||||||
Metamaps.Create.newTopic.beingCreated = true
|
Metamaps.Create.newTopic.beingCreated = true
|
||||||
Metamaps.Create.newTopic.name = ''
|
Metamaps.Create.newTopic.name = ''
|
||||||
},
|
},
|
||||||
hide: function () {
|
hide: function (force) {
|
||||||
$('#new_topic').fadeOut('fast')
|
if (force || !Metamaps.Create.newTopic.pinned) {
|
||||||
|
$('#new_topic').fadeOut('fast')
|
||||||
|
Metamaps.Create.newTopic.beingCreated = false
|
||||||
|
}
|
||||||
|
if (force) {
|
||||||
|
$('.pinCarousel').removeClass('isPinned')
|
||||||
|
Metamaps.Create.newTopic.pinned = false
|
||||||
|
}
|
||||||
$('#topic_name').typeahead('val', '')
|
$('#topic_name').typeahead('val', '')
|
||||||
Metamaps.Create.newTopic.beingCreated = false
|
Metamaps.Create.newTopic.beingCreated = false
|
||||||
Metamaps.Create.newTopic.hideSelector()
|
Metamaps.Create.newTopic.hideSelector()
|
||||||
|
|
|
@ -136,7 +136,7 @@ Metamaps.Map = {
|
||||||
$('.rightclickmenu').remove()
|
$('.rightclickmenu').remove()
|
||||||
Metamaps.TopicCard.hideCard()
|
Metamaps.TopicCard.hideCard()
|
||||||
Metamaps.SynapseCard.hideCard()
|
Metamaps.SynapseCard.hideCard()
|
||||||
Metamaps.Create.newTopic.hide()
|
Metamaps.Create.newTopic.hide(true) // true means force (and override pinned)
|
||||||
Metamaps.Create.newSynapse.hide()
|
Metamaps.Create.newSynapse.hide()
|
||||||
Metamaps.Filter.close()
|
Metamaps.Filter.close()
|
||||||
Metamaps.Map.InfoBox.close()
|
Metamaps.Map.InfoBox.close()
|
||||||
|
@ -284,7 +284,13 @@ Metamaps.Map = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
// this is so that if someone has relied on the auto-placement feature on this map,
|
||||||
|
// it will at least start placing nodes at the first empty spot
|
||||||
|
// this will only work up to the point in the spiral at which someone manually moved a node
|
||||||
|
if (Metamaps.Mappings.findWhere({ xloc: nextX, yloc: nextY })) {
|
||||||
|
return self.getNextCoord()
|
||||||
|
}
|
||||||
|
else return {
|
||||||
x: nextX,
|
x: nextX,
|
||||||
y: nextY
|
y: nextY
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,9 +325,12 @@ Metamaps.Topic = {
|
||||||
})
|
})
|
||||||
Metamaps.Topics.add(topic)
|
Metamaps.Topics.add(topic)
|
||||||
|
|
||||||
|
if (Metamaps.Create.newTopic.pinned) {
|
||||||
|
var nextCoords = Metamaps.Map.getNextCoord()
|
||||||
|
}
|
||||||
var mapping = new Metamaps.Backbone.Mapping({
|
var mapping = new Metamaps.Backbone.Mapping({
|
||||||
xloc: Metamaps.Create.newTopic.x,
|
xloc: nextCoords ? nextCoords.x : Metamaps.Create.newTopic.x,
|
||||||
yloc: Metamaps.Create.newTopic.y,
|
yloc: nextCoords ? nextCoords.y : Metamaps.Create.newTopic.y,
|
||||||
mappable_id: topic.cid,
|
mappable_id: topic.cid,
|
||||||
mappable_type: 'Topic',
|
mappable_type: 'Topic',
|
||||||
})
|
})
|
||||||
|
@ -347,9 +350,12 @@ Metamaps.Topic = {
|
||||||
|
|
||||||
var topic = self.get(id)
|
var topic = self.get(id)
|
||||||
|
|
||||||
|
if (Metamaps.Create.newTopic.pinned) {
|
||||||
|
var nextCoords = Metamaps.Map.getNextCoord()
|
||||||
|
}
|
||||||
var mapping = new Metamaps.Backbone.Mapping({
|
var mapping = new Metamaps.Backbone.Mapping({
|
||||||
xloc: Metamaps.Create.newTopic.x,
|
xloc: nextCoords ? nextCoords.x : Metamaps.Create.newTopic.x,
|
||||||
yloc: Metamaps.Create.newTopic.y,
|
yloc: nextCoords ? nextCoords.y : Metamaps.Create.newTopic.y,
|
||||||
mappable_type: 'Topic',
|
mappable_type: 'Topic',
|
||||||
mappable_id: topic.id,
|
mappable_id: topic.id,
|
||||||
})
|
})
|
||||||
|
|
|
@ -598,6 +598,26 @@ button.button.btn-no:hover {
|
||||||
.openMetacodeSwitcher:hover {
|
.openMetacodeSwitcher:hover {
|
||||||
background-position: -16px 0;
|
background-position: -16px 0;
|
||||||
}
|
}
|
||||||
|
.pinCarousel {
|
||||||
|
cursor: pointer;
|
||||||
|
display: block;
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
background-image: url(<%= asset_data_uri('pincarousel_sprite.png') %>);
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
top: 20px;
|
||||||
|
right: 16px;
|
||||||
|
}
|
||||||
|
.pinCarousel:hover {
|
||||||
|
background-position: 0 -16px;
|
||||||
|
}
|
||||||
|
.pinCarousel.isPinned {
|
||||||
|
background-position: -16px 0;
|
||||||
|
}
|
||||||
|
.pinCarousel.isPinned:hover {
|
||||||
|
background-position: -16px -16px;
|
||||||
|
}
|
||||||
#metacodeImg {
|
#metacodeImg {
|
||||||
height: 120px;
|
height: 120px;
|
||||||
width: 380px;
|
width: 380px;
|
||||||
|
|
|
@ -458,7 +458,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.zoomExtents:hover .tooltips, .zoomIn:hover .tooltips, .zoomOut:hover .tooltips, .takeScreenshot:hover .tooltips, .sidebarFilterIcon:hover .tooltipsUnder, .sidebarForkIcon:hover .tooltipsUnder, .addMap:hover .tooltipsUnder, .authenticated .sidebarAccountIcon:hover .tooltipsUnder,
|
.zoomExtents:hover .tooltips, .zoomIn:hover .tooltips, .zoomOut:hover .tooltips, .takeScreenshot:hover .tooltips, .sidebarFilterIcon:hover .tooltipsUnder, .sidebarForkIcon:hover .tooltipsUnder, .addMap:hover .tooltipsUnder, .authenticated .sidebarAccountIcon:hover .tooltipsUnder,
|
||||||
.mapInfoIcon:hover .tooltipsAbove, .openCheatsheet:hover .tooltipsAbove, .chat-button:hover .tooltips, .starMap:hover .tooltipsAbove {
|
.mapInfoIcon:hover .tooltipsAbove, .openCheatsheet:hover .tooltipsAbove, .chat-button:hover .tooltips, .starMap:hover .tooltipsAbove, .openMetacodeSwitcher:hover .tooltipsAbove, .pinCarousel:not(.isPinned):hover .tooltipsAbove.helpPin, .pinCarousel.isPinned:hover .tooltipsAbove.helpUnpin {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,6 +522,29 @@
|
||||||
margin-left: -34px;
|
margin-left: -34px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.openMetacodeSwitcher .tooltipsAbove {
|
||||||
|
left: -50px;
|
||||||
|
top: -5px;
|
||||||
|
}
|
||||||
|
.pinCarousel .tooltipsAbove {
|
||||||
|
top: -5px;
|
||||||
|
}
|
||||||
|
.pinCarousel .tooltipsAbove.helpPin {
|
||||||
|
left: -24px;
|
||||||
|
}
|
||||||
|
.pinCarousel .tooltipsAbove.helpUnpin {
|
||||||
|
left: -14px;
|
||||||
|
}
|
||||||
|
.openMetacodeSwitcher .tooltipsAbove:after {
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
.pinCarousel .tooltipsAbove.helpPin:after {
|
||||||
|
left: 46%;
|
||||||
|
}
|
||||||
|
.pinCarousel .tooltipsAbove.helpUnpin:after {
|
||||||
|
left: 42%;
|
||||||
|
}
|
||||||
|
|
||||||
.sidebarForkIcon div:after{
|
.sidebarForkIcon div:after{
|
||||||
left: 45%;
|
left: 45%;
|
||||||
}
|
}
|
||||||
|
@ -586,7 +609,7 @@
|
||||||
right: 37% !important;
|
right: 37% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mapInfoIcon div:after, .openCheatsheet div:after, .starMap div:after {
|
.mapInfoIcon div:after, .openCheatsheet div:after, .starMap div:after, .openMetacodeSwitcher div:after, .pinCarousel div:after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 76%;
|
top: 76%;
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
|
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
|
||||||
<div class="openMetacodeSwitcher openLightbox" data-open="switchMetacodes"></div>
|
<div class="openMetacodeSwitcher openLightbox" data-open="switchMetacodes">
|
||||||
|
<div class="tooltipsAbove">Switch Metacodes</div>
|
||||||
|
</div>
|
||||||
|
<div class="pinCarousel">
|
||||||
|
<div class="tooltipsAbove helpPin">Pin Open</div>
|
||||||
|
<div class="tooltipsAbove helpUnpin">Unpin</div>
|
||||||
|
</div>
|
||||||
<div id="metacodeImg">
|
<div id="metacodeImg">
|
||||||
<% @metacodes = [user_metacode()].concat(user_metacodes()).uniq %>
|
<% @metacodes = [user_metacode()].concat(user_metacodes()).uniq %>
|
||||||
<% set = get_metacodeset() %>
|
<% set = get_metacodeset() %>
|
||||||
|
|
|
@ -6,7 +6,12 @@
|
||||||
|
|
||||||
<div class="anypage">
|
<div class="anypage">
|
||||||
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
|
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
|
||||||
<div class="openMetacodeSwitcher openLightbox" data-open="switchMetacodes"></div>
|
<div class="openMetacodeSwitcher openLightbox" data-open="switchMetacodes">
|
||||||
|
<div class="tooltipsAbove">Switch Metacodes</div>
|
||||||
|
</div>
|
||||||
|
<div class="pinCarousel">
|
||||||
|
<div class="tooltipsAbove">Keep Open</div>
|
||||||
|
</div>
|
||||||
<div id="metacodeImg">
|
<div id="metacodeImg">
|
||||||
<% @m = user.settings.metacodes %>
|
<% @m = user.settings.metacodes %>
|
||||||
<% set = @m[0].include?("metacodeset") ? MetacodeSet.find(@m[0].sub("metacodeset-","").to_i) : false %>
|
<% set = @m[0].include?("metacodeset") ? MetacodeSet.find(@m[0].sub("metacodeset-","").to_i) : false %>
|
||||||
|
|
Loading…
Reference in a new issue