convert javascript to asset_path syntax

This commit is contained in:
Devin Howard 2015-10-23 22:56:09 +08:00 committed by Connor Turland
parent 6e9b0ac9ef
commit 235aa7a6b3
4 changed files with 9 additions and 9 deletions

View file

@ -3127,7 +3127,7 @@ var Canvas;
ctx = base.getCtx(),
scale = base.scaleOffsetX;
//var pattern = new Image();
//pattern.src = "/assets/cubes.png";
//pattern.src = "<%= asset_path('cubes.png') %>";
//var ptrn = ctx.createPattern(pattern, 'repeat');
//ctx.fillStyle = ptrn;
ctx.fillStyle = Metamaps.Settings.colors.background;

View file

@ -495,7 +495,7 @@ Metamaps.GlobalUI.Search = {
dataset.push({
value: "No results",
label: "No results",
typeImageURL: "/assets/icons/wildcard.png",
typeImageURL: "<%= asset_path('icons/wildcard.png') %>",
rtype: "noresult"
});
}
@ -549,7 +549,7 @@ Metamaps.GlobalUI.Search = {
filter: function (dataset) {
if (dataset.length == 0) {
dataset.push({
profile: "/assets/user.png",
profile: "<%= asset_path('user.png') %>",
value: "No results",
label: "No results",

View file

@ -29,10 +29,10 @@ Metamaps.JIT = {
$(".takeScreenshot").click(Metamaps.Map.exportImage);
self.topicDescImage = new Image();
self.topicDescImage.src = '/assets/topic_description_signifier.png';
self.topicDescImage.src = '<%= asset_path('topic_description_signifier.png') %>';
self.topicLinkImage = new Image();
self.topicLinkImage.src = '/assets/topic_link_signifier.png';
self.topicLinkImage.src =<%= asset_path('topic_link_signifier.png') %>';
},
/**
* convert our topic JSON into something JIT can use

View file

@ -337,7 +337,7 @@ Metamaps.Backbone.init = function () {
prepareLiForFilter: function () {
var li = '';
li += '<li data-id="' + this.get('desc') + '">';
li += '<img src="/assets/synapse16.png"';
li += '<img src="<%= asset_path('synapse16.png') %>"';
li += ' alt="synapse icon" />';
li += '<p>' + this.get('desc') + '</p></li>';
return li;
@ -4791,7 +4791,7 @@ Metamaps.Map.InfoBox = {
obj["map_creator_tip"] = isCreator ? self.changePermissionText : "";
obj["contributors_class"] = Metamaps.Mappers.length > 1 ? "multiple" : "";
obj["contributors_class"] += Metamaps.Mappers.length === 2 ? " mTwo" : "";
obj["contributor_image"] = Metamaps.Mappers.length > 0 ? Metamaps.Mappers.models[0].get("image") : "/assets/user.png";
obj["contributor_image"] = Metamaps.Mappers.length > 0 ? Metamaps.Mappers.models[0].get("image") : "<%= asset_path('user.png') %>";
obj["contributor_list"] = self.createContributorList();
obj["user_name"] = isCreator ? "You" : map.get("user_name");
obj["created_at"] = map.get("created_at_clean");
@ -4888,7 +4888,7 @@ Metamaps.Map.InfoBox = {
if (Metamaps.Mappers.length === 2) contributors_class = "multiple mTwo";
else if (Metamaps.Mappers.length > 2) contributors_class = "multiple";
var contributors_image = "/assets/user.png";
var contributors_image = "<%= asset_path('user.png') %>";
if (Metamaps.Mappers.length > 0) {
// get the first contributor and use their image
contributors_image = Metamaps.Mappers.models[0].get("image");
@ -5069,7 +5069,7 @@ Metamaps.Account = {
var self = Metamaps.Account;
$('.userImageDiv canvas').remove();
$('.userImageDiv img').attr('src', '/assets/user.png').show();
$('.userImageDiv img').attr('src', '<%= asset_path('user.png') %>').show();
$('.userImageMenu').hide();
var input = $('#user_image');