Assets management

amielel wrote on Sunday, April 17, 2016:

Hi!

We’d like to propose a feature that enables to inject custom assets (JS and CSS files) from a folder to header of every page. The assets folder’s path is set via global conf.

Should call it “poor man’s assets management" :slight_smile:

We would appreciate a feedback.

Thanks.
Amiel

visolveemr wrote on Monday, April 18, 2016:

Hi,

To change the overall style in OpenEMR, you can write your own CSS and include in the following path:
/interface/themes. Once this is added, you can activate this style in Administration -> Globals -> Appearance -> Themes.

SInce openEMR has 3 frames, you need to include the JS files in each of these frames.

Thanks
OpenEMR Customization/Support Team,
ViSolve Inc
services@visolve.com | Phone: 408-850-2243
Demo’s @ ViSolve Demo Library

amielel wrote on Tuesday, May 03, 2016:

I’ve edited the original post.

mdsupport wrote on Saturday, September 03, 2016:

We had a simillar proposal sometime ago that abstracted the application functionality and condensed the developer’s understanding into a central php script. As an example, calendar in current codebase requires a combination of css and js files as well as some php code (if made into a class or a function). Advantage of this approach is script developer adds a single self documenting line that does not change with version upgrades or filesystem updates.

Since the community reaction was that approach did not fix all problems of current approach, we limited its use to our custom changes. It simplifies assets management significantly - e.g changes due to recent public/assets scheme were limited to this single file.

It is unlikely that there is a perfect solution for every need of every developer. But feel free to play with a small fragment available in our repo :

feature = [feature] + [stylesheet] + [javascript] + [php include]

As an example, on Fax/Scan screen we use jQuery qTip to show the image bypassing current process by adding this code before as :

<?php
require_once("$srcdir/insert_features.inc");
insert_feature('qTip');
?>
<script type='text/javascript'>
$("a.click_qtip").each(function() {
		var sfname = $(this).text();
		var qtip_cont = '<div>' + sfname + '<br>' +
		       '<iframe class="qtip-box" src="fax_view.php?scan=' + sfname + '" /></div>';
	  ShowQtip (this, qtip_cont);
  </script>
  </body>

bradymiller wrote on Sunday, September 04, 2016:

Hi MD Support,

That’s a very neat script/mechanism. When the project gets a handle on the current assets, then is something to consider. What are your thoughts on assetic?
https://github.com/kriswallsmith/assetic

-brady
OpenEMR