Skip to content

Commit

Permalink
Add font-awesome rails gem and remove other fontawesome packages from… (
Browse files Browse the repository at this point in the history
publiclab#7938)

* Add font-awesome rails gem and remove other fontawesome packages from files

* Update package.json
  • Loading branch information
Tlazypanda authored Jun 9, 2020
1 parent c63c2be commit 0d511a5
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 51 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ gem 'jquery-atwho-rails'
gem 'lemmatizer', '~> 0.2.2'
# To implement incoming mail processing microframework
gem 'mailman', require: false
# To implement fontawesome v4.7.0
gem "font-awesome-rails"

# To convert html to markdown
gem 'reverse_markdown'
Expand Down
3 changes: 2 additions & 1 deletion app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*= require jquery-file-upload/css/jquery.fileupload-ui.css
*= require leaflet/dist/leaflet.css
*= require_self
*= require font-awesome
*= require cross_browser
*= require style
*= require login_modal
Expand All @@ -36,5 +37,5 @@
*= require jquery.atwho
*= require profile
*= require location
*= require notes
*= require notes
*/
12 changes: 5 additions & 7 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
</script>

<%= stylesheet_link_tag "application", :media => "all" %>
<link href="/lib/@fortawesome/fontawesome-free/css/all.min.css" media="all" rel="stylesheet" type="text/css" />
<link href="/lib/font-awesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css" />
<% if @node && @node.has_tag('style:fancy') %>
<%= stylesheet_link_tag "fancy", :media => "all" %>
<% end %>
Expand Down Expand Up @@ -70,14 +68,14 @@
I18n.fallbacks = true;
$(function () {
$("[data-toggle=popover]").popover({
html: true,
html: true,
content: function() {
return $('#popover-content').html();
}
});
});
</script>

<% cache('feature_header', skip_digest: true) do %>
<%= feature("header") %>
<% end %>
Expand All @@ -91,11 +89,11 @@
background: #BABABA;
}

</style>
</style>

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/10.2.0/bootstrap-slider.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/10.2.0/css/bootstrap-slider.min.css" />

</head>

<body>
Expand Down
65 changes: 32 additions & 33 deletions app/views/tag/graph.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<title>&#127880; Public Lab<%= ": "+(@title || params[:action].capitalize) %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<%= stylesheet_link_tag "application", :media => "all" %>
<link href="/lib/font-awesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css" />
<%= javascript_include_tag "application" %>
</head>
<body>
Expand Down Expand Up @@ -54,7 +53,7 @@ html, body {

data['tags'].forEach(function(tag) {
output.tagnames.push(tag.name);
output.nodes.push({ data: {
output.nodes.push({ data: {
id: tag.name,
weight: tag.count,
href: '/tag/' + tag.name
Expand Down Expand Up @@ -94,86 +93,86 @@ html, body {

layout: {
name: 'cose',

// Called on `layoutready`
ready: function(){},

// Called on `layoutstop`
stop: function(){},

// Whether to animate while running the layout
// true : Animate continuously as the layout is running
// false : Just show the end result
// 'end' : Animate with the end result, from the initial positions to the end positions
animate: true,

// Easing of the animation for animate:'end'
animationEasing: undefined,

// The duration of the animation for animate:'end'
animationDuration: undefined,

// A function that determines whether the node should be animated
// All nodes animated by default on animate enabled
// Non-animated nodes are positioned immediately when the layout starts
animateFilter: function ( node, i ){ return true; },


// The layout animates only after this many milliseconds for animate:true
// (prevents flashing on fast runs)
animationThreshold: 250,

// Number of iterations between consecutive screen positions update
refresh: 20,

// Whether to fit the network view after when done
fit: true,

// Padding on fit
padding: 30,

// Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
boundingBox: undefined,

// Excludes the label when calculating node bounding boxes for the layout algorithm
nodeDimensionsIncludeLabels: false,

// Randomize the initial positions of the nodes (true) or use existing positions (false)
randomize: false,

// Extra spacing between components in non-compound graphs
componentSpacing: 100,

// Node repulsion (non overlapping) multiplier
nodeRepulsion: function( node ){ return 2048; },

// Node repulsion (overlapping) multiplier
nodeOverlap: 50,

// Ideal edge (non nested) length
idealEdgeLength: function( edge ){ return 100; },

// Divisor to compute edge forces
edgeElasticity: function( edge ){ return 32; },

// Nesting factor (multiplier) to compute ideal edge length for nested edges
nestingFactor: 1.2,

// Gravity force (constant)
gravity: 1,

// Maximum number of iterations to perform
numIter: 1000,

// Initial temperature (maximum node displacement)
initialTemp: 1000,

// Cooling factor (how the temperature is reduced between consecutive iterations
coolingFactor: 0.99,

// Lower temperature threshold (below this point the layout will end)
minTemp: 1.0,

// Pass a reference to weaver to use threads for calculations
weaver: false
},
Expand Down Expand Up @@ -254,12 +253,12 @@ html, body {
});
*/

// https://sashat.me/2017/01/11/list-of-20-simple-distinct-colors/
// https://sashat.me/2017/01/11/list-of-20-simple-distinct-colors/
var colors = ['#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe', '#008080', '#e6beff', '#9a6324', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080', '#ffffff', '#000000', '#999999'];

// clusters[0].forEach(function(n){n.style('backgroundColor','blue');})


community = jLouvain()
.nodes(data.tagnames)
.edges(data.edges)
Expand All @@ -271,7 +270,7 @@ html, body {
if (index > colors.length) index = colors.length - 1;
color = colors[index];
node.style('backgroundColor', color);
});
});

}

Expand Down
1 change: 0 additions & 1 deletion app/views/tag/gridsEmbed.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/application.js" type="text/javascript"></script>
<link href="/lib/font-awesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css" />
<style>
body { padding: 0; }
div.leaflet-map { height:100% !important; }
Expand Down
1 change: 0 additions & 1 deletion app/views/tag/widget.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= stylesheet_link_tag "application", :media => "all" %>
<link href="/lib/font-awesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css" />

<style>
body {
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"url": "https://github.com/publiclab/plots2/issues"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
"blob.js": "^1.0.1",
"blueimp-file-upload": "blueimp/jQuery-File-Upload#^10.7.0",
"bootstrap": "4.1.0",
Expand All @@ -29,7 +28,6 @@
"cytoscape": "^3.15.0",
"debounce": "jywarren/debounce#patch-1",
"file-saver": "^2.0.0",
"font-awesome": "^4.5.0",
"i18n-js": "^3.7.0",
"ics": "nwcell/ics.js#^0.2.0",
"image-sequencer": "^3.5.1",
Expand Down
1 change: 0 additions & 1 deletion public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="/assets/application.js" type="text/javascript"></script>
<link href="/lib/fontawesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css" />
</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion public/422.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="/assets/application.js" type="text/javascript"></script>
<link href="/lib/fontawesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css" />
</head>

<body>
Expand Down
3 changes: 1 addition & 2 deletions public/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="/assets/application.js" type="text/javascript"></script>
<link href="/lib/fontawesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css" />
</head>

<body>
Expand Down Expand Up @@ -60,7 +59,7 @@ <h2>There was an error. <small>Are you sure you have the right address?</small><
</ul>

<p><a class="btn btn-primary" href="https://github.com/publiclab/plots2/issues/new" target="_blank">Report a bug on Github</a> <a class="btn btn-primary" href="https://oss.skylight.io/app/applications/GZDPChmcfm1Q/recent/6h/endpoints" target="_blank">Check if the site is running slow</a> or, send an email to <a href="mailto:[email protected]">[email protected]</a> with the above information.</p>

<p>Thank you for helping to improve open source software!.</p>

<hr />
Expand Down
1 change: 0 additions & 1 deletion public/502.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<![endif]-->
<script src="https://code.jquery.com/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="/assets/application.js" type="text/javascript"></script>
<link href="/lib/fontawesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css" />
</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion public/503.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<![endif]-->
<script src="https://code.jquery.com/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="/assets/application.js" type="text/javascript"></script>
<link href="/lib/fontawesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css" />
</head>

<body>
Expand Down

0 comments on commit 0d511a5

Please sign in to comment.