Changeset 6503
- Timestamp:
- Aug 6, 2014, 9:04:46 AM (8 years ago)
- Location:
- branches/3.3-stable
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-stable/src/clients/web/net/sf/basedb/clients/web/taglib/Body.java
r6192 r6503 217 217 sb.append(" data-project-id=\"").append(sc.getActiveProjectId()).append("\""); 218 218 } 219 sb.append(" data-remember-dialog-positions=\"").append(Values.getString(sc.getUserClientSetting("dialogs.remember-positions"), "1")).append("\""); 219 220 if (message == null) 220 221 { -
branches/3.3-stable/src/clients/web/net/sf/basedb/clients/web/taglib/Head.java
r6402 r6503 183 183 allScripts.add("menu.js"); 184 184 } 185 if (pageType == Page.PAGE_TYPE_POPUP) allScripts.add("popup.js"); 185 186 if (getScripts() != null) 186 187 { -
branches/3.3-stable/www/include/scripts/main-2.js
r6489 r6503 52 52 app.getLoggedInUserId = function() 53 53 { 54 return Data. get(document.body, 'user-id');54 return Data.int(document.body, 'user-id'); 55 55 } 56 56 … … 60 60 app.getActiveProjectId = function() 61 61 { 62 return Data. get(document.body, 'project-id');62 return Data.int(document.body, 'project-id'); 63 63 } 64 64 … … 69 69 app.getScale = function() 70 70 { 71 return Data. get(document.body, 'gui-scale');71 return Data.int(document.body, 'gui-scale'); 72 72 } 73 73 … … 79 79 app.getMaxUrlLength = function() 80 80 { 81 return Data.get(document.body, 'max-url-length', 0); 81 return Data.int(document.body, 'max-url-length', 0); 82 } 83 84 /** 85 Check if popup dialog positions should be remembered or not. 86 */ 87 app.rememberDialogPositions = function() 88 { 89 return Data.int(document.body, 'remember-dialog-positions', 1); 82 90 } 83 91 … … 1197 1205 dialogs.openPopup = function(url, name, width, height) 1198 1206 { 1199 1200 // Rescale according to user settings 1201 var scale = App.getScale(); 1202 width = width * scale; 1203 height = height * scale; 1204 1205 /* 1206 We will try to position the popup window in the center of 1207 the parent window. 1208 */ 1209 var pos = App.getWindowPosition(window.top); 1210 var top = Math.ceil(pos.top+(pos.height-height) / 2); 1211 var left = Math.ceil(pos.left+(pos.width-width) / 2); 1212 if (top < 0 && pos.top >= 0) top = 0; 1213 if (left < 0 && pos.left >= 0) left = 0; 1207 // Get last position of the window 1208 var position = null; 1209 if (App.rememberDialogPositions()) 1210 { 1211 position = Data.getPageValue("last-position", name); 1212 } 1213 1214 if (!position) 1215 { 1216 // If no last position is know, use the specified settings 1217 position = {}; 1218 // Rescale according to user settings 1219 var scale = App.getScale(); 1220 position.width = width * scale; 1221 position.height = height * scale; 1222 1223 // Try to position the popup window in the center of the parent window. 1224 var pos = App.getWindowPosition(window.top); 1225 var top = Math.ceil(pos.top+(pos.height-height) / 2); 1226 var left = Math.ceil(pos.left+(pos.width-width) / 2); 1227 position.top = (top < 0 && pos.top >= 0) ? 0 : top; 1228 position.left = (left < 0 && pos.left >= 0) ? 0 : left; 1229 } 1214 1230 1215 1231 var options = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes"; 1216 options += ",top="+top+",left="+left+",width="+width+",height="+height;1217 1218 1232 // Check if another window with the same name already exists 1219 var oldWin = window.open('', name, options );1233 var oldWin = window.open('', name, options+",top="+position.top+",left="+position.left+",width="+position.width+",height="+position.height); 1220 1234 try 1221 1235 { … … 1229 1243 return; 1230 1244 } 1245 position = App.getWindowPosition(oldWin); 1231 1246 oldWin.close(); 1232 1247 url += '&warnIfOpen=0'; … … 1236 1251 {} 1237 1252 1253 options += ",top="+position.top+",left="+position.left+",width="+position.width+",height="+position.height; 1238 1254 var newWin; 1239 1255 if (App.isTooLongUrl(url)) -
branches/3.3-stable/www/my_base/user/preferences.jsp
r6187 r6503 75 75 final String maxColor = Values.getString(sc.getUserClientSetting("ratiocolor.max"), "FFFF00"); 76 76 77 final boolean rememberDialogPositions = Values.getBoolean(sc.getUserClientSetting("dialogs.remember-positions"), true); 78 77 79 ItemContext cc = sc.getCurrentContext(Item.USERCLIENTSETTING); 78 80 List<String> recentColors = cc.getRecent("colors"); … … 295 297 </td> 296 298 </tr> 299 <tr> 300 <th>Dialogs</th> 301 <td> 302 <label><input type="checkbox" name="remember_positions" value="1" 303 <%=rememberDialogPositions ? "checked" : "" %> 304 >Remember positions</label> 305 </td> 306 </tr> 297 307 <tr class="dynamic"> 298 308 <th></th> -
branches/3.3-stable/www/my_base/user/submit_user.jsp
r6428 r6503 152 152 FormatterSettings.setNumDecimals(sc, numDecimals); 153 153 154 sc.setUserClientSetting("dialogs.remember-positions", Values.getBoolean(request.getParameter("remember_positions")) ? "1" : "0"); 155 154 156 // Plugins tab 155 157 sc.setUserClientSetting("plugins.sendmessage", Values.getString(request.getParameter("sendmessage"), "0"));
Note: See TracChangeset
for help on using the changeset viewer.