This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-19
Channels
- # admin-announcements (8)
- # beginners (90)
- # boot (69)
- # bristol-clojurians (3)
- # cider (32)
- # cljs-dev (2)
- # cljsrn (22)
- # clojure (45)
- # clojure-art (2)
- # clojure-poland (102)
- # clojure-russia (91)
- # clojurescript (38)
- # cursive (27)
- # datomic (45)
- # devcards (7)
- # emacs (45)
- # gorilla (25)
- # hoplon (3)
- # jobs (1)
- # ldnclj (7)
- # off-topic (4)
- # om (176)
- # onyx (3)
- # portland-or (7)
- # re-frame (12)
- # reagent (64)
- # yada (26)
@pez Sounds like Gorilla isn't serving up the files ... I wonder whether you're seeing the menu because of browser caching. Is there anything in the project which might interfere with Gorilla's server?
@jonyepsilon: I don’t know what in the project that could interfere… Or even how it could interfere. But yes, since it works in a fresh project I am leaning towards that as well.
As for caching, clearing the cache doesn’t make a difference. Running fresh in another browser gives the same errors and the same behaviour.
Huh. Would be interesting to look at http://127.0.0.1:8990/js/utils.js and see what returns (adjusting the port number to suit).
'use strict';
/**
* Get a deep value from an object by a string path
* For example:
* var foo = {'bar': {'lurker': 'someValue'}}
* getValByPath(foo, 'bar.lurker') returns 'someValue'
*
* @param obj obj
* @param str path
* @return mixed
*/
exports.getValByPath = function(obj, path) {
var p;
if (typeof path === 'string') {
path = path.split('.');
}
if (path.length > 1) {
p = path.shift();
if (typeof obj[p] === 'object') {
return exports.getValByPath(obj[p], path);
} else {
return undefined;
}
} else {
return obj[path[0]];
}
};
That's very odd ... that's not Gorilla REPL code! Should be:
/*
* This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
*
* gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
*/
// takes a string and prefixes every line with ';; '
var makeClojureComment = function (code) {
return code.split('\n').map(function (x) {
return ";;; " + x;
}).join("\n")
};
// the funny name indicates that it undoes what the above function does. It doesn't check whether the line is actually
// commented, so will break text that isn't in the format it expects.
var unmakeClojureComment = function (code) {
if (code) {
return code.split('\n').map(function (x) {
return x.slice(4);
}).join("\n");
}
else return null;
};
var makeHipNSName = function () {
// The word lists are taken from Raymond Chan's MIT-licensed
var adj = ["affectionate", "amiable", "arrogant", "balmy", "barren", "benevolent", "billowing", "blessed", "breezy", "calm", "celestial", "charming", "combative", "composed", "condemned", "divine", "dry", "energized", "enigmatic", "exuberant", "flowing", "fluffy", "fluttering", "frightened", "fuscia", "gentle", "greasy", "grieving", "harmonious", "hollow", "homeless", "icy", "indigo", "inquisitive", "itchy", "joyful", "jubilant", "juicy", "khaki", "limitless", "lush", "mellow", "merciful", "merry", "mirthful", "moonlit", "mysterious", "natural", "outrageous", "pacific", "parched", "placid", "pleasant", "poised", "purring", "radioactive", "resilient", "scenic", "screeching", "sensitive", "serene", "snowy", "solitary", "spacial", "squealing", "stark", "stunning", "sunset", "talented", "tasteless", "teal", "thoughtless", "thriving", "tranquil", "tropical", "undisturbed", "unsightly", "unwavering", "uplifting", "voiceless", "wandering", "warm", "wealthy", "whispering", "withered", "wooden", "zealous"];
var things = ["abyss", "atoll", "aurora", "autumn", "badlands", "beach", "briars", "brook", "canopy", "canyon", "cavern", "chasm", "cliff", "cove", "crater", "creek", "darkness", "dawn", "desert", "dew", "dove", "drylands", "dusk", "farm", "fern", "firefly", "flowers", "fog", "foliage", "forest", "galaxy", "garden", "geyser", "grove", "hurricane", "iceberg", "lagoon", "lake", "leaves", "marsh", "meadow", "mist", "moss", "mountain", "oasis", "ocean", "peak", "pebble", "pine", "plateau", "pond", "reef", "reserve", "resonance", "sanctuary", "sands", "shelter", "silence", "smokescreen", "snowflake", "spring", "storm", "stream", "summer", "summit", "sunrise", "sunset", "sunshine", "surf", "swamp", "temple", "thorns", "tsunami", "tundra", "valley", "volcano", "waterfall", "willow", "winds", "winter"];
var adjI = Math.floor(Math.random() * adj.length);
var thingsI = Math.floor(Math.random() * things.length);
return adj[adjI] + "-" + things[thingsI];
};
Wonder where that code is coming from ... don't find getValByPath(foo, 'bar.lurker') returns 'someValue'
on Google anywhere.
Key will be figuring out where that comes from, I guess. Any plugins in your profiles.clj that could be messing with ring routes etc?
Oh, I wonder ... Gorilla serves its files out of the jar's resources. If you're project has resources with the same path (that is resources\public\js\utils.js
then this could happen. Never thought of that!
Probably Gorilla should put it's resources somewhere with an unlikely name to avoid this sort of clash.
Yeah, that would work. Should be an easy fix. Was hoping to get a new version out soonish and will put it in that.
Glad we got to the bottom of it
Thanks Glad you find them useful!