From 3863a9d2c5515fe4c61c433503450531098358ec Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 31 May 2013 03:27:15 -0400
Subject: [PATCH] Added user preference to open all popups as standard windows

---
 program/js/app.js |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index d5a66ab..25f7fe9 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1629,18 +1629,25 @@
   // open popup window
   this.open_window = function(url, small, toolbar)
   {
-    var win = this.is_framed() ? parent.window : window,
-      page = $(win),
-      page_width = page.width(),
-      page_height = bw.mz ? $('body', win).height() : page.height(),
-      w = Math.min(small ? this.env.popup_width_small : this.env.popup_width, page_width),
-      h = page_height, // always use same height
-      l = (win.screenLeft || win.screenX) + 20,
-      t = (win.screenTop || win.screenY) + 20,
-      wname = 'rcmextwin' + new Date().getTime(),
-      extwin = window.open(url + (url.match(/\?/) ? '&' : '?') + '_extwin=1', wname,
-        'width='+w+',height='+h+',top='+t+',left='+l+',resizable=yes,location=no,scrollbars=yes'
-        +(toolbar ? ',toolbar=yes,menubar=yes,status=yes' : ',toolbar=no,menubar=no,status=no'));
+    var wname = 'rcmextwin' + new Date().getTime();
+
+    url += (url.match(/\?/) ? '&' : '?') + '_extwin=1';
+
+    if (this.env.standard_windows)
+      extwin = window.open(url, wname);
+    else {
+      var win = this.is_framed() ? parent.window : window,
+        page = $(win),
+        page_width = page.width(),
+        page_height = bw.mz ? $('body', win).height() : page.height(),
+        w = Math.min(small ? this.env.popup_width_small : this.env.popup_width, page_width),
+        h = page_height, // always use same height
+        l = (win.screenLeft || win.screenX) + 20,
+        t = (win.screenTop || win.screenY) + 20,
+        extwin = window.open(url, wname,
+          'width='+w+',height='+h+',top='+t+',left='+l+',resizable=yes,location=no,scrollbars=yes'
+          +(toolbar ? ',toolbar=yes,menubar=yes,status=yes' : ',toolbar=no,menubar=no,status=no'));
+    }
 
     // write loading... message to empty windows
     if (!url && extwin.document) {

--
Gitblit v1.9.1