mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-11-03 19:30:54 +00:00 
			
		
		
		
	Change JS/CSS to load from local box
This commit is contained in:
		
							parent
							
								
									d2b7204319
								
							
						
					
					
						commit
						b2a8fe3d4c
					
				@ -9,7 +9,7 @@
 | 
			
		||||
 | 
			
		||||
        <meta name="robots" content="noindex, nofollow">
 | 
			
		||||
 | 
			
		||||
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
 | 
			
		||||
        <link rel="stylesheet" href="/admin/static/assets/css/lib/bootstrap.min.css">
 | 
			
		||||
        <style>
 | 
			
		||||
	    body {
 | 
			
		||||
		overflow-y: scroll;
 | 
			
		||||
@ -63,7 +63,7 @@
 | 
			
		||||
	       margin-bottom: 1em;
 | 
			
		||||
	    }
 | 
			
		||||
        </style>
 | 
			
		||||
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
 | 
			
		||||
        <link rel="stylesheet" href="/admin/static/assets/css/lib/bootstrap-theme.min.css">
 | 
			
		||||
    </head>
 | 
			
		||||
    <body>
 | 
			
		||||
 | 
			
		||||
@ -191,8 +191,8 @@
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" integrity="sha256-rsPUGdUPBXgalvIj4YKJrrUlmLXbOb6Cp7cdxn1qeUc=" crossorigin="anonymous"></script>
 | 
			
		||||
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
 | 
			
		||||
        <script src="/admin/static/assets/js/lib/jquery.min.js"></script>
 | 
			
		||||
        <script src="/admin/static/assets/js/lib/bootstrap.min.js"></script>
 | 
			
		||||
 | 
			
		||||
        <script>
 | 
			
		||||
var global_modal_state = null;
 | 
			
		||||
@ -218,7 +218,7 @@ $(function() {
 | 
			
		||||
    if (global_modal_state == null) global_modal_state = 1; // cancel if the user hit ESC or clicked outside of the modal
 | 
			
		||||
    if (global_modal_funcs && global_modal_funcs[global_modal_state])
 | 
			
		||||
      global_modal_funcs[global_modal_state]();
 | 
			
		||||
  })  
 | 
			
		||||
  })
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
function show_modal_error(title, message, callback) {
 | 
			
		||||
@ -281,7 +281,7 @@ function ajax_with_indicator(options) {
 | 
			
		||||
  };
 | 
			
		||||
  options.error = function(jqxhr) {
 | 
			
		||||
    hide_loading_indicator();
 | 
			
		||||
    if (!old_error) 
 | 
			
		||||
    if (!old_error)
 | 
			
		||||
      show_modal_error("Error", "Something went wrong, sorry.")
 | 
			
		||||
    else
 | 
			
		||||
      old_error(jqxhr.responseText, jqxhr);
 | 
			
		||||
 | 
			
		||||
@ -61,6 +61,41 @@ if [ ! -f $STORAGE_ROOT/backup/secret_key.txt ]; then
 | 
			
		||||
	$(umask 077; openssl rand -base64 2048 > $STORAGE_ROOT/backup/secret_key.txt)
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Download jQuery and Bootstrap local files
 | 
			
		||||
 if [ ! -d $HOME/mailinabox/management/static ]; then
 | 
			
		||||
 | 
			
		||||
   js_lib=$HOME/mailinabox/management/static/assets/js/lib
 | 
			
		||||
   css_lib=$HOME/mailinabox/management/static/assets/css/lib
 | 
			
		||||
 | 
			
		||||
	 # jQuery CDN URL
 | 
			
		||||
	 jquery_version=2.1.4
 | 
			
		||||
   jquery_url=https://code.jquery.com
 | 
			
		||||
 | 
			
		||||
   # Bootstrap CDN URL
 | 
			
		||||
   bootstrap_version=3.3.7
 | 
			
		||||
   bootstrap_url=https://maxcdn.bootstrapcdn.com/bootstrap/$bootstrap_version
 | 
			
		||||
 | 
			
		||||
	# Get the Javascript files
 | 
			
		||||
	if [ ! -d $js_lib ]; then
 | 
			
		||||
		mkdir -p $js_lib
 | 
			
		||||
 | 
			
		||||
		wget_verify $jquery_url/jquery-$jquery_version.min.js 43dc554608df885a59ddeece1598c6ace434d747 $js_lib/jquery.min.js
 | 
			
		||||
		wget_verify $bootstrap_url/js/bootstrap.min.js 430a443d74830fe9be26efca431f448c1b3740f9 $js_lib/bootstrap.min.js
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	# Get the CSS(map) files
 | 
			
		||||
	if [ ! -d $css_lib ]; then
 | 
			
		||||
		mkdir -p $css_lib
 | 
			
		||||
 | 
			
		||||
		wget_verify $bootstrap_url/css/bootstrap-theme.min.css 8256575374f430476bdcd49de98c77990229ce31 $css_lib/bootstrap-theme.min.css
 | 
			
		||||
		wget_verify $bootstrap_url/css/bootstrap-theme.min.css.map 87f7dfd79d77051ac2eca7d093d961fbd1c8f6eb $css_lib/bootstrap-theme.min.css.map
 | 
			
		||||
		wget_verify $bootstrap_url/css/bootstrap.min.css 6527d8bf3e1e9368bab8c7b60f56bc01fa3afd68 $css_lib/bootstrap.min.css
 | 
			
		||||
		wget_verify $bootstrap_url/css/bootstrap.min.css.map e0d7b2bde55a0bac1b658a507e8ca491a6729e06 $css_lib/bootstrap.min.css.map
 | 
			
		||||
	fi
 | 
			
		||||
 fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Link the management server daemon into a well known location.
 | 
			
		||||
rm -f /usr/local/bin/mailinabox-daemon
 | 
			
		||||
ln -s `pwd`/management/daemon.py /usr/local/bin/mailinabox-daemon
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user