diff --git a/.gitignore b/.gitignore index 61b843fc..6dae9733 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,8 @@ # Eclipse project files -.classpath -.project .settings/ test-output/ -# IntelliJ project files +# IntelliJ project files .idea/ *.iws *.iml @@ -36,4 +34,5 @@ manifest.mf Out/ Out*/ *.lic -Data/*Out* \ No newline at end of file +Data/*Out* +/.metadata/ diff --git a/Examples.GridWeb/README.md b/Examples.GridWeb/README.md deleted file mode 100644 index c8598b43..00000000 --- a/Examples.GridWeb/README.md +++ /dev/null @@ -1,3 +0,0 @@ -##Aspose.Cells GridWeb Examples - -This directory contains Java examples for [Aspose.Cells](http://www.aspose.com/java/excel-component.aspx) GridWeb. diff --git a/Examples.GridWeb/pom.xml b/Examples.GridWeb/pom.xml deleted file mode 100644 index cc766850..00000000 --- a/Examples.GridWeb/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - 4.0.0 - com.aspose - cells-gridweb-examples - war - 1.0-SNAPSHOT - cells-gridweb-examples Maven Webapp - http://maven.apache.org - - - com.aspose - aspose-gridweb - 8.6.2 - - - javax - javaee-web-api - 7.0 - provided - - - - cells-gridweb-examples - - - org.apache.tomcat.maven - tomcat7-maven-plugin - 2.2 - - - - - - aspose-maven-repository - http://maven.aspose.com/repository/repo/ - - - diff --git a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/TestGridWebBaseServlet.java b/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/TestGridWebBaseServlet.java deleted file mode 100755 index 6d336b22..00000000 --- a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/TestGridWebBaseServlet.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.aspose.gridweb.test; - -import java.io.IOException; -import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.aspose.gridweb.ExtPage; -import com.aspose.gridweb.GridWebBean; -import com.aspose.gridweb.Unit; -import com.aspose.gridweb.test.util.FileUtil; - -public abstract class TestGridWebBaseServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - protected ExtPage page =ExtPage.getInstance(); - protected PrintWriter out = null; - protected String path = null; - protected String webPath = null; - - - protected void doGet(HttpServletRequest request, HttpServletResponse response) { - - doPost(request, response); - } - - protected void doPost(HttpServletRequest request, HttpServletResponse response) { - - GridWebBean gridweb=page.getBean(request); - //we shall call it to update request and response in gridweb before render - gridweb.setReqRes(request, response); - try { - request.setCharacterEncoding("UTF-8"); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - response.setCharacterEncoding("UTF-8"); - path = request.getServletContext().getRealPath("/"); - webPath = request.getServletContext().getContextPath(); - - try { - out = response.getWriter(); - - - // do the reflect method - this.process(gridweb,request, response); - - gridweb.prepareRender(); - String html = gridweb.getHTMLBody(); - out.print(html); -// FileUtil.putFile(html); - - out.flush(); - - } catch (IOException e) { - e.printStackTrace(); - }finally{ - out.close(); - } - - } - - @SuppressWarnings("unchecked") - public void process(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - String action = request.getParameter("flag"); - if (action == null) { - return; - } - - @SuppressWarnings("rawtypes") - Class clz = this.getClass(); - Method method = null; - try { - method = clz.getDeclaredMethod(action,GridWebBean.class, HttpServletRequest.class, HttpServletResponse.class); - method.invoke(this,gridweb, request, response); - } catch (SecurityException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } - - // the default Reload data - protected void reloadfile(GridWebBean gridweb,HttpServletRequest request, String file) { - - - - gridweb.setWidth(Unit.Pixel(800)); - gridweb.setHeight(Unit.Pixel(400)); - String filename = null; - path = request.getServletContext().getRealPath("/"); - try { - gridweb.importExcelFile(path + "file\\" + file); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - public abstract void reload(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response); - -} diff --git a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/FeatureServlet.java b/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/FeatureServlet.java deleted file mode 100755 index c258eb3d..00000000 --- a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/FeatureServlet.java +++ /dev/null @@ -1,467 +0,0 @@ -package com.aspose.gridweb.test.servlet; - -import java.lang.reflect.Field; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.aspose.gridweb.BorderStyle; -import com.aspose.gridweb.CellErrorHandler; -import com.aspose.gridweb.CellEventArgs; -import com.aspose.gridweb.CellEventHandler; -import com.aspose.gridweb.CellEventStringHandler; -import com.aspose.gridweb.Color; -import com.aspose.gridweb.CustomCommandEventHandler; -import com.aspose.gridweb.GridCellException; -import com.aspose.gridweb.GridCells; -import com.aspose.gridweb.GridHyperlink; -import com.aspose.gridweb.GridTableItemStyle; -import com.aspose.gridweb.GridWebBean; -import com.aspose.gridweb.GridWorksheet; -import com.aspose.gridweb.GridWorksheetCollection; -import com.aspose.gridweb.HorizontalAlign; -import com.aspose.gridweb.OnErrorActionQuery; -import com.aspose.gridweb.PresetStyle; -import com.aspose.gridweb.RowColumnEventArgs; -import com.aspose.gridweb.RowColumnEventHandler; -import com.aspose.gridweb.Unit; -import com.aspose.gridweb.VerticalAlign; -import com.aspose.gridweb.WorkbookEventHandler; -import com.aspose.gridweb.test.TestGridWebBaseServlet; - -public class FeatureServlet extends TestGridWebBaseServlet { - private static final long serialVersionUID = 1L; - - - - @Override - public void reload(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"data.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void loadFreezePaneFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"freezepane.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridWorksheet gridWorksheet = gridWorksheetCollection.get(gridWorksheetCollection.getActiveSheetIndex()); - gridWorksheet.freezePanes(3, 3, 3, 3); - } - - public void freezePane(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - int row = Integer.parseInt(request.getParameter("row")); - int column = Integer.parseInt(request.getParameter("column")); - int rowNumber = Integer.parseInt(request.getParameter("rowNumber")); - int columnNumber = Integer.parseInt(request.getParameter("columnNumber")); - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridWorksheet gridWorksheet = gridWorksheetCollection.get(gridWorksheetCollection.getActiveSheetIndex()); - gridWorksheet.freezePanes(row, column, rowNumber, columnNumber); - } - - public void unfreezePane(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridWorksheet gridWorksheet = gridWorksheetCollection.get(gridWorksheetCollection.getActiveSheetIndex()); - gridWorksheet.unFreezePanes(); - } - - public void customHeaders(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - gridWorksheetCollection.clear(); - int index = gridWorksheetCollection.add(); - // gridWorkSheet - GridWorksheet gridWorkSheet = gridWorksheetCollection.get(index); - gridWorkSheet.setColumnCaption(0, "Product"); - gridWorkSheet.setColumnCaption(1, "Category"); - gridWorkSheet.setColumnCaption(2, "Price"); - - GridCells gridCells = gridWorkSheet.getCells(); - gridCells.get("A1").setValue("Aniseed Syrup"); - gridCells.get("A2").setValue("Boston Crab Meat"); - gridCells.get("A3").setValue("Chang"); - - gridCells.get("B1").setValue("Condiments"); - gridCells.get("B2").setValue("Seafood"); - gridCells.get("B3").setValue("Beverages"); - - } - - public void loadDateTimeFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"datetime.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void loadTextAndDataFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"TextAndData.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void loadMathFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"Math.xls"); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void loadLogicalFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"Logical.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void loadStatisticalFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"Statistical.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void loadSkinsFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"Skins.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void changeStyle(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - String style = request.getParameter("style"); - - if (style.startsWith("Custom")) { - String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + webPath - + "/"; - String url = basePath + "xml/" + style + ".xml"; - gridweb.setCustomStyleFileName(url); - return; - } - - Field[] fields = PresetStyle.class.getDeclaredFields(); - int presetStyle = PresetStyle.STANDARD; - for (Field field : fields) { - if (field.getName().equalsIgnoreCase(style)) { - try { - presetStyle = field.getInt(field.getName()); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } - gridweb.setPresetStyle(presetStyle); - } - - public void pagination(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"employeesales.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - - gridweb.setPageSize(20); - } - - public void sort(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"sort.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - - - // Creates sortting header style. - GridTableItemStyle gridTableItemStyle = new GridTableItemStyle(); - gridTableItemStyle.setBorderStyle(BorderStyle.Outset); - gridTableItemStyle.setBorderWidth(new Unit(2)); - gridTableItemStyle.setBorderColor(Color.getWhite()); - gridTableItemStyle.setBackColor(Color.getSilver()); - gridTableItemStyle.setHorizontalAlign(HorizontalAlign.Center); - gridTableItemStyle.setVerticalAlign(VerticalAlign.Middle); - - // Creates Hyperlinks. - final GridWorksheet sheet = gridweb.getWorkSheets().get(0); - sheet.getCells().get("A1").copyStyle(gridTableItemStyle); - int i = sheet.getHyperlinks().add("A1", 1, 1, ""); - GridHyperlink hlink = sheet.getHyperlinks().get(i); - hlink.setAddress("CELLCMD:A1"); - hlink.setTextToDisplay("orderid"); - - sheet.getCells().get("B1").copyStyle(gridTableItemStyle); - i = sheet.getHyperlinks().add("B1", 1, 1, ""); - hlink = sheet.getHyperlinks().get(i); - hlink.setAddress("CELLCMD:B1"); - hlink.setTextToDisplay("Sales Amout"); - - sheet.getCells().get("C1").copyStyle(gridTableItemStyle); - i = sheet.getHyperlinks().add("C1", 1, 1, ""); - hlink = sheet.getHyperlinks().get(i); - hlink.setAddress("CELLCMD:C1"); - hlink.setTextToDisplay("Percent of Saler's Total"); - - sheet.getCells().get("D1").copyStyle(gridTableItemStyle); - i = sheet.getHyperlinks().add("D1", 1, 1, ""); - hlink = sheet.getHyperlinks().get(i); - hlink.setAddress("CELLCMD:D1"); - hlink.setTextToDisplay("Percent of Country Total"); - - final GridWorksheet sheet1 = gridweb.getWorkSheets().get(1); - - sheet1.getCells().get("A1").copyStyle(gridTableItemStyle); - i = sheet1.getHyperlinks().add("A1", 1, 1, ""); - hlink = sheet1.getHyperlinks().get(i); - hlink.setAddress("CELLCMD:1A1"); - hlink.setTextToDisplay("Product"); - - sheet1.getCells().get("A2").copyStyle(gridTableItemStyle); - i = sheet1.getHyperlinks().add("A2", 1, 1, ""); - hlink = sheet1.getHyperlinks().get(i); - hlink.setAddress("CELLCMD:1A2"); - hlink.setTextToDisplay("Category"); - - sheet1.getCells().get("A3").copyStyle(gridTableItemStyle); - i = sheet1.getHyperlinks().add("A3", 1, 1, ""); - hlink = sheet1.getHyperlinks().get(i); - hlink.setAddress("CELLCMD:1A3"); - hlink.setTextToDisplay("Package"); - - sheet1.getCells().get("A4").copyStyle(gridTableItemStyle); - i = sheet1.getHyperlinks().add("A4", 1, 1, ""); - hlink = sheet1.getHyperlinks().get(i); - hlink.setAddress("CELLCMD:1A4"); - hlink.setTextToDisplay("Quantity"); - - CellEventHandler ce = new CellEventHandler() { - public void handleCellEvent(Object sender, CellEventArgs e) { - if (e.getArgument().toString().equals("A1")) { - sheet.getCells().sort(1, 0, 20, 4, 0, true,true,false); - } else if (e.getArgument().toString().equals("B1")) { - sheet.getCells().sort(1, 0, 20, 4, 1, true,true,false); - } else if (e.getArgument().toString().equals("C1")) { - sheet.getCells().sort(1, 0, 20, 4, 2, true,true,false); - } else if (e.getArgument().toString().equals("D1")) { - sheet.getCells().sort(1, 0, 20, 4, 3, true,true,false); - } else if (e.getArgument().toString().equals("1A1")) { - sheet1.getCells().sort(0, 1, 4, 7, 0, true,true,true); - } else if (e.getArgument().toString().equals("1A2")) { - sheet1.getCells().sort(0, 1, 4, 7, 1, true,true,true); - } else if (e.getArgument().toString().equals("1A3")) { - sheet1.getCells().sort(0, 1, 4, 7, 2, true,true,true); - } else if (e.getArgument().toString().equals("1A4")) { - sheet1.getCells().sort(0, 1, 4, 7, 3, true,true,true); - } - } - - }; - gridweb.CellCommand = ce; - - } - - public void events(final GridWebBean gridweb,final HttpServletRequest request, final HttpServletResponse response) { - this.reload(gridweb,request, response); - - gridweb.setPageSize(3); - final GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - // gridWorkSheet - final GridWorksheet gridWorkSheet = gridWorksheetCollection.get(gridWorksheetCollection.getActiveSheetIndex()); - gridWorkSheet.getCells().setColumnWidthPixel(0, 180); - - WorkbookEventHandler SubmitCommand = new WorkbookEventHandler() { - @Override - public void handleCellEvent(Object arg0, CellEventArgs arg1) { - - // try { - // request.getRequestDispatcher("/sample/pages/commons/event_info.jsp").forward(request, - // response); - // } catch (ServletException e) { - // e.printStackTrace(); - // } catch (IOException e) { - // e.printStackTrace(); - // } - gridWorkSheet.getCells().get("A1").setValue("SubmitCommand"); - - // out.println(""); - } - }; - gridweb.SubmitCommand = SubmitCommand; - - WorkbookEventHandler SaveCommand = new WorkbookEventHandler() { - @Override - public void handleCellEvent(Object arg0, CellEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("SaveCommand"); - } - }; - gridweb.SaveCommand = SaveCommand; - - WorkbookEventHandler UndoCommand = new WorkbookEventHandler() { - @Override - public void handleCellEvent(Object arg0, CellEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("UndoCommand"); - } - }; - gridweb.UndoCommand = UndoCommand; - - WorkbookEventHandler SheetTabClick = new WorkbookEventHandler() { - @Override - public void handleCellEvent(Object arg0, CellEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("SheetTabClick"); - } - }; - gridweb.SheetTabClick = SheetTabClick; - - WorkbookEventHandler SheetTabChange = new WorkbookEventHandler() { - @Override - public void handleCellEvent(Object arg0, CellEventArgs arg1) { - GridWorksheet gridWorkSheet = gridWorksheetCollection.get(gridWorksheetCollection.getActiveSheetIndex()); - gridWorkSheet.getCells().get("A1").setValue("SheetTabChange"); - } - }; - // gridweb.SheetTabChange = SheetTabChange; - - CellErrorHandler CellError = new CellErrorHandler() { - @Override - public void handleCellEvent(Object arg0, GridCellException arg1, OnErrorActionQuery arg2) { - gridWorkSheet.getCells().get("A1").setValue("CellError"); - } - }; - // gridweb.CellError = CellError; - - CustomCommandEventHandler CustomCommand = new CustomCommandEventHandler() { - @Override - public void handleCellEvent(Object arg0, String arg1) { - gridWorkSheet.getCells().get("A1").setValue("CustomCommand"); - } - }; - gridweb.CustomCommand = CustomCommand; - - RowColumnEventHandler RowDoubleClick = new RowColumnEventHandler() { - @Override - public void handleCellEvent(Object arg0, RowColumnEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("RowDoubleClick"); - } - }; - gridweb.RowDoubleClick = RowDoubleClick; - - RowColumnEventHandler ColumnDoubleClick = new RowColumnEventHandler() { - @Override - public void handleCellEvent(Object arg0, RowColumnEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("ColumnDoubleClick"); - } - }; - gridweb.ColumnDoubleClick = ColumnDoubleClick; - - CellEventHandler CellDoubleClick = new CellEventHandler() { - @Override - public void handleCellEvent(Object arg0, CellEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("CellDoubleClick"); - } - }; - gridweb.CellDoubleClick = CellDoubleClick; - - CellEventStringHandler CellClickOnAjax = new CellEventStringHandler() { - @Override - public String handleCellEvent(Object arg0, CellEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("CellClickOnAjax"); - return null; - } - }; - gridweb.CellClickOnAjax = CellClickOnAjax; - - RowColumnEventHandler RowInserted = new RowColumnEventHandler() { - @Override - public void handleCellEvent(Object arg0, RowColumnEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("RowInserted"); - } - }; - gridweb.RowInserted = RowInserted; - - RowColumnEventHandler RowDeleted = new RowColumnEventHandler() { - @Override - public void handleCellEvent(Object arg0, RowColumnEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("RowDeleted"); - } - }; - gridweb.RowDeleted = RowDeleted; - - RowColumnEventHandler RowDeleting = new RowColumnEventHandler() { - @Override - public void handleCellEvent(Object arg0, RowColumnEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("RowDeleting"); - } - }; - gridweb.RowDeleting = RowDeleting; - - RowColumnEventHandler ColumnInserted = new RowColumnEventHandler() { - @Override - public void handleCellEvent(Object arg0, RowColumnEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("ColumnInserted"); - } - }; - gridweb.ColumnInserted = ColumnInserted; - - RowColumnEventHandler ColumnDeleted = new RowColumnEventHandler() { - @Override - public void handleCellEvent(Object arg0, RowColumnEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("ColumnDeleted"); - } - }; - gridweb.ColumnDeleted = ColumnDeleted; - - RowColumnEventHandler ColumnDeleting = new RowColumnEventHandler() { - @Override - public void handleCellEvent(Object arg0, RowColumnEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("ColumnDeleting"); - } - }; - gridweb.ColumnDeleting = ColumnDeleting; - - CellEventHandler CellCommand = new CellEventHandler() { - @Override - public void handleCellEvent(Object arg0, CellEventArgs arg1) { - gridWorkSheet.getCells().get("A1").setValue("CellCommand"); - } - }; - gridweb.CellCommand = CellCommand; - - WorkbookEventHandler PageIndexChanged = new WorkbookEventHandler() { - @Override - public void handleCellEvent(Object arg0, CellEventArgs arg1) { - int row=(gridweb.getCurrentPageIndex())*gridweb.getPageSize(); - gridWorkSheet.getCells().get(row,0).setValue("PageIndexChanged"+(gridweb.getCurrentPageIndex()+1)); - } - }; - gridweb.PageIndexChanged = PageIndexChanged; - } - -} diff --git a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/FormatServlet.java b/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/FormatServlet.java deleted file mode 100755 index cff68624..00000000 --- a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/FormatServlet.java +++ /dev/null @@ -1,359 +0,0 @@ -package com.aspose.gridweb.test.servlet; - -import java.util.Date; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.aspose.gridweb.GridCell; -import com.aspose.gridweb.GridCells; -import com.aspose.gridweb.GridTableItemStyle; -import com.aspose.gridweb.GridWebBean; -import com.aspose.gridweb.GridWorksheetCollection; -import com.aspose.gridweb.test.TestGridWebBaseServlet; - -public class FormatServlet extends TestGridWebBaseServlet { - - private static final long serialVersionUID = 1L; - - @Override - public void reload(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request, "format.xls"); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void loadCustomFormatFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - this.reload(gridweb,request, response); - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridCells gridCells = gridWorksheetCollection.get(gridWorksheetCollection.getActiveSheetIndex()).getCells(); - - gridCells.get("A1").setValue("Custom Format"); - gridCells.get("A2").setValue("0.0"); - gridCells.get("A3").setValue("0.000"); - gridCells.get("A4").setValue("#,##0.0"); - gridCells.get("A5").setValue("US$#,##0;US$-#,##0"); - gridCells.get("A6").setValue("0.0%"); - gridCells.get("A7").setValue("0.000E+00"); - gridCells.get("A8").setValue("yyyy-m-d h:mm"); - - gridCells.get("B1").setValue("Format Results"); - - GridCell B2 = gridCells.get("B2"); - B2.setValue(12345.6789); - B2.setCustom("0.0"); - - GridCell B3 = gridCells.get("B3"); - B3.setValue(12345.6789); - - B3.setCustom("0.000"); - - GridCell B4 = gridCells.get("B4"); - B4.setValue(543123456.789); - - B4.setCustom("#,##0.0"); - - GridCell B5 = gridCells.get("B5"); - B5.setValue(-543123456.789); - - B5.setCustom("US$#,##0;US$-#,##0"); - - GridCell B6 = gridCells.get("B6"); - B6.setValue(0.925687); - - B6.setCustom("0.0%"); - - GridCell B7 = gridCells.get("B7"); - B7.setValue(-1234567890.5687); - - B7.setCustom("0.000E+00"); - - GridCell B8 = gridCells.get("B8"); - B8.setValue(new Date()); - - B8.setCustom("yyyy-m-d h:mm"); - - } - - public void customFormat(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - this.reload(gridweb,request, response); - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridCells gridCells = gridWorksheetCollection.get(gridWorksheetCollection.getActiveSheetIndex()).getCells(); - - gridCells.get("A1").setValue("Custom Format"); - gridCells.get("A2").setValue(request.getParameter("format")); - - gridCells.get("B1").setValue("Format Results"); - GridCell B2 = gridCells.get("B2"); - ///notice we use this api to automatically convert string value - B2.putValue(request.getParameter("value"),true); - GridTableItemStyle B2Style = B2.getStyle(); - B2Style.setCustom(request.getParameter("format")); - B2.setStyle(B2Style); - } - - public void loadDateTimeFormatFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - this.reload(gridweb,request, response); - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridCells gridCells = gridWorksheetCollection.get(gridWorksheetCollection.getActiveSheetIndex()).getCells(); - - gridCells.get("A1").setValue("Number Type"); - gridCells.get("A2").setValue("Date 1:"); - gridCells.get("A3").setValue("Date 2:"); - gridCells.get("A4").setValue("Date 3:"); - gridCells.get("A5").setValue("Date 4:"); - - gridCells.get("A6").setValue("Time 1:"); - gridCells.get("A7").setValue("Time 2:"); - gridCells.get("A8").setValue("Time 3:"); - gridCells.get("A9").setValue("Time 4:"); - gridCells.get("A10").setValue("Time 5:"); - gridCells.get("A11").setValue("Time 6:"); - gridCells.get("A12").setValue("Time 7:"); - gridCells.get("A13").setValue("Time 8:"); - - gridCells.get("A14").setValue("EasternDate 1:"); - gridCells.get("A15").setValue("EasternDate 2:"); - gridCells.get("A16").setValue("EasternDate 3:"); - gridCells.get("A17").setValue("EasternDate 4:"); - gridCells.get("A18").setValue("EasternDate 5:"); - gridCells.get("A19").setValue("EasternDate 6:"); - gridCells.get("A20").setValue("EasternDate 7:"); - gridCells.get("A21").setValue("EasternDate 8:"); - gridCells.get("A22").setValue("EasternDate 9:"); - gridCells.get("A23").setValue("EasternDate 10:"); - gridCells.get("A24").setValue("EasternDate 11:"); - gridCells.get("A25").setValue("EasternDate 12:"); - gridCells.get("A26").setValue("EasternDate 13:"); - - gridCells.get("A27").setValue("EasternTime 1:"); - gridCells.get("A28").setValue("EasternTime 2:"); - gridCells.get("A29").setValue("EasternTime 3:"); - gridCells.get("A30").setValue("EasternTime 4:"); - gridCells.get("A31").setValue("EasternTime 5:"); - gridCells.get("A32").setValue("EasternTime 6:"); - - gridCells.get("B1").setValue("Format Results"); - - GridCell B2 = gridCells.get("B2"); - B2.setValue(new Date()); - - B2.setNumberType(14); - - - GridCell B3 = gridCells.get("B3"); - B3.setValue(new Date()); - - B3.setNumberType(15); - - - GridCell B4 = gridCells.get("B4"); - B4.setValue(new Date()); - - B4.setNumberType(16); - - - GridCell B5 = gridCells.get("B5"); - B5.setValue(new Date()); - - B5.setNumberType(17); - - - GridCell B6 = gridCells.get("B6"); - B6.setValue(new Date()); - - B6.setNumberType(18); - - - GridCell B7 = gridCells.get("B7"); - B7.setValue(new Date()); - - B7.setNumberType(19); - - - GridCell B8 = gridCells.get("B8"); - B8.setValue(new Date()); - - B8.setNumberType(20); - - - GridCell B9 = gridCells.get("B9"); - B9.setValue(new Date()); - - B9.setNumberType(21); - - - GridCell B10 = gridCells.get("B10"); - B10.setValue(new Date()); - - B10.setNumberType(22); - - - GridCell B11 = gridCells.get("B11"); - B11.setValue(new Date()); - - B11.setNumberType(45); - - - GridCell B12 = gridCells.get("B12"); - B12.setValue(new Date()); - - B12.setNumberType(46); - - - GridCell B13 = gridCells.get("B13"); - B13.setValue(new Date()); - - B13.setNumberType(47); - - - GridCell B14 = gridCells.get("B14"); - B14.setValue(new Date()); - - B14.setNumberType(27); - - - GridCell B15 = gridCells.get("B15"); - B15.setValue(new Date()); - - B15.setNumberType(28); - - - GridCell B16 = gridCells.get("B16"); - B16.setValue(new Date()); - - B16.setNumberType(29); - - - GridCell B17 = gridCells.get("B17"); - B17.setValue(new Date()); - - B17.setNumberType(30); - - - GridCell B18 = gridCells.get("B18"); - B18.setValue(new Date()); - - B18.setNumberType(31); - - - GridCell B19 = gridCells.get("B19"); - B19.setValue(new Date()); - - B19.setNumberType(36); - - - GridCell B20 = gridCells.get("B20"); - B20.setValue(new Date()); - - B20.setNumberType(50); - - - GridCell B21 = gridCells.get("B21"); - B21.setValue(new Date()); - - B21.setNumberType(51); - - - GridCell B22 = gridCells.get("B22"); - B22.setValue(new Date()); - - B22.setNumberType(52); - - - GridCell B23 = gridCells.get("B23"); - B23.setValue(new Date()); - - B23.setNumberType(53); - - - GridCell B24 = gridCells.get("B24"); - B24.setValue(new Date()); - - B24.setNumberType(54); - - - GridCell B25 = gridCells.get("B25"); - B25.setValue(new Date()); - - B25.setNumberType(57); - - - GridCell B26 = gridCells.get("B26"); - B26.setValue(new Date()); - - B26.setNumberType(58); - - - GridCell B27 = gridCells.get("B27"); - B27.setValue(new Date()); - - B27.setNumberType(32); - - - GridCell B28 = gridCells.get("B28"); - B28.setValue(new Date()); - - B28.setNumberType(33); - - - GridCell B29 = gridCells.get("B29"); - B29.setValue(new Date()); - - B29.setNumberType(34); - - - GridCell B30 = gridCells.get("B30"); - B30.setValue(new Date()); - - B30.setNumberType(35); - - - GridCell B31 = gridCells.get("B31"); - B31.setValue(new Date()); - - B31.setNumberType(55); - - - GridCell B32 = gridCells.get("B32"); - B32.setValue(new Date()); - - B32.setNumberType(56); - - } - - public void dateAndTime(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - this.reload(gridweb,request, response); - - String value = (request.getParameter("value")); - int numberType = Integer.parseInt(request.getParameter("DropDownList1")); - String text = request.getParameter("text"); - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridCells gridCells = gridWorksheetCollection.get(gridWorksheetCollection.getActiveSheetIndex()).getCells(); - - gridCells.get("A1").setValue("Number Type"); - gridCells.get("B1").setValue("Format Results"); - - gridCells.get("A2").setValue(text); - - GridCell B2 = gridCells.get("B2"); - ///notice we use this api to automatically convert string value - B2.putValue(value,true); - - B2.setNumberType(numberType); - - } - -} diff --git a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/FunctionServlet.java b/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/FunctionServlet.java deleted file mode 100755 index 861350f0..00000000 --- a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/FunctionServlet.java +++ /dev/null @@ -1,302 +0,0 @@ -package com.aspose.gridweb.test.servlet; - -import java.util.ArrayList; -import java.util.Date; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.aspose.gridweb.BorderStyle; -import com.aspose.gridweb.Color; -import com.aspose.gridweb.FontUnit; -import com.aspose.gridweb.GridCells; -import com.aspose.gridweb.GridHyperlink; -import com.aspose.gridweb.GridHyperlinkCollection; -import com.aspose.gridweb.GridValidation; -import com.aspose.gridweb.GridValidationCollection; -import com.aspose.gridweb.GridValidationType; -import com.aspose.gridweb.GridWebBean; -import com.aspose.gridweb.GridWorksheet; -import com.aspose.gridweb.GridWorksheetCollection; -import com.aspose.gridweb.HorizontalAlign; -import com.aspose.gridweb.OperatorType; -import com.aspose.gridweb.Unit; -import com.aspose.gridweb.test.TestGridWebBaseServlet; - -/** - * import modes.jsp,data_validation.jsp,create_content.jsp - */ -public class FunctionServlet extends TestGridWebBaseServlet { - private static final long serialVersionUID = 1L; - - - - - - @Override - public void reload(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"data.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void editMode(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - boolean editMode = Boolean.valueOf(request.getParameter("editMode")); - - gridweb.setEditMode(editMode); - } - - public void loadHyperlinkFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - - // reload the new file - try { - super.reloadfile(gridweb,request,"hyperlink.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - gridweb.setWidth(Unit.Pixel(600)); - gridweb.setHeight(Unit.Pixel(400)); - // the first sheet - GridWorksheet firstSheet = gridweb.getWorkSheets().get(0); - GridHyperlinkCollection hyperlinkCollection = firstSheet.getHyperlinks(); - GridHyperlink B1 = hyperlinkCollection.get(hyperlinkCollection.add("B1", "B1", "http://www.aspose.com", "Aspose site", - "Go to Aspose site and open in new window")); - B1.setTarget("_blank"); - - GridHyperlink B2 = hyperlinkCollection.get(hyperlinkCollection.add("B2", "B2", webPath + "/test1.jsp", - "Paginatind sheet Demo", "Go to Aspose site and open in current window")); - B2.setTarget("_self"); - - GridHyperlink B3 = hyperlinkCollection.get(hyperlinkCollection.add("B3", "B3", - "http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx", - "Aspose.Cells.GridWeb Product", "Go to Aspose site and open in top window")); - B3.setTarget("_top"); - - GridHyperlink B4 = hyperlinkCollection.get(hyperlinkCollection.add("B4", "B4", - "http://www.aspose.com/Community/Forums/258/ShowForum.aspx", "Aspose.Cells.GridWeb Forums", - "Go to Aspose site and open in new window")); - B4.setTarget("_parent"); - - GridHyperlink B6 = hyperlinkCollection.get(hyperlinkCollection.add("B6", "B6", "http://www.aspose.com", "Aspose site", - "Go to Aspose site and open in new window")); - B6.setImageURL(webPath + "/images/Aspose.Banner.gif"); - - GridHyperlink B7 = hyperlinkCollection.get(hyperlinkCollection.add("B7", "B7", - "http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx", - "Go to Aspose.Cells.GridWeb site and open in new window", "Go to Aspose site and open in new window")); - B7.setImageURL(webPath + "/images/Aspose.Grid.gif"); - - GridHyperlink B8 = hyperlinkCollection.get(hyperlinkCollection.add("B8", "B8", "", "", "A simple CellImage.")); - B8.setImageURL(webPath + "/images/Aspose.Grid.gif"); - firstSheet.getCells().get("A8").setValue("Creates a CellImage:"); - firstSheet.getCells().setRowHeightPixel(7, 150); - } - - public void loadCreateContentFile(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - this.reload(gridweb,request, response); - - gridweb.getWorkSheets().clear(); - gridweb.getWorkSheets().add("first"); - gridweb.getWorkSheets().setActiveSheetIndex(0); - } - - public void createContent(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) throws Exception { - - gridweb.getWorkSheets().clear(); - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridWorksheet gridWorksheet = gridWorksheetCollection.add("invoice"); - GridCells gridCells = gridWorksheet.getCells(); - - // cell Head - this.createContentHead(gridCells, 0, 0, "Order ID"); - this.createContentHead(gridCells, 0, 1, "Customer ID"); - this.createContentHead(gridCells, 0, 2, "Salesperson"); - this.createContentHead(gridCells, 0, 3, "Order Date"); - this.createContentHead(gridCells, 0, 4, "Ship Via"); - - // cell body - gridCells.get(1, 0).setValue("11077"); - gridCells.get(1, 0).getStyle().setHorizontalAlign(HorizontalAlign.Right); - gridCells.get(1, 1).setValue("RATTC"); - gridCells.get(1, 1).getStyle().setHorizontalAlign(HorizontalAlign.Center); - gridCells.get(1, 2).setValue("Nancy Davolio"); - gridCells.get(1, 2).getStyle().setHorizontalAlign(HorizontalAlign.Center); - gridCells.get(1, 3).setValue(new Date()); - gridCells.get(1, 3).getStyle().setHorizontalAlign(HorizontalAlign.Right); - gridCells.get(1, 3).setNumberType(15); - gridCells.get(1, 4).setValue("United Package"); - gridCells.get(1, 4).getStyle().setHorizontalAlign(HorizontalAlign.Center); - - gridCells.get(2, 0).setValue("11076"); - gridCells.get(2, 0).getStyle().setHorizontalAlign(HorizontalAlign.Right); - gridCells.get(2, 1).setValue("BONAP"); - gridCells.get(2, 1).getStyle().setHorizontalAlign(HorizontalAlign.Center); - gridCells.get(2, 2).setValue("Margaret Peacock"); - gridCells.get(2, 2).getStyle().setHorizontalAlign(HorizontalAlign.Center); - gridCells.get(2, 3).setValue(new Date()); - gridCells.get(2, 3).getStyle().setHorizontalAlign(HorizontalAlign.Right); - gridCells.get(2, 4).setValue("United Package"); - gridCells.get(2, 4).getStyle().setHorizontalAlign(HorizontalAlign.Center); - - // gridCells.setColumnWidth(1, 80); - // gridCells.setColumnWidth(2, 120); - // gridCells.setColumnWidth(3, 120); - // gridCells.setColumnWidth(4, 120); - // - // gridCells.setRowHeight(0, 20); - - gridWorksheetCollection.setActiveSheetIndex(gridWorksheet.getIndex()); - } - - private void createContentHead(GridCells gridCells, int x, int y, String value) { - gridCells.get(x, y).setValue(value); - gridCells.get(x, y).getStyle().getFont().setSize(new FontUnit("10pt")); - gridCells.get(x, y).getStyle().getFont().setBold(true); - gridCells.get(x, y).getStyle().setForeColor(Color.getBlue()); - gridCells.get(x, y).getStyle().setBackColor(Color.getAqua()); - gridCells.get(x, y).getStyle().setHorizontalAlign(HorizontalAlign.Center); - gridCells.get(x, y).getStyle().setBorderStyle(BorderStyle.Double); - gridCells.get(x, y).getStyle().setBorderColor(Color.getGold()); - gridCells.get(x, y).getStyle().setBorderWidth(Unit.Pixel(3)); - } - - public void headerBarAndCommandButton(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - // reload the new file - try { - super.reloadfile(gridweb,request,"ShowHeaderBar.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - - boolean noScrollBars = Boolean.valueOf(request.getParameter("noScrollBars").equals("checked")); - boolean showHeaderBar = Boolean.valueOf(request.getParameter("showHeaderBar")); - boolean showSubmitButton = Boolean.valueOf(request.getParameter("showSubmitButton")); - boolean showSaveButton = Boolean.valueOf(request.getParameter("showSaveButton")); - boolean showUndoButton = Boolean.valueOf(request.getParameter("showUndoButton")); - - gridweb.setShowHeaderBar(showHeaderBar); - gridweb.setShowSubmitButton(showSubmitButton); - gridweb.setShowSaveButton(showSaveButton); - gridweb.setShowUndoButton(showUndoButton); - gridweb.setNoScroll(noScrollBars); - } - - public void validation(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - // reload the new file - try { - super.reloadfile(gridweb,request,"input.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - - boolean validation = Boolean.valueOf(request.getParameter("validation")); - gridweb.setForceValidation(validation); - if (!validation) { // validation is disabled - return; - } - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridWorksheet gridWorksheet = gridWorksheetCollection.get(0); - GridValidationCollection gridValidationCollection = gridWorksheet.getValidations(); - - GridValidation C5 = gridValidationCollection.add(); - C5.addACell("C5"); - C5.setOperator(OperatorType.BETWEEN); - C5.setValidationType(GridValidationType.CUSTOM_EXPRESSION); - C5.setRegEx("\\d{6}"); - - GridValidation C6 = gridValidationCollection.add(); - C6.addACell("C6"); - C6.setOperator(OperatorType.NONE); - C6.setValidationType(GridValidationType.DECIMAL); - - GridValidation C7 = gridValidationCollection.add(); - C7.addACell("C7"); - C7.setOperator(OperatorType.NONE); - C7.setValidationType(GridValidationType.WHOLE_NUMBER); - - GridValidation C8 = gridValidationCollection.add(); - C8.addACell("C8"); - C8.setOperator(OperatorType.NONE); - C8.setValidationType(GridValidationType.DATE); - - GridValidation C9 = gridValidationCollection.add(); - C9.addACell("C9"); - C9.setOperator(OperatorType.BETWEEN); - C9.setValidationType(GridValidationType.DATE_TIME); - - GridValidation C10 = gridValidationCollection.add(); - C10.addACell("C10"); - C10.setOperator(OperatorType.BETWEEN); - C10.setValidationType(GridValidationType.LIST); - ArrayList C10List = new ArrayList(); - C10List.add("Fortran"); - C10List.add("Pascal"); - C10List.add("C++"); - C10List.add("Visual Basic"); - C10List.add("Java"); - C10List.add("C#"); - C10.setValueList(C10List); - - GridValidation C11 = gridValidationCollection.add(); - C11.addACell("C11"); - C11.setOperator(OperatorType.BETWEEN); - C11.setValidationType(GridValidationType.DROP_DOWN_LIST); - ArrayList C11List = new ArrayList(); - C11List.add("Bachelor"); - C11List.add("Master"); - C11List.add("Doctor"); - C11.setValueList(C11List); - - GridValidation C12 = gridValidationCollection.add(); - C12.addACell("C12"); - C12.setOperator(OperatorType.BETWEEN); - C12.setValidationType(GridValidationType.FREE_LIST); - ArrayList C12List = new ArrayList(); - C12List.add("US"); - C12List.add("Britain"); - C12List.add("France"); - C12.setValueList(C12List); - - GridValidation C13 = gridValidationCollection.add(); - C13.addACell("C13"); - C13.setOperator(OperatorType.BETWEEN); - C13.setValidationType(GridValidationType.CUSTOM_FUNCTION); - C13.setClientValidationFunction("myvalidation1"); - - GridValidation C14 = gridValidationCollection.add(); - C14.addACell("C14"); - C14.setOperator(OperatorType.BETWEEN); - C14.setValidationType(GridValidationType.CHECK_BOX); - // style - - } - - public void autoFilter(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - this.reload(gridweb,request, response); - // reload the new file - try { - super.reloadfile(gridweb,request,"List.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - - GridWorksheet gridWorksheet = gridweb.getWorkSheets().get(0); - gridWorksheet.removeAutoFilter(); - gridWorksheet.addAutoFilter(4, 0, 60); - // gridWorksheet.FilterString(5, "ccffff,ddd"); - // gridWorksheet.FilterString(7, "dddddd"); - // gridWorksheet.AddCustomFilter(9, "cell5=ccffff,ddd;cell8=cccc"); - gridWorksheet.refreshFilter(); - - } - - public void customFilter(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - } -} diff --git a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/SheetsServlet.java b/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/SheetsServlet.java deleted file mode 100755 index 2415bf5f..00000000 --- a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/SheetsServlet.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.aspose.gridweb.test.servlet; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.aspose.gridweb.Color; -import com.aspose.gridweb.FontUnit; -import com.aspose.gridweb.GridCell; -import com.aspose.gridweb.GridCells; -import com.aspose.gridweb.GridTableItemStyle; -import com.aspose.gridweb.GridWebBean; -import com.aspose.gridweb.GridWorksheet; -import com.aspose.gridweb.GridWorksheetCollection; -import com.aspose.gridweb.HorizontalAlign; -import com.aspose.gridweb.Unit; -import com.aspose.gridweb.test.TestGridWebBaseServlet; - -/** - * import sheets.jsp - */ -public class SheetsServlet extends TestGridWebBaseServlet { - private static final long serialVersionUID = 1L; - - // Add - public void add(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - // GridWorksheetCollection gridWorksheetCollection = gridweb - // .getWorkSheets(); - // int index = gridWorksheetCollection.getCount() + 1; - // gridWorksheetCollection.add("Sheet" + index); - // gridweb.setActiveSheetIndex(index); - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - int index= gridWorksheetCollection.add(); - setNameByCount(gridWorksheetCollection, index,"sheet"); - gridweb.setActiveSheetIndex(index); - - } - - // Add Copy - public void copy(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) throws Exception { - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - int index = gridWorksheetCollection.addCopy(gridweb.getActiveSheetIndex()); - setNameByCount(gridWorksheetCollection, index,"copysheet"); - gridweb.setActiveSheetIndex(index); - } - - private void setNameByCount(GridWorksheetCollection gridWorksheetCollection, int index,String base) { - GridWorksheet gw = gridWorksheetCollection.get(index); - int i = gridWorksheetCollection.getCount(); - gw.setName(base+i); - } - - // Remove Active Sheet - public void remove(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) throws Exception { - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - gridWorksheetCollection.removeAt(gridweb.getActiveSheetIndex()); - } - - // Reload data - @Override - public void reload(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - InitData(gridweb,request); - - gridweb.setActiveSheetIndex(0); - - - } - - - private void InitData(GridWebBean gridweb,HttpServletRequest request) - { - - GridWorksheetCollection sheets = gridweb.getWorkSheets(); - sheets.clear(); - // gridweb..Clear(); - GridWorksheet sheet =sheets.add("Students"); - GridCells cells = sheet.getCells(); - GridCell cell00=cells.getCell(0, 0); - cell00.putValue("Name"); - GridTableItemStyle style=cell00.getStyle(); - style.getFont().setSize(FontUnit.Point(10));//.Font.Size = new FontUnit("10pt"); - style.getFont().setBold(true); - style.setForeColor(Color.getBlack()); - style.setHorizontalAlign(HorizontalAlign.Center); - style.setBorderWidth(Unit.Pixel(1)); - cell00.setStyle(style); - - GridCell cell01=cells.getCell(0, 1); - cell01.putValue("Gender"); - cell01.setStyle(style); - - GridCell cell02=cells.getCell(0, 2); - cell02.putValue("Age"); - cell02.setStyle(style); - - GridCell cell03=cells.getCell(0, 3); - cell03.putValue("Class"); - cell03.setStyle(style); - - cells.getCell(1, 0).putValue("Jack"); - cells.getCell(1, 1).putValue("M"); - cells.getCell(1, 2).putValue(19); - cells.getCell(1, 3).putValue("One"); - - cells.getCell(2, 0).putValue("Tome"); - cells.getCell(2, 1).putValue("M"); - cells.getCell(2, 2).putValue(20); - cells.getCell(2, 3).putValue("Four"); - - cells.getCell(3, 0).putValue("Jeney"); - cells.getCell(3, 1).putValue("W"); - cells.getCell(3, 2).putValue(18); - cells.getCell(3, 3).putValue("Two"); - - cells.getCell(4, 0).putValue("Marry"); - cells.getCell(4, 1).putValue("W"); - cells.getCell(4, 2).putValue(17); - cells.getCell(4, 3).putValue("There"); - - cells.getCell(5, 0).putValue("Amy"); - cells.getCell(5, 1).putValue("W"); - cells.getCell(5, 2).putValue(16); - cells.getCell(5, 3).putValue("Four"); - - cells.getCell(6, 0).putValue("Ben"); - cells.getCell(6, 1).putValue("M"); - cells.getCell(6, 2).putValue(17); - cells.getCell(6, 3).putValue("Four"); - - cells.setColumnWidth(0, 10); - cells.setColumnWidth(1, 10); - cells.setColumnWidth(2, 10); - cells.setColumnWidth(3, 10); - } - -} diff --git a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/WebCellsServlet.java b/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/WebCellsServlet.java deleted file mode 100755 index 2a9bd14e..00000000 --- a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/servlet/WebCellsServlet.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.aspose.gridweb.test.servlet; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.aspose.gridweb.GridCells; -import com.aspose.gridweb.GridComment; -import com.aspose.gridweb.GridCommentCollection; -import com.aspose.gridweb.GridWebBean; -import com.aspose.gridweb.GridWorksheet; -import com.aspose.gridweb.GridWorksheetCollection; -import com.aspose.gridweb.test.TestGridWebBaseServlet; - -/** - * import webcells.jsp - */ -public class WebCellsServlet extends TestGridWebBaseServlet { - private static final long serialVersionUID = 1L; - - @Override - public void reload(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - try { - super.reloadfile(gridweb,request,"data.xls"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private GridCells getGridCells(GridWebBean gridweb,HttpServletRequest request) { - - GridWorksheetCollection gridWorksheetCollection = gridweb.getWorkSheets(); - GridCells gridCells = gridWorksheetCollection.get(gridweb.getActiveSheetIndex()).getCells(); - return gridCells; - } - - public void inserColumn(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - int columnIndex = Integer.parseInt(request.getParameter("columnIndex")); - getGridCells(gridweb,request).insertColumn(columnIndex); - } - - public void deleteColumn(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - int columnIndex = Integer.parseInt(request.getParameter("columnIndex")); - getGridCells(gridweb,request).deleteColumn(columnIndex); - } - - public void insertRow(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - int rowIndex = Integer.parseInt(request.getParameter("rowIndex")); - getGridCells(gridweb,request).insertRow(rowIndex); - } - - public void deleteRow(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - int rowIndex = Integer.parseInt(request.getParameter("rowIndex")); - getGridCells(gridweb,request).deleteRow(rowIndex); - } - - public void mergeCells(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - int startRow = Integer.parseInt(request.getParameter("startRow")); - int startColumn = Integer.parseInt(request.getParameter("startColumn")); - int rowNumber = Integer.parseInt(request.getParameter("rowNumber")); - int columnNumber = Integer.parseInt(request.getParameter("columnNumber")); - getGridCells(gridweb,request).merge(startRow, startColumn, rowNumber, columnNumber); - } - - public void addComment(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - int startRow_c = Integer.parseInt(request.getParameter("startRow_c")); - int startColumn_c = Integer.parseInt(request.getParameter("startColumn_c")); - String comment = request.getParameter("comment"); - GridWorksheet gridWorksheet = gridweb.getWorkSheets().get(gridweb.getActiveSheetIndex()); - GridCommentCollection gridCommentCollection = gridWorksheet.getComments(); - gridCommentCollection.add(startRow_c, startColumn_c); - GridComment gridComment = gridCommentCollection.get(startRow_c, startColumn_c); - gridComment.setNote(comment); - } - - public void removeComment(GridWebBean gridweb,HttpServletRequest request, HttpServletResponse response) { - - int startRow_c = Integer.parseInt(request.getParameter("startRow_c")); - int startColumn_c = Integer.parseInt(request.getParameter("startColumn_c")); - GridWorksheet gridWorksheet = gridweb.getWorkSheets().get(gridweb.getActiveSheetIndex()); - gridWorksheet.getComments().removeAt(startRow_c, startColumn_c); - } -} diff --git a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/util/FileUtil.java b/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/util/FileUtil.java deleted file mode 100755 index 92d3aa71..00000000 --- a/Examples.GridWeb/src/main/java/com/aspose/gridweb/test/util/FileUtil.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.aspose.gridweb.test.util; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; - -public class FileUtil { - static File file = new File("E:\\fileoutput\\body.html"); - - public static void putFile(String text) { - FileOutputStream output = null; - try { - output = new FileOutputStream(file); - } catch (FileNotFoundException e1) { - e1.printStackTrace(); - } - byte[] buff = text.getBytes(); - try { - output.write(buff, 0, buff.length); - output.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/Examples.GridWeb/src/main/webapp/SamplePage.jsp b/Examples.GridWeb/src/main/webapp/SamplePage.jsp deleted file mode 100755 index adad28f5..00000000 --- a/Examples.GridWeb/src/main/webapp/SamplePage.jsp +++ /dev/null @@ -1,65 +0,0 @@ -<%@page language="java" contentType="text/html; charset=UTF-8" import="com.aspose.gridweb.*" pageEncoding="UTF-8"%> - - - - -<%@include file="/head.jsp" %> - -Insert title here -<% -ExtPage BeanManager=ExtPage.getInstance(); -GridWebBean gridweb=BeanManager.getBean(request); -out.println(gridweb.getHTMLHead()); -%> - - -<% - -String filePath = application.getRealPath("/Sample.xlsx"); - -gridweb.setReqRes(request, response); -gridweb.importExcelFile(filePath); - -// ExStart:SamplePage - -WorkbookEventHandler we=new WorkbookEventHandler(){ - public void handleCellEvent(Object sender, CellEventArgs e){ - System.out.println("----------Save Command----------"); - } - -}; -CellEventHandler ceh=new CellEventHandler(){ - public void handleCellEvent(Object sender, CellEventArgs e){ - System.out.println("---------Cell Double Click---------"); - } - -}; -RowColumnEventHandler reh=new RowColumnEventHandler(){ - public void handleCellEvent(Object sender, RowColumnEventArgs e){ - System.out.println("----------Row Double Click---------------"); - } - -}; - -RowColumnEventHandler cdbclick=new RowColumnEventHandler(){ - public void handleCellEvent(Object sender, RowColumnEventArgs e){ - System.out.println("----------Column Double Click-------------"); - } - -}; - - -gridweb.setEnableDoubleClickEvent(true); -gridweb.SaveCommand=we; -gridweb.CellDoubleClick=ceh; -gridweb.RowDoubleClick=reh; -gridweb.ColumnDoubleClick=cdbclick; - -// ExEnd:SamplePage -gridweb.prepareRender(); - -out.print(gridweb.getHTMLBody()); - -%> - - \ No newline at end of file diff --git a/Examples.GridWeb/src/main/webapp/WEB-INF/web.xml b/Examples.GridWeb/src/main/webapp/WEB-INF/web.xml deleted file mode 100755 index 02bfc114..00000000 --- a/Examples.GridWeb/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - testGridWeb - - index.jsp - - - GridWebServlet - GridWebServlet - com.aspose.gridweb.GridWebServlet - - - GridWebServlet - /GridWebServlet - - - - - - SheetsServlet - SheetsServlet - com.aspose.gridweb.test.servlet.SheetsServlet - - - SheetsServlet - /SheetsServlet - - - WebCellsServlet - WebCellsServlet - com.aspose.gridweb.test.servlet.WebCellsServlet - - - WebCellsServlet - /WebCellsServlet - - - FunctionServlet - FunctionServlet - com.aspose.gridweb.test.servlet.FunctionServlet - - - FunctionServlet - /FunctionServlet - - - FeatureServlet - FeatureServlet - com.aspose.gridweb.test.servlet.FeatureServlet - - - FormatServlet - com.aspose.gridweb.test.servlet.FormatServlet - - - - FeatureServlet - /FeatureServlet - - - FormatServlet - /FormatServlet - - \ No newline at end of file diff --git a/Examples.GridWeb/src/main/webapp/clientfunction.jsp b/Examples.GridWeb/src/main/webapp/clientfunction.jsp deleted file mode 100755 index 93c45d02..00000000 --- a/Examples.GridWeb/src/main/webapp/clientfunction.jsp +++ /dev/null @@ -1,96 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" import="com.aspose.gridweb.*" - pageEncoding="UTF-8"%> - - - -<%@include file="/head.jsp" %> - -Insert title here -<% -ExtPage BeanManager=ExtPage.getInstance(); -GridWebBean gridweb=BeanManager.getBean(request); -//gridweb.setACWClientPath("../grid/acw_client/"); - -%> - - -hello world -<% -gridweb.setReqRes(request, response); -gridweb.ImportExcelFile(application.getRealPath("/")+"/file/list.xls"); -//gridweb.setOnValidationErrorClientFunction("myvalidate"); - // page=page -// final HttpServletResponse response_it=response; -WorkbookEventHandler we=new WorkbookEventHandler(){ - public void handleCellEvent(Object sender, CellEventArgs e){ - System.out.println("hSaveCommand"); - } - -}; -CellEventHandler ceh=new CellEventHandler(){ - public void handleCellEvent(Object sender, CellEventArgs e){ - System.out.println("hello cell double click"); - } - -}; -RowColumnEventHandler reh=new RowColumnEventHandler(){ - public void handleCellEvent(Object sender, RowColumnEventArgs e){ - System.out.println("hello row.... RowColumnEventArgs"); - } - -}; - -RowColumnEventHandler cdbclick=new RowColumnEventHandler(){ - public void handleCellEvent(Object sender, RowColumnEventArgs e){ - System.out.println("hello column double click"); - } - -}; - -CellEventStringHandler cesh=new CellEventStringHandler(){ - public String handleCellEvent(Object sender, CellEventArgs e){ - return e.getCell()+"$$$$hello_CellEventStringHandler"; - } - -}; - -CellEventHandler cellcommand=new CellEventHandler(){ - public void handleCellEvent(Object sender, CellEventArgs e){ - System.out.println("hello cellcommand"+e.getCell()); - } - -}; - -gridweb.setEnableDoubleClickEvent(true); -gridweb.SaveCommand=we; -gridweb.CellDoubleClick=ceh; -gridweb.RowDoubleClick=reh; -gridweb.ColumnDoubleClick=cdbclick; - gridweb.CellClickOnAjax=cesh; - gridweb.setOnCellSelectedAjaxCallBackClientFunction("dealwithcellselectcallback"); -gridweb.CellCommand=cellcommand; - - - -gridweb.prepareRender(); - -out.print(gridweb.getHTMLBody()); -//System.out.println(gridweb.getPresetStyle()+",has set default"+",get enable page expected false:"+gridweb.getEnablePaging()); -%> - - \ No newline at end of file diff --git a/Examples.GridWeb/src/main/webapp/file/List.xls b/Examples.GridWeb/src/main/webapp/file/List.xls deleted file mode 100644 index 865cc322..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/List.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/Logical.xls b/Examples.GridWeb/src/main/webapp/file/Logical.xls deleted file mode 100644 index 59843278..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/Logical.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/Math.xls b/Examples.GridWeb/src/main/webapp/file/Math.xls deleted file mode 100644 index e8bd8b01..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/Math.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/PivotTable.xls b/Examples.GridWeb/src/main/webapp/file/PivotTable.xls deleted file mode 100644 index 8347d1aa..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/PivotTable.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/ShowHeaderBar.xls b/Examples.GridWeb/src/main/webapp/file/ShowHeaderBar.xls deleted file mode 100644 index 0861e28f..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/ShowHeaderBar.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/Skins.xls b/Examples.GridWeb/src/main/webapp/file/Skins.xls deleted file mode 100644 index 1fa87764..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/Skins.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/Statistical.xls b/Examples.GridWeb/src/main/webapp/file/Statistical.xls deleted file mode 100644 index 7c105f74..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/Statistical.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/TextAndData.xls b/Examples.GridWeb/src/main/webapp/file/TextAndData.xls deleted file mode 100644 index 1bfa518c..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/TextAndData.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/data.xls b/Examples.GridWeb/src/main/webapp/file/data.xls deleted file mode 100644 index 7ac95b4a..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/data.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/data.xlsx b/Examples.GridWeb/src/main/webapp/file/data.xlsx deleted file mode 100644 index 7f6c32eb..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/data.xlsx and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/datetime.xls b/Examples.GridWeb/src/main/webapp/file/datetime.xls deleted file mode 100644 index 35bdd311..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/datetime.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/employeesales.xls b/Examples.GridWeb/src/main/webapp/file/employeesales.xls deleted file mode 100644 index 155f8b92..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/employeesales.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/format.xls b/Examples.GridWeb/src/main/webapp/file/format.xls deleted file mode 100644 index fe1eb781..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/format.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/freezepane.xls b/Examples.GridWeb/src/main/webapp/file/freezepane.xls deleted file mode 100644 index 1d228bc9..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/freezepane.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/hyperlink.xls b/Examples.GridWeb/src/main/webapp/file/hyperlink.xls deleted file mode 100644 index 8a60a96b..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/hyperlink.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/input.xls b/Examples.GridWeb/src/main/webapp/file/input.xls deleted file mode 100644 index 1d5fba45..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/input.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/file/sort.xls b/Examples.GridWeb/src/main/webapp/file/sort.xls deleted file mode 100644 index 530d33fd..00000000 Binary files a/Examples.GridWeb/src/main/webapp/file/sort.xls and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/grid/acw_client/acwmain.js b/Examples.GridWeb/src/main/webapp/grid/acw_client/acwmain.js deleted file mode 100644 index 949b6ca8..00000000 --- a/Examples.GridWeb/src/main/webapp/grid/acw_client/acwmain.js +++ /dev/null @@ -1,486 +0,0 @@ -//Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved. - -var ie;var iemv;var firefox;var chrome;var safari;var opera;var clientpageheight=0;var scrollTimeout=null;var scrollendDelay=500;var PERCOLUMNNUMBER=32;var PERROWNUMBER=32;var HCELL=19;var WCELL=79;var CELL_CONTENT_ROW_DELIMITER="#_@row@_#";var CELL_CONTENT_COL_DELIMITER="#_@col@_#";var CELL_CONTENT_FORMAT_DELIMITER="#_@class@_#";var CELL_CONTENT_SMALL_DELIMITER="#_@_S_@_#";var MSEXCEL_ROW_DELIMITER="\n";var MSEXCEL_COL_DELIMITER="\t";var global_gridwebkeyevent=false;var java_client=false; -var needInitAlignmentAdjust=false;var copy_with_style=false;var isUseClientPageHeight=false;var current_gridweb=null;var current_cell=null;var current_copy_content=null;var cell_attributes_array=["nowrap","align","valign","vtype","isrequired","listmenu","validationoperator","validationvalue1","validationvalue2"];initAcwGlobal(); -function keydown_act(e){if(firefox&&e.keyCode==9)e.preventDefault();setgoonkeyevent_onkeypress();if(global_gridwebkeyevent)if(current_cell!=null&&!current_gridweb.focusonoutereditor)current_gridweb.mOnKeyDown(e,current_cell)}function mytestmousedown(e){current_gridweb.focusonoutereditor=true} -function setgoonkeyevent_onkeypress(){var active_nodeName=document.activeElement.nodeName;if(ie)if(active_nodeName=="TD"||active_nodeName=="SPAN")global_gridwebkeyevent=true;else global_gridwebkeyevent=false;else if(active_nodeName=="BODY"||active_nodeName=="SPAN")global_gridwebkeyevent=true;else global_gridwebkeyevent=false}function mykeypress(e){if(global_gridwebkeyevent)if(current_cell!=null&&!current_gridweb.focusonoutereditor)current_gridweb.mOnKeyPress(e)} -function mykeyup(e){if(global_gridwebkeyevent)if(current_cell!=null&&!current_gridweb.focusonoutereditor)current_gridweb.mOnKeyUp(e)} -function initAcwGlobal(){document.onkeydown=keydown_act;document.onkeypress=mykeypress;document.onkeyup=mykeyup;var s=window.navigator.userAgent;var i=s.indexOf("MSIE");if(i>=0){ie=true;iemv=parseInt(s.substring(i+5),10);if(document.documentMode==7)iemv=7}else if(s.indexOf("Firefox")>=0){firefox=true;HTMLElement.prototype.__defineGetter__("innerText",function(){var anyString="";var childS=this.childNodes;for(var i=0;i";else str+=items[i];this.innerHTML=str});HTMLElement.prototype.__defineGetter__("currentStyle",function(){return getComputedStyle(this,null)});HTMLElement.prototype.__defineSetter__("outerHTML", -function(sHTML){var r=this.ownerDocument.createRange();r.setStartBefore(this);var df=r.createContextualFragment(sHTML);this.parentNode.replaceChild(df,this);return sHTML});HTMLElement.prototype.__defineGetter__("outerHTML",function(){var attr;var attrs=this.attributes;var str="<"+this.tagName.toLowerCase();for(var i=0;i";return str+">"+this.innerHTML+""});HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){switch(this.tagName.toLowerCase()){case "area":case "base":case "basefont":case "col":case "frame":case "hr":case "img":case "br":case "input":case "isindex":case "link":case "meta":case "param":return false}return true});HTMLElement.prototype.__defineSetter__("unselectable",function(s){if(s=="on")this.style.MozUserSelect="none"})}else if(s.indexOf("Chrome")>=0){chrome=true;HTMLElement.prototype.__defineGetter__("currentStyle", -function(){return getComputedStyle(this,null)})}else if(s.indexOf("Safari")>=0){safari=true;HTMLElement.prototype.__defineGetter__("currentStyle",function(){return getComputedStyle(this,null)})}else if(s.indexOf("Opera")>=0)opera=true;else alert("unknown browser.")}if(!ie){HTMLElement.prototype.contains=function(ele){return this.compareDocumentPosition(ele)&16};HTMLElement.prototype.setActive=function(){return this.focus()}} -function Stylesheet(ss){if(typeof ss=="number")ss=document.styleSheets[ss];this.ss=ss}Stylesheet.prototype.getRules=function(){return this.ss.cssRules?this.ss.cssRules:this.ss.rules};Stylesheet.prototype.getRule=function(s){var rules=this.getRules();if(!rules)return null;if(typeof s=="number")return rules[s];s=s.toLowerCase();for(var i=rules.length-1;i>=0;i--)if(rules[i].selectorText.toLowerCase()==s)return rules[i];return null}; -Stylesheet.prototype.getStyles=function(s){var rule=this.getRule(s);if(rule&&rule.style)return rule.style;else return null};Stylesheet.prototype.getStyleText=function(s){var rule=this.getRule(s);if(rule&&rule.style&&rule.style.cssText)return rule.style.cssText;else return""}; -Stylesheet.prototype.addRule=function(selector,styles,n){if(n==undefined){var rules=this.getRules();n=rules.length}if(this.ss.insertRule)this.ss.insertRule(selector+"{"+styles+"}",n);else if(this.ss.addRule)this.ss.addRule(selector,styles,n)}; -Stylesheet.prototype.deleteRule=function(s){if(s==undefined){var rules=this.getRules();s=rules.length-1}if(typeof s!="number"){s=s.toLowerCase();var rules=this.getRules();for(var i=rules.length-1;i>=0;i--)if(rules[i].selectorText.toLowerCase()==s){s=i;break}if(i==-1)return}if(this.ss.deleteRule)this.ss.deleteRule(s);else if(this.ss.removeRule)this.ss.removeRule(s)}; -function Event(e){if(window.event){this.e=window.event;return}if(e!=null){this.e=e;return}var func=Event.caller;while(func!=null){var arg0=func.arguments[0];if(arg0)if(arg0.constructor==Event||arg0.constructor==MouseEvent||typeof arg0=="object"&&arg0.preventDefault&&arg0.stopPropagation){this.e=arg0;return}func=func.caller}}Event.prototype.getTarget=function(){return this.e.srcElement||this.e.target}; -Event.prototype.getFromElement=function(){if(window.event)return this.e.fromElement;var node;if(this.e.type=="mouseover")node=this.e.relatedTarget;else if(this.e.type=="mouseout")node=this.e.target;if(!node)return;while(node.nodeType!=1)node=node.parentNode;return node}; -Event.prototype.getToElement=function(){if(window.event)return this.e.toElement;var node;if(this.e.type=="mouseout")node=this.e.relatedTarget;else if(this.e.type=="mouseover")node=this.e.target;if(!node)return;while(node.nodeType!=1)node=node.parentNode;return node};Event.prototype.getOffset=function(){if(window.event){var offset={offsetX:this.e.offsetX,offsetY:this.e.offsetY};return offset}else{var offset={offsetX:this.e.layerX,offsetY:this.e.layerY};return offset}}; -function getClient(o){var left=0;var top=0;while(o.offsetParent){left+=o.offsetLeft;top+=o.offsetTop;if(o.offsetParent.scrollLeft)left-=o.offsetParent.scrollLeft;if(o.offsetParent.scrollTop)top-=o.offsetParent.scrollTop;o=o.offsetParent}return{cx:left,cy:top}}function HTMLEncode(str){var s="";if(str.length==0)return"";s=str.replace(/&/g,"&");s=s.replace(//g,">");s=s.replace(/\"/g,""");return s} -function HTMLDecode(str){var s="";if(str.length==0)return"";s=str.replace(/&/g,"&");s=s.replace(/</g,"<");s=s.replace(/>/g,">");s=s.replace(/"/g,'"');return s} -function getXMLDocument(element){if(ie){if(!document.documentMode||document.documentMode>8){var xmlDoc=new ActiveXObject("Msxml2.DOMDocument.3.0");xmlDoc.loadXML(element.innerHTML);return xmlDoc}if(iemv<9)return element.XMLDocument;else{var xmlDoc=new ActiveXObject("Msxml2.DOMDocument.3.0");xmlDoc.loadXML(element.innerHTML);return xmlDoc}}else{var parser=new DOMParser;var src=element.innerHTML;if(src==null||src.length==0)src=element.xml;var arr=src.match(/\"[^\"]*\"/g);if(arr!=null){src=src.toUpperCase(); -for(var i=0;i=0;i--)this.removeChild(childNodes[i]);var dp=new DOMParser;var newDOM=dp.parseFromString(xmlString,"text/xml");var newElt=this.importNode(newDOM.documentElement,true);this.appendChild(newElt)};XMLDocument.prototype.__proto__.__defineGetter__("xml",function(){try{return(new XMLSerializer).serializeToString(this)}catch(ex){var d=document.createElement("div");d.appendChild(this.cloneNode(true)); -return d.innerHTML}});Element.prototype.__proto__.__defineGetter__("xml",function(){try{return(new XMLSerializer).serializeToString(this)}catch(ex){var d=document.createElement("div");d.appendChild(this.cloneNode(true));return d.innerHTML}});XMLDocument.prototype.__proto__.__defineGetter__("text",function(){return this.firstChild.textContent});Element.prototype.__proto__.__defineGetter__("text",function(){return this.textContent});XMLDocument.prototype.selectSingleNode=Element.prototype.selectSingleNode= -function(xpath){var x=this.selectNodes(xpath);if(!x||x.length<1)return null;return x[0]};XMLDocument.prototype.selectNodes=Element.prototype.selectNodes=function(xpath){var xpe=new XPathEvaluator;var nsResolver=xpe.createNSResolver(this.ownerDocument==null?this.documentElement:this.ownerDocument.documentElement);var result=xpe.evaluate(xpath,this,nsResolver,0,null);var found=[];var res;while(res=result.iterateNext())found.push(res);return found}} -function getattr(o,name){if(ie&&iemv<8)return o[name];if(o.attributes){var attri=o.getAttribute(name);if(attri!=null)return attri;else return o[name]}}function getInnerText(o){var text_inner=o.innerText;if(o==null||text_inner==null)return null;if(chrome)return text_inner.replace(/\n$/,"");else if(ie&&o.myInnerText)return o.myInnerText.replace(/\n$/,"");else return text_inner} -function parseLength(str,xy){reSetDPI();var len=str.length;if(str==null||str==""||str.charAt(len-1)=="%")return null;var nval=new Number(str);if(!isNaN(nval))return nval;var pfx=str.substring(len-2,len).toLowerCase();var val=str.substring(0,len-2);var nval=new Number(val);if(isNaN(nval))return null;var d;if(xy=="x")d=screen.deviceXDPI;else d=screen.deviceYDPI;if(d==null)d=96;switch(pfx){case "px":return nval;case "in":return nval*d;case "cm":return nval/2.54*d;case "mm":return nval/25.4*d;case "pt":return nval/ -72*d;case "pc":return nval/6*d;default:return null}}function getlang(){if(typeof ACWLang!="undefined"&&ACWLang!=null)return ACWLang;else return def_lang} -var def_lang={TipCellNoValue:"",TipCellFormula:"",TipCellIsRequired:"",TipCellAnyValue:"",TipCellList:"",TipCellFreeList:" - - - - - - - - - - - - - - -
- - - - - Replace with: - - - - - Find options: - - Match case -
- Match whole - word -
- Search up -
- Regular expression -
- - - - - - - diff --git a/Examples.GridWeb/src/main/webapp/grid/acw_client/findDlg.js b/Examples.GridWeb/src/main/webapp/grid/acw_client/findDlg.js deleted file mode 100644 index cecd6099..00000000 --- a/Examples.GridWeb/src/main/webapp/grid/acw_client/findDlg.js +++ /dev/null @@ -1,986 +0,0 @@ -//Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved. - -/*********************************************************************************************** - * Aspose.Cells.GridWeb Component Script File - * Copyright 2003-2011, All Rights Reserverd. - ************************************************************************************************/ - -var _oFindWhat = null; // The controll that be input what finding -var _oReplaceWith = null; // The controll that be input what replacing whith -var _oCase = null; // The check box to determine whether macthing case -var _oWord = null; // The check box to determine whether macthing whole word -var _oDirection = null; // The check box to determine searching direction. search down and search up. -var _oRegular = null; // The check box to determine whether the seaching string is a regular expression. -var _oFindIn = null; // The drop down list to indicate target is formulas or values. -var _oBtnFind = null; // The find next button. -var _oBtnReplace = null; // The replace button. -var _oBtnReplaceAll = null; // The replace all button. -var _oBtnClose = null; // The close button. - -var _parentWindow = null; // The parent window -var _element = null; // The GridWeb object. -var _viewTable = null; // One of the ViewTable objects. -var _viewTable00 = null; // One of the ViewTable objects. -var _viewTable01 = null; // One of the ViewTable objects. -var _viewTable10 = null; // One of the ViewTable objects. -var _activeCell = null; // The active cell. -var _startSearchCell = null; // The first cell in a searching process. -var _callType = 0; // 0 Find; 1 Replace -var _dialogEdgeLeftWidth = 0; // The left edge width of the find/replace dialog window -var _dialogEdgeTopHeight = 0; // The top edge width of the find/replace dialog window, i.e. The title bar width. - -var _cidReg = new RegExp("^\\d+#\\d+$"); -var _findReg = null; -var _findWhat = null; -var _regexOptions = null; -var _freeze = null; -var _arrCells = new Array(); -var _cellIndex = 0; - -var _currentViewTable = null; -var _currentCellIndex = 0; -var _currentRowIndex = 0; -var _currentRows = null; -var _currentCells = null; -var _currentRowsLength = 0; -var _currentCellsLength = 0; - - -//---------------------------------------------------------------------------------------------------- -// Initializes variants, gets parameters from parent window after window on load. -//---------------------------------------------------------------------------------------------------- -window.onload = function(){ - _oFindWhat = document.getElementById("txtFindWhat"); - _oReplaceWith = document.getElementById("txtReplaceWith"); - _oCase = document.getElementById("ckbCase"); - _oWord = document.getElementById("ckbWord"); - _oDirection = document.getElementById("ckbDirection"); - _oRegular = document.getElementById("ckbRegular"); - _oFindIn = document.getElementById("ddlFindIn"); - _oBtnFind = document.getElementById("btnFind"); - _oBtnReplace = document.getElementById("btnReplace"); - _oBtnReplaceAll = document.getElementById("btnReplaceAll"); - _oBtnClose = document.getElementById("btnClose"); - - if(!window.showModelessDialog) // Is not IE - { - _parentWindow = window.opener; - _element = _parentWindow.acwFindReplaceDialog_Element; - _activeCell = _parentWindow.acwFindReplaceDialog_StartCell; - _oBtnFind.style.width = "100px"; - _oBtnReplace.style.width = "100px"; - _oBtnReplaceAll.style.width = "100px"; - _oBtnClose.style.width = "100px"; - _dialogEdgeLeftWidth = (window.outerWidth - innerWidth)/2; - _dialogEdgeTopHeight = parseInt((window.outerHeight - innerHeight)/2+1); - } - else{ //IE - _parentWindow = window.dialogArguments[0]; - _arrCells = window.dialogArguments[1]; - _cellIndex = window.dialogArguments[2]; - _element = _parentWindow.acwFindReplaceDialog_Element; - _activeCell = _parentWindow.acwFindReplaceDialog_StartCell; - _dialogEdgeLeftWidth = window.screenLeft - parseFloat(window.dialogLeft); - _dialogEdgeTopHeight = window.screenTop - parseFloat(window.dialogTop); - } - _callType = getUrlParameter("callType"); - _freeze = _element.freeze; - - init(); -} - -//---------------------------------------------------------------------------------------------------- -// Sets the variants about this window when the window be closed. -//---------------------------------------------------------------------------------------------------- -window.onunload = function(){ - if(typeof _parentWindow == "undefined" || typeof _parentWindow.acwFindReplaceDialog == "undefined"){ - return false; - } - - _parentWindow.acwFindReplaceDialog_Element = null; - _parentWindow.acwFindReplaceDialog_StartCell = null; - _parentWindow.acwFindReplaceDialog = null; -} - -//---------------------------------------------------------------------------------------------------- -// If reload window opener, closes FindReplace Dialog. -//---------------------------------------------------------------------------------------------------- -window.onfocus = function(){ - if(typeof _parentWindow == "undefined" - || typeof _parentWindow.acwFindReplaceDialog == "undefined" - || (_activeCell != null && _activeCell.parentNode == null)){ - window.close(); - } -} - -//---------------------------------------------------------------------------------------------------- -// Handles onkeyown events -//---------------------------------------------------------------------------------------------------- -document.onkeydown = function(evt){ - if(evt == null) - evt = event; - if(evt.keyCode == 27){ // Esc - window.close(); - return false; - } - else if(evt.keyCode == 13){ //enter - _oBtnFind.click(); - return false; - } -} - -//---------------------------------------------------------------------------------------------------- -// Initializes variants, determines how to lay out page. -//---------------------------------------------------------------------------------------------------- -function init(){ - - _viewTable = _element.ownerDocument.getElementById(_element.id + "_viewTable"); - if (_freeze) - { - _viewTable00 = _element.ownerDocument.getElementById(_element.id + "_viewTable00"); - _viewTable01 = _element.ownerDocument.getElementById(_element.id + "_viewTable01"); - _viewTable10 = _element.ownerDocument.getElementById(_element.id + "_viewTable10"); - } - - if(_activeCell == null){ - if(_freeze){ - if(_viewTable00.rows.length != 0 && _viewTable00.rows[0].cells.length != 0){ - _activeCell = _viewTable00.rows[0].cells[0]; - } - else if(_viewTable01.rows.length != 0 && _viewTable01.rows[0].cells.length != 0){ - _activeCell = _viewTable01.rows[0].cells[0]; - } - else if(_viewTable10.rows.length != 0 && _viewTable10.rows[0].cells.length != 0){ - _activeCell = _viewTable10.rows[0].cells[0]; - } - else if(_viewTable.rows.length != 0 && _viewTable.rows[0].cells.length != 0){ - _activeCell = _viewTable.rows[0].cells[0]; - } - else{ // No cell provide for searching - window.close(); - return; - } - } - else { - if(_viewTable.rows.length == 0 || _viewTable.rows[0].cells.length == 0){ // No cell provide for searching - window.close(); - return; - } - else{ - _activeCell = _viewTable.rows[0].cells[0]; - } - } - setActiveCell(_activeCell); - } - - validateInitArguments(); - - showElmentByCallType(_callType); - - //FillCellsToArray(_activeCell); - - if(navigator.appName.indexOf("Microsoft") == -1){ // Is not IE - _currentViewTable = _activeCell.offsetParent; - _currentCellIndex = _activeCell.cellIndex; - _currentRowIndex = _activeCell.parentNode.rowIndex; - _currentRows = _currentViewTable.rows; - _currentRowsLength = _currentRows.length; - _currentCells = _currentRows[_currentRowIndex].cells; - _currentCellsLength = _currentCells.length; - } -} - -//---------------------------------------------------------------------------------------------------- -// Determines whether can call the Find/Replace feature. -//---------------------------------------------------------------------------------------------------- -function validateInitArguments(){ - if(_element == null || _activeCell == null || _callType == null){ - alert("Arguments are null. Can't call Find/Replace feature!"); - window.close(); - } -} - -//---------------------------------------------------------------------------------------------------- -// Determines how to lay out page according to call type(find or replace) -// Arguments: -// callType: o indicates find, 1 indicates replace -//---------------------------------------------------------------------------------------------------- -function showElmentByCallType(callType){ - if(callType == 0){ // Find - document.getElementById("trReplaceWhat").style.display = "none"; - document.getElementById("trReplaceAll").style.display = "none"; - } - else if(callType == 1){ // Replace - document.getElementById("trReplaceWhat").style.display = ""; - document.getElementById("trReplaceAll").style.display = ""; - } - - if (!_element.editmode) { - document.getElementById("trReplace").style.display = "none"; - } -} - -//---------------------------------------------------------------------------------------------------- -// Determines whether continueing to execute when executor clicks find next, replace or replace all button -// Arguments: -// obj: The button object. -// Return: Allows to execute return true, otherwise return false. -//---------------------------------------------------------------------------------------------------- -function isEnableGo(obj){ - if((obj == _oBtnReplace || obj == _oBtnReplaceAll) && !_element.editmode) - return false; - if(obj == _oBtnReplace && _callType == 0){ - _callType = 1; - showElmentByCallType(1); - return false; - } - if((obj == _oBtnReplace || obj == _oBtnReplaceAll) && _oFindIn.value == 2){ - if(window.confirm("Findin must be set to Formulas. Now, set it to Formulas and continue?")){ - _oFindIn.value = 1; - } - else{ - return false; - } - } - _findWhat = _oFindWhat.value; - if(_findWhat == ""){ - alert("Please input what will be searched!"); - return false; - } - - _regexOptions = getRegExpOptions(); - if(!_oRegular.checked){ // RegularExpression checkbox is false - _findWhat = escapeMetacharacters(_findWhat); // Escapes meta characters. E.g. "\w" to "\\w" - } - - if(_oWord.checked){ - _findWhat = "(\\W|^)" + _findWhat + "(\\W|$)"; - } - try{ - _findReg = new RegExp(_findWhat, _regexOptions); - } - catch(e){//Regular Expression is error - alert(e.name + ": " + e.message); - return false; - } - - _startSearchCell = _activeCell; - return true; -} - -//---------------------------------------------------------------------------------------------------- -// Find next cell -//---------------------------------------------------------------------------------------------------- -function find_Next() { - var findCell = _startSearchCell; - do{ - findCell = moveToNextCell3(); - - var sourceString; - sourceString = getInnerText(findCell); - - // Determines the findCell whether contains the spiciel string. - if(sourceString != null && sourceString != ""){ - - //_findReg = new RegExp(_findWhat, _regexOptions); - - if(_oFindIn.value == 1){ // Find in values or formulas. If cell is set value by formulas, find in formula, but don't find in value. - // otherwise, find in values - var bHadFound = false; - if(getAttribute(findCell,"formula") != null ){ - if(_findReg.exec(getAttribute(findCell, "formula"))){ - bHadFound = true; - } - } - else if(getAttribute(findCell, "ufv") != null){ - if(_findReg.exec(getAttribute(findCell, "ufv"))){ - bHadFound = true; - } - } - else if(_findReg.exec(sourceString)){ - bHadFound = true; - } - if(bHadFound){ - setActiveCell(findCell); // Had found - _activeCell = findCell; - return true; - } - } - else if(_oFindIn.value == 2){ //Only Find values in all cells. - if(_findReg.exec(sourceString)){ - setActiveCell(findCell); // Had found - _activeCell = findCell; - return true; - } - } - } - - if(findCell == _startSearchCell){ - alert("The specified text was not found!"); - return false; - } - } - while(true); -} - -//---------------------------------------------------------------------------------------------------- -// Replaces with the specified string and find next cell -//---------------------------------------------------------------------------------------------------- -function replace() { - var replaceCell = _startSearchCell; - var replaceCount = 0; - do{ - var sourceString; - sourceString = getInnerText(replaceCell); - if(replaceCount == 0){// Replace - if(isCanReplaced(replaceCell) && sourceString != null && sourceString != ""){ - _findReg = new RegExp(_findWhat, _regexOptions); - var txt; - if(getAttribute(replaceCell, "formula") != null ){ // Is Formula - if(_findReg.exec(getAttribute(replaceCell, "formula"))){ - if(_oWord.checked){ - txt = getAttribute(replaceCell, "formula").replace(_findReg,"$1" + _oReplaceWith.value + "$2"); - setCellValue(replaceCell,txt); - } - else{ - txt = getAttribute(replaceCell, "formula").replace(_findReg,_oReplaceWith.value); - setCellValue(replaceCell,txt); - } - replaceCount++; - } - } - else if(getAttribute(replaceCell, "ufv") != null){ // Is Data Format - if(_findReg.exec(getAttribute(replaceCell, "ufv"))){ - if(_oWord.checked){ - txt = getAttribute(replaceCell, "ufv").replace(_findReg,"$1" + _oReplaceWith.value + "$2"); - setCellValue(replaceCell,txt); - } - else{ - txt = getAttribute(replaceCell, "ufv").replace(_findReg,_oReplaceWith.value); - setCellValue(replaceCell,txt); - } - replaceCount++; - } - } - else if(_findReg.exec(sourceString)){ - if(_oWord.checked){ - txt = sourceString.replace(_findReg,"$1" + _oReplaceWith.value + "$2"); - setCellValue(replaceCell,txt); - } - else{ - txt = sourceString.replace(_findReg,_oReplaceWith.value); - setCellValue(replaceCell,txt); - } - replaceCount++; - } - } - } - else{ //Had replaced. Finds next and set it active. - if(isCanReplaced(replaceCell) && sourceString != null && sourceString != ""){ - _findReg = new RegExp(_findWhat, _regexOptions); - var bHadFound = false; - if(getAttribute(replaceCell,"formula") != null ){ - if(_findReg.exec(getAttribute(replaceCell, "formula"))){ - bHadFound = true; - } - } - else if(getAttribute(replaceCell, "ufv") != null){ - if(_findReg.exec(getAttribute(replaceCell, "ufv"))){ - bHadFound = true; - } - } - else if(_findReg.exec(sourceString)){ - bHadFound = true; - } - if(bHadFound){ - setActiveCell(replaceCell); // Had found - _activeCell = replaceCell; - return true; - } - } - } - - replaceCell = moveToNextCell3(); - - if(replaceCell == _startSearchCell){ - if(replaceCount == 0){ - alert("The specified text was not found or the cell is read only!"); - } - return false; - } - } - while(true); -} - -//---------------------------------------------------------------------------------------------------- -// Replaces with the specified string in all cells. -//---------------------------------------------------------------------------------------------------- -function replaceAll() { - var replaceCell = _startSearchCell; - var replaceCount = 0; - do{ - var sourceString; - sourceString = getInnerText(replaceCell); - if(isCanReplaced(replaceCell) && sourceString != null && sourceString != ""){ - _findReg = new RegExp(_findWhat, _regexOptions); - var txt; - if(getAttribute(replaceCell, "formula") != null ){ // Is Formula - if(_findReg.exec(getAttribute(replaceCell, "formula"))){ - if(_oWord.checked){ - txt = getAttribute(replaceCell, "formula").replace(_findReg,"$1" + _oReplaceWith.value + "$2"); - setCellValue(replaceCell,txt); - } - else{ - txt = getAttribute(replaceCell, "formula").replace(_findReg,_oReplaceWith.value); - setCellValue(replaceCell,txt); - } - _replaceAllCount++; - } - } - else if(getAttribute(replaceCell, "ufv") != null){ // Is Data Format - if(_findReg.exec(getAttribute(replaceCell, "ufv"))){ - if(_oWord.checked){ - txt = getAttribute(replaceCell, "ufv").replace(_findReg,"$1" + _oReplaceWith.value + "$2"); - setCellValue(replaceCell,txt); - } - else{ - txt = getAttribute(replaceCell, "ufv").replace(_findReg,_oReplaceWith.value); - setCellValue(replaceCell,txt); - } - replaceCount++; - } - } - else if(_findReg.exec(sourceString)){ - if(_oWord.checked){ - txt = sourceString.replace(_findReg,"$1" + _oReplaceWith.value + "$2"); - setCellValue(replaceCell,txt); - } - else{ - txt = sourceString.replace(_findReg,_oReplaceWith.value); - setCellValue(replaceCell,txt); - } - replaceCount++; - } - } - - replaceCell = moveToNextCell3(); - - if(replaceCell == _startSearchCell){ - if(replaceCount > 0){ - alert(replaceCount + " occurrence(s) replaced."); - } - else{ - alert("The specified text was not found or the cell is read only!"); - } - _startSearchCell = null; - return false; - } - } - while(true); -} - - -//---------------------------------------------------------------------------------------------------- -// Indicates whether the cell can execute replacing featrue. -//---------------------------------------------------------------------------------------------------- -function isCanReplaced(cell){ - var r = false; - if (getAttribute(cell, "protected") != "1" // Is not Read Only - && getAttribute(cell, "vtype") != "dlist"){ // Is not DropDownList - r = true; - } - return r; -} - -//---------------------------------------------------------------------------------------------------- -// Gets regular expression options -//---------------------------------------------------------------------------------------------------- -function getRegExpOptions(){ - var r = "gi"; - if(_oCase.checked){ - r = r.replace("i",""); - } - return r; -} - -//---------------------------------------------------------------------------------------------------- -// Escapes the meta characters in the specified string. -//---------------------------------------------------------------------------------------------------- -function escapeMetacharacters(s){ - var syntax = "\\^$*+?{}.()|[]"; // meta characters - for(var i=0; i= window.screenX && x < window.screenX + window.outerWidth; - condition2 = x + cell.offsetWidth > window.screenX && x + cell.offsetWidth <= window.screenX + window.outerWidth; - condition3 = y >= window.screenY && y < window.screenY + window.outerHeight; - condition4 = y + cell.offsetHeight > window.screenY && y + cell.offsetHeight <= window.screenY + window.outerHeight; - - if((condition1 || condition2) && (condition3 || condition4)){ - window.moveTo(x + cell.offsetWidth,y + cell.offsetHeight); - } - } - else{ // IE - offsetLeftToBody = offsetLeftToBody - panel.scrollLeft - _parentWindow.document.body.scrollLeft; - offsetTopToBody = offsetTopToBody - panel.scrollTop - _parentWindow.document.body.scrollTop; - - x = offsetLeftToBody + _parentWindow.screenLeft; - y = offsetTopToBody + _parentWindow.screenTop; - - condition1 = x >= window.screenLeft - _dialogEdgeLeftWidth && x < window.screenLeft - _dialogEdgeLeftWidth + parseFloat(dialogWidth); - condition2 = x + cell.offsetWidth > window.screenLeft - _dialogEdgeLeftWidth && x + cell.offsetWidth <= window.screenLeft - _dialogEdgeLeftWidth + parseFloat(dialogWidth); - condition3 = y >= window.screenTop - _dialogEdgeTopHeight && y < window.screenTop - _dialogEdgeTopHeight + parseFloat(dialogHeight); - condition4 = y + cell.offsetHeight > window.screenTop - _dialogEdgeTopHeight && y + cell.offsetHeight <= window.screenTop - _dialogEdgeTopHeight + parseFloat(dialogHeight); - - if((condition1 || condition2) && (condition3 || condition4)){ - dialogLeft = x + cell.offsetWidth; - dialogTop = y + cell.offsetHeight; - } - } -} - -//---------------------------------------------------------------------------------------------------- -// Sets cell value to txt. -//---------------------------------------------------------------------------------------------------- -function setCellValue(cell,txt){ - var index = cell.id.lastIndexOf("_"); - var xy = cell.id.substr(index+1,cell.id.length - index + 1).split("#"); - _element.setCellValue(xy[1], xy[0],txt); -} - -//---------------------------------------------------------------------------------------------------- -// Gets the specified name parameter in url string. -//---------------------------------------------------------------------------------------------------- -function getUrlParameter(name) -{ - var url = window.location.search; - - var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i"); - - if (reg.exec(url)) - return RegExp.$2; - else - return ""; -} - -function getTimeDistance(a,b){ - return b.getMilliseconds() - a.getMilliseconds() + 1000*(b.getSeconds() - a.getSeconds()); -} - -//---------------------------------------------------------------------------------------------------- -// Determines whether the specified object is valid cell. -//---------------------------------------------------------------------------------------------------- -function isValidCell(o){ - if (o.tagName == "TD" && o.id != null && o.id.indexOf(_element.id) == 0 && _cidReg.exec(o.id.substring(_element.id.length+1,o.id.length))) - return true; - else - return false; -} - -//---------------------------------------------------------------------------------------------------- -// Obsolete. Gets the next cell. -//---------------------------------------------------------------------------------------------------- -function moveToNextCell(cell){ - var currentViewTable = cell.offsetParent; - var cellIndex = cell.cellIndex; - var rowIndex = cell.parentNode.rowIndex; - if(_freeze){ - if(_oDirection.checked){ // Search up - if(cellIndex == 0 || currentViewTable.rows.length == 0 || currentViewTable.rows[rowIndex].cells.length == 0){ - if(rowIndex == 0){ - if(currentViewTable == _viewTable00){ - currentViewTable = _viewTable; - if(currentViewTable.rows.length > 0) - rowIndex = currentViewTable.rows.length - 1; - } - else if(currentViewTable == _viewTable01){ - currentViewTable = _viewTable00; - } - else if(currentViewTable == _viewTable10){ - currentViewTable = _viewTable01; - if(currentViewTable.rows.length > 0) - rowIndex = currentViewTable.rows.length - 1; - } - else if(currentViewTable == _viewTable){ - currentViewTable = _viewTable10; - } - } - else{ - if(currentViewTable == _viewTable00){ - currentViewTable = _viewTable01; - rowIndex--; - } - else if(currentViewTable == _viewTable01){ - currentViewTable = _viewTable00; - } - else if(currentViewTable == _viewTable10){ - currentViewTable = _viewTable; - rowIndex--; - } - else if(currentViewTable == _viewTable){ - currentViewTable = _viewTable10; - } - } - if(currentViewTable.rows.length > 0 && currentViewTable.rows[rowIndex].cells.length > 0) - cellIndex = currentViewTable.rows[rowIndex].cells.length -1; - } - else{ // Is not first cell in the row. Reduces cellIndex to 1 for move to next cell. - cellIndex--; - } - } - else{ // Search down - if(currentViewTable.rows.length == 0 ||currentViewTable.rows[rowIndex].cells.length == 0 || cellIndex == currentViewTable.rows[rowIndex].cells.length - 1 ){ - - cellIndex = 0; - if(rowIndex == currentViewTable.rows.length - 1 - || ((currentViewTable == _viewTable00 || currentViewTable == _viewTable01) && _viewTable00.rows.length == 0 && _viewTable01.rows.length == 0) - || ((currentViewTable == _viewTable10 || currentViewTable == _viewTable) && _viewTable10.rows.length == 0 && _viewTable.rows.length == 0)){ - if(currentViewTable == _viewTable00){ - currentViewTable = _viewTable01; - } - else if(currentViewTable == _viewTable01){ - currentViewTable = _viewTable10; - rowIndex = 0; - } - else if(currentViewTable == _viewTable10){ - currentViewTable = _viewTable; - } - else if(currentViewTable == _viewTable){ - currentViewTable = _viewTable00; - rowIndex = 0; - } - } - else{ - if(currentViewTable == _viewTable00){ - currentViewTable = _viewTable01; - } - else if(currentViewTable == _viewTable01){ - currentViewTable = _viewTable00; - rowIndex++; - } - else if(currentViewTable == _viewTable10){ - currentViewTable = _viewTable; - } - else if(currentViewTable == _viewTable){ - currentViewTable = _viewTable10; - rowIndex++; - } - } - } - else{ // Is not last cell in the row. Adds cellIndex to 1 for move to next cell. - cellIndex++; - } - } - } - else{ - if(_oDirection.checked){ // Search up - if(cellIndex == 0){ // Is the first cell in the row. - // The row move to next row and cellIndex is evaluated to the last cell index of next row. - if(rowIndex == 0){ - rowIndex = currentViewTable.rows.length - 1; - } - else{ - rowIndex--; - } - cellIndex = currentViewTable.rows[rowIndex].cells.length -1; - } - else{ // Is not first cell in the row. Reduces cellIndex to 1 for move to next cell. - cellIndex--; - } - } - else{ // Search down - if(cellIndex == currentViewTable.rows[rowIndex].cells.length -1){ // Is the last cell in the row. - // The row move to next row and cellIndex is evaluated to the first cell index of next row. - if(rowIndex == currentViewTable.rows.length - 1){ - rowIndex = 0; - } - else{ - rowIndex++; - } - cellIndex = 0; - } - else{ // Is not last cell in the row. Adds cellIndex to 1 for move to next cell. - cellIndex++; - } - } - } - - var cell = null; - if(currentViewTable.rows.length > 0 && currentViewTable.rows[rowIndex].cells.length > 0){ - cell = currentViewTable.rows[rowIndex].cells[cellIndex]; - } - if(cell != null && isValidCell(cell)) - return cell; - else - return moveToNextCell(cell); -} - -//---------------------------------------------------------------------------------------------------- -// Obsolete. Gets the next cell that is valid cell. -//---------------------------------------------------------------------------------------------------- -function moveToNextCell2(cell){ - if(_freeze){ - var currentViewTable = cell.offsetParent; - var rowIndex; - if(_oDirection.checked){ // Search up - if(cell.previousSibling != null){ - cell = cell.previousSibling; - } - else if(cell.parentElement.previousSibling != null){ - rowIndex = cell.parentElement.rowIndex; - if(currentViewTable == _viewTable00){ - cell = _viewTable01.rows[rowIndex - 1].lastChild; - } - else if(currentViewTable == _viewTable01){ - cell = _viewTable00.rows[rowIndex].lastChild; - } - else if(currentViewTable == _viewTable10){ - cell = _viewTable.rows[rowIndex - 1].lastChild; - } - else if(currentViewTable == _viewTable){ - cell = _viewTable10.rows[rowIndex].lastChild; - } - } - else{ - if(currentViewTable == _viewTable00){ - cell = _viewTable.rows[_viewTable.rows.length - 1].lastChild; - } - else if(currentViewTable == _viewTable01){ - cell = _viewTable00.rows[0].lastChild; - } - else if(currentViewTable == _viewTable10){ - cell = _viewTable01.rows[_viewTable01.rows.length - 1].lastChild; - } - else if(currentViewTable == _viewTable){ - cell = _viewTable10.rows[0].lastChild; - } - } - } - else{ - if(cell.nextSibling != null){ - cell = cell.nextSibling; - } - else if(cell.parentElement.nextSibling != null){ - rowIndex = cell.parentElement.rowIndex; - if(currentViewTable == _viewTable00){ - cell = _viewTable01.rows[rowIndex].firstChild; - } - else if(currentViewTable == _viewTable01){ - cell = _viewTable00.rows[rowIndex + 1].firstChild; - } - else if(currentViewTable == _viewTable10){ - cell = _viewTable.rows[rowIndex].firstChild; - } - else if(currentViewTable == _viewTable){ - cell = _viewTable10.rows[rowIndex + 1].firstChild; - } - } - else{ - if(currentViewTable == _viewTable00){ - cell = _viewTable01.rows[_viewTable01.rows.length - 1].firstChild; - } - else if(currentViewTable == _viewTable01){ - cell = _viewTable10.rows[0].firstChild; - } - else if(currentViewTable == _viewTable10){ - cell = _viewTable.rows[_viewTable.rows.length - 1].firstChild; - } - else if(currentViewTable == _viewTable){ - cell = _viewTable00.rows[0].firstChild; - } - } - } - } - else{ - if(_oDirection.checked){ // Search up - if(cell.previousSibling != null){ - cell = cell.previousSibling; - } - else if(cell.parentNode.previousSibling != null){ - cell = cell.parentNode.previousSibling.lastChild; - } - else{ - cell = cell.parentNode.parentNode.rows[cell.offsetParent.rows.length - 1].lastChild; - } - } - else{ - if(cell.nextSibling != null){ - cell = cell.nextSibling; - } - else if(cell.parentNode.nextSibling != null && cell.parentNode.nextSibling.nodeType == 1){ - cell = cell.parentNode.nextSibling.firstChild; - } - else{ - cell = cell.parentNode.parentNode.rows[0].firstChild; - } - } - } - if(isValidCell(cell)) - return cell; - else - return moveToNextCell2(cell); -} - -//---------------------------------------------------------------------------------------------------- -// Gets the next cell that is valid cell. -//---------------------------------------------------------------------------------------------------- -function moveToNextCell3(){ - if(navigator.appName.indexOf("Microsoft") == -1) {// Is not IE - if(_oDirection.checked){ // Search up - if(_currentCellIndex == 0){ // Is the first cell in the row. - // The row move to next row and cellIndex is evaluated to the last cell index of next row. - if(_currentRowIndex == 0){ - _currentRowIndex = _currentRowsLength - 1; - } - else{ - _currentRowIndex--; - - } - _currentCells = _currentRows[_currentRowIndex].cells; - _currentCellsLength = _currentCells.length; - _currentCellIndex = _currentCellsLength -1; - } - else{ // Is not first cell in the row. Reduces cellIndex to 1 for move to next cell. - _currentCellIndex--; - } - } - else{ // Search down - if(_currentCellIndex == _currentCellsLength -1){ // Is the last cell in the row. - // The row move to next row and cellIndex is evaluated to the first cell index of next row. - if(_currentRowIndex == _currentRowsLength - 1){ - _currentRowIndex = 0; - } - else{ - _currentRowIndex++; - } - _currentCells = _currentRows[_currentRowIndex].cells; - _currentCellsLength = _currentCells.length; - _currentCellIndex = 0; - } - else{ // Is not last cell in the row. Adds cellIndex to 1 for move to next cell. - _currentCellIndex++; - } - } - - var cell = null; - if(_currentRowsLength > 0 && _currentCellsLength > 0){ - cell = _currentCells[_currentCellIndex]; - } - if(cell != null && isValidCell(cell)) - return cell; - else - return moveToNextCell3(); - } - else{ //IE - if(_oDirection.checked){ // Search up - if(_cellIndex == 0){ - _cellIndex = _arrCells.length; - } - return _arrCells[--_cellIndex]; - } - else{ // Search down - if(_cellIndex == _arrCells.length - 1){ - _cellIndex = -1; - } - return _arrCells[++_cellIndex]; - } - } -} - -//---------------------------------------------------------------------------------------------------- -// Obsolete. Fills the cells to a array -//---------------------------------------------------------------------------------------------------- -function FillCellsToArray(startCell){ - //var a = new Date(); - var k = 0; - var i = 0; - _arrCells[i] = startCell; - _cellIndex = startCell.cellIndex; - - var rows = _viewTable.rows; - var rowslen = rows.length; - var i; - for (i=0; i - - Font - - - - - - - - - -
Font Borders
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Font:
- -
Style:
- -
Size:
- -
-
Underline
- Strikethrough
-
-
Horizontal alignment:
-
-
Vertical alignment:
-
-
- Font color
- - Background
-
Preview:
- -
-
Sample - Text -
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - - - diff --git a/Examples.GridWeb/src/main/webapp/grid/acw_client/fontdlg.js b/Examples.GridWeb/src/main/webapp/grid/acw_client/fontdlg.js deleted file mode 100644 index 70b5c278..00000000 --- a/Examples.GridWeb/src/main/webapp/grid/acw_client/fontdlg.js +++ /dev/null @@ -1,512 +0,0 @@ -//Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved. - -//Copyright (c) 2001-2011 Aspose Pty Ltd. All Rights Reserved. - -/***************************************************** - * Aspose.Cells.GridWeb Component Script File - * Copyright 2003-2011, All Rights Reserverd. - * V2.5.1 - *****************************************************/ -var acell; -var olist = null; -var setborder = null; -function initDlg() -{ - acell = dialogArguments; - if (acell.list != null && (typeof acell.list.length) == "number" && acell.list.length > 0) - { - olist = acell; - var range = olist.list[0]; - acell = olist.g.getCell(range.startRow, range.startCol); - } - - table2.style.height = table1.offsetHeight; - window.returnValue = false; - getSystemFonts(); - - preview.style.fontFamily = txtFont.value = acell.currentStyle.fontFamily; - preview.style.fontStyle = acell.currentStyle.fontStyle; - preview.style.fontWeight = acell.currentStyle.fontWeight; - preview.style.display = "table-cell"; - preview_parent_td.style.verticalAlign = acell.currentStyle.verticalAlign; - preview.style.textAlign = acell.currentStyle.textAlign; - //alert(preview_parent_td.style.height + ";" + acell.id + "---" + acell.style.verticalAlign + "acell.currentStyle.verticalAlign----------init;" + acell.currentStyle.verticalAlign + " & " + acell.align); - - var tmps = ""; - if (acell.currentStyle.fontStyle != "normal") - tmps += "Italic"; - - if (acell.currentStyle.fontWeight != "normal" && acell.currentStyle.fontWeight != "400") - { - if (tmps != "") - tmps += " Bold"; - else - tmps = "Bold"; - } - - if (tmps == "") - tmps = "Regular"; - - txtStyle.value = tmps; - - preview.style.fontSize = txtSize.value = acell.currentStyle.fontSize; - preview.style.color = btnFC.style.backgroundColor = acell.orgColor; - preview.style.backgroundColor = btnBG.style.backgroundColor = acell.orgBgColor; - - //chkSub.checked = acell.parentElement.currentStyle.verticalAlign == "sub"; - //chkSuper.checked = acell.parentElement.currentStyle.verticalAlign == "super"; - //preview.style.verticalAlign = acell.parentElement.currentStyle.verticalAlign; - - for (var op1 = 0; op1 < selHalign.options.length; op1++) - { - if (selHalign.options[op1].value == acell.currentStyle.textAlign) - { - selHalign.selectedIndex = op1; - break; - } - } - for (var op1 = 0; op1 < selValign.options.length; op1++) - { - if (selValign.options[op1].value == acell.currentStyle.verticalAlign) - { - selValign.selectedIndex = op1; - break; - } - } - - if (acell.tdstyle) - { - preview.style.textDecorationUnderline = chkUnderline.checked = acell.style.textDecorationUnderline; - preview.style.textDecorationLineThrough = chkStrike.checked = acell.style.textDecorationLineThrough; - } - else - { - acell.tdstyle = true; - acell.style.textDecoration = "none"; - for (var s1 = 0; s1 < acell.ownerDocument.styleSheets.length; s1++) - { - var styleSheet = acell.ownerDocument.styleSheets[s1]; - for (var s2 = 0; s2 < styleSheet.rules.length; s2++) - { - var rule = styleSheet.rules[s2]; - if (rule.selectorText == "."+acell.className) - { - acell.style.textDecorationUnderline = preview.style.textDecorationUnderline = chkUnderline.checked = rule.style.textDecorationUnderline; - acell.style.textDecorationLineThrough = preview.style.textDecorationLineThrough = chkStrike.checked = rule.style.textDecorationLineThrough; - s1 = acell.ownerDocument.styleSheets.length; - break; - } - } - } - } - - var ss = acell.all.tags("SPAN"); - if (ss.length > 0) - { - var txt = ss[0].innerText; - if (txt != "") - preview.innerText = txt; - } - else if (acell.innerText != "") - preview.innerText = acell.innerText; - - selValign.onchange = function () { - preview_parent_td.style.verticalAlign = this.value; - // preview.style.verticalAlign = this.value; - //alert("value updated1"); - - }; - selHalign.onchange = function () { - preview.style.textAlign = this.value; - // alert("value updated2"); - }; -} - -function getSystemFonts() -{ - var a=dlgHelper.fonts.count; - var fArray = new Array(); - var oDropDown = selFont; - for (var i = 1;i < dlgHelper.fonts.count;i++){ - fArray[i] = dlgHelper.fonts(i); - var oOption = document.createElement("OPTION"); - oDropDown.add(oOption); - oOption.text = fArray[i]; - oOption.Value = i; - } -} - -function chooseColor(rgbColor) -{ - var sColor = dlgHelper.ChooseColorDlg(rgbColor); - - //change decimal to hex - sColor = sColor.toString(16); - //add extra zeroes if hex number is less than 6 digits - if (sColor.length < 6) { - var sTempString = "000000".substring(0,6-sColor.length); - sColor = sTempString.concat(sColor); - } - - return sColor; -} - -function OnForeColorChange() -{ - preview.style.color = btnFC.style.backgroundColor; -} - -function OnBGColorChange() -{ - preview.style.backgroundColor = btnBG.style.backgroundColor; - preview_parent_td.style.backgroundColor = btnBG.style.backgroundColor; -} - -function OnFontChange() -{ - txtFont.value = selFont.options[selFont.selectedIndex].text; - OnFontChange1(); -} - -function OnFontChange1() -{ - preview.style.fontFamily = txtFont.value; -} - -function OnStyleChange() -{ - txtStyle.value = selStyle.options[selStyle.selectedIndex].text; - switch (txtStyle.value) - { - case "Regular": - preview.style.fontStyle="normal"; - preview.style.fontWeight="normal"; - break; - case "Italic": - preview.style.fontStyle="italic"; - preview.style.fontWeight="normal"; - break; - case "Bold": - preview.style.fontStyle="normal"; - preview.style.fontWeight="bold"; - break; - case "Italic Bold": - preview.style.fontStyle="italic"; - preview.style.fontWeight="bold"; - break; - } -} - -function OnSizeChange() -{ - txtSize.value = selSize.options[selSize.selectedIndex].text; - OnSizeChange1(); -} - -function OnSizeChange1() -{ - preview.style.fontSize = txtSize.value; -} - -function OnUnderline() -{ - preview.style.textDecorationUnderline = chkUnderline.checked; -} - -function OnLineThrough() -{ - preview.style.textDecorationLineThrough = chkStrike.checked; -} - -function FontOk() -{ - if (setborder != null) - setBorders(); - - if (getattr(acell, "protected") == "1") - acell = document.createElement("TD"); - acell.styleStr = acell.style.fontFamily = txtFont.value; - acell.styleStr += "|"; - switch (txtStyle.value) - { - case "Regular": - acell.style.fontStyle = "normal"; - acell.style.fontWeight = "normal"; - acell.styleStr += "r|"; - break; - - case "Italic": - acell.style.fontStyle = "italic"; - acell.style.fontWeight = "normal"; - acell.styleStr += "i|"; - break; - - case "Bold": - acell.style.fontStyle = "normal"; - acell.style.fontWeight = "bold"; - acell.styleStr += "b|"; - break; - - case "Italic Bold": - acell.style.fontStyle = "italic"; - acell.style.fontWeight = "bold"; - acell.styleStr += "ib|"; - break; - } - acell.style.fontSize = txtSize.value; - acell.style.textDecorationUnderline = chkUnderline.checked; - acell.style.textDecorationLineThrough = chkStrike.checked; - - acell.orgColor = btnFC.style.backgroundColor; - acell.orgBgColor = btnBG.style.backgroundColor; - - acell.style.textAlign = selHalign.options[selHalign.selectedIndex].value; - acell.style.verticalAlign = selValign.options[selValign.selectedIndex].value; - acell.align = selHalign.options[selHalign.selectedIndex].value; - - acell.styleStr += txtSize.value + "|" + chkUnderline.checked + "|" - + chkStrike.checked + "|" + btnFC.style.backgroundColor + "|" + btnBG.style.backgroundColor - + "|" + selHalign.options[selHalign.selectedIndex].value + "|" + selValign.options[selValign.selectedIndex].value; - - if (olist != null) - { - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - for (var c = range.startCol; c <= range.endCol; c++) - { - var cell = olist.g.getCell(r, c); - if (cell != null && cell != acell && getattr(cell, "protected") != "1") - { - cell.styleStr = acell.styleStr + "|" + (cell.tbstr!=null?cell.tbstr:"") + "|" + (cell.bbstr!=null?cell.bbstr:"") + "|" + (cell.lbstr!=null?cell.lbstr:"") + "|" + (cell.rbstr!=null?cell.rbstr:""); - cell.style.fontFamily = acell.style.fontFamily; - cell.style.fontStyle = acell.style.fontStyle; - cell.style.fontWeight = acell.style.fontWeight; - cell.style.fontSize = acell.style.fontSize; - cell.style.textDecorationUnderline = acell.style.textDecorationUnderline; - cell.style.textDecorationLineThrough = acell.style.textDecorationLineThrough; - cell.orgColor = acell.orgColor; - cell.orgBgColor = acell.orgBgColor; - //cell.style.textAlign = acell.style.textAlign; - cell.align = acell.align; - cell.style.verticalAlign = acell.style.verticalAlign; - } - } - } - } - } - acell.styleStr = acell.styleStr + "|" + (acell.tbstr!=null?acell.tbstr:"") + "|" + (acell.bbstr!=null?acell.bbstr:"") + "|" + (acell.lbstr!=null?acell.lbstr:"") + "|" + (acell.rbstr!=null?acell.rbstr:""); - window.returnValue = true; - window.close(); -} - -function showFont() -{ - btnFont.style.border = "1px inset white"; - btnBorders.style.border = "1px outset white"; - table1.style.display = "block"; - table2.style.display = "none"; -} - -function showBorders() -{ - btnBorders.style.border = "1px inset white"; - btnFont.style.border = "1px outset white"; - table1.style.display = "none"; - table2.style.display = "block"; -} - -function clickBorderBtn() -{ - var o = event.srcElement; - var id = o.id; - var i; - for (i = 1; i<=8; i++) - { - eval("b"+i+".style.border='3px ridge white';"); - } - o.style.border = "3px inset white"; - setborder = id; -} - -function setBorders() -{ - var bstr = borderWidth.options[borderWidth.selectedIndex].text + " " + borderStyle.options[borderStyle.selectedIndex].text + " " + btnBorderColor.style.backgroundColor; - if (olist == null) - { - switch (setborder) - { - case "b1": - acell.style.borderTop = "none"; - acell.style.borderBottom = "none"; - acell.style.borderLeft = "none"; - acell.style.borderRight = "none"; - acell.tbstr = acell.bbstr = acell.lbstr = acell.rbstr = "none"; - break; - - case "b2": - acell.style.borderBottom = bstr; - acell.bbstr = bstr; - break; - - case "b3": - acell.style.borderLeft = bstr; - acell.lbstr = bstr; - break; - - case "b4": - acell.style.borderRight = bstr; - acell.rbstr = bstr; - break; - - case "b5": - acell.style.borderTop = bstr; - acell.tbstr = bstr; - break; - - case "b6": - case "b7": - acell.style.borderBottom = bstr; - acell.style.borderLeft = bstr; - acell.style.borderRight = bstr; - acell.style.borderTop = bstr; - acell.tbstr = acell.bbstr = acell.lbstr = acell.rbstr = bstr; - break; - - case "b8": - acell.style.borderTop = bstr; - acell.style.borderBottom = bstr; - acell.tbstr = acell.bbstr = bstr; - break; - } - } - else - { - switch (setborder) - { - case "b1": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - for (var c = range.startCol; c <= range.endCol; c++) - { - var o = olist.g.getCell(r, c); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderTop = "none"; - o.style.borderBottom = "none"; - o.style.borderLeft = "none"; - o.style.borderRight = "none"; - o.tbstr = o.bbstr = o.lbstr = o.rbstr = "none"; - } - } - } - break; - - case "b2": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - var r = range.endRow; - for (var c = range.startCol; c <= range.endCol; c++) - { - var o = olist.g.getCell(r, c); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderBottom = bstr; - o.bbstr = bstr; - } - } - break; - - case "b3": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - var o = olist.g.getCell(r, range.startCol); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderLeft = bstr; - o.lbstr = bstr; - } - } - break; - - case "b4": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - var o = olist.g.getCell(r, range.endCol); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderRight = bstr; - o.rbstr = bstr; - } - } - break; - - case "b5": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var c = range.startCol; c <= range.endCol; c++) - { - var o = olist.g.getCell(range.startRow, c); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderTop = bstr; - o.tbstr = bstr; - } - } - break; - - case "b6": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - for (var c = range.startCol; c <= range.endCol; c++) - { - var o = olist.g.getCell(r, c); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderTop = bstr; - o.style.borderBottom = bstr; - o.style.borderLeft = bstr; - o.style.borderRight = bstr; - o.tbstr = o.bbstr = o.lbstr = o.rbstr = bstr; - } - } - } - break; - - case "b7": - setborder = "b2"; - setBorders(); - setborder = "b3"; - setBorders(); - setborder = "b4"; - setBorders(); - setborder = "b5"; - setBorders(); - break; - - case "b8": - setborder = "b2"; - setBorders(); - setborder = "b5"; - setBorders(); - break; - } - } -} - -function getattr(o, name) -{ - if (o.attributes[name] != null) - return o.attributes[name].nodeValue; - return o.attributes[name]; -} \ No newline at end of file diff --git a/Examples.GridWeb/src/main/webapp/grid/acw_client/fontdlg_l.htm b/Examples.GridWeb/src/main/webapp/grid/acw_client/fontdlg_l.htm deleted file mode 100644 index 03ef77af..00000000 --- a/Examples.GridWeb/src/main/webapp/grid/acw_client/fontdlg_l.htm +++ /dev/null @@ -1,166 +0,0 @@ - - - Font - - - - - - - - - -
Font Borders
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Font:
- -
Style:
- -
Size:
- -
-
Underline
- Strikethrough
-
-
Horizontal alignment:
-
-
Vertical alignment:
-
-
- Font color
- - Background
-
Preview:
-
Sample - Text -
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - diff --git a/Examples.GridWeb/src/main/webapp/grid/acw_client/fontdlg_l.js b/Examples.GridWeb/src/main/webapp/grid/acw_client/fontdlg_l.js deleted file mode 100644 index 933b4e85..00000000 --- a/Examples.GridWeb/src/main/webapp/grid/acw_client/fontdlg_l.js +++ /dev/null @@ -1,606 +0,0 @@ -//Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved. - -//Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved. - -/***************************************************** - * Aspose.Cells.GridWeb Component Script File - * Copyright 2003-2011, All Rights Reserverd. - * V2.5.1 - *****************************************************/ -var acell; -var olist = null; -var setborder = null; -var _element; - -function initDlg() -{ - _element = window.opener.acwDialogElement; - if (_element._selections != null && _element._selections.list.length > 0) - { - olist = _element._selections; - var range = olist.list[0]; - acell = _element.getCell(range.startRow, range.startCol); - } - else - acell = _element.ActiveCell; - - table2.style.height = table1.offsetHeight; - window.innerWidth = table1.offsetWidth; - window.innerHeight = document.body.offsetHeight; - - getSystemFonts(); - - if (!acell.tdstyle) - { - try {copyStyles();} - catch (ex) {} - acell.tdstyle = true; - } - - preview.style.fontFamily = txtFont.value = acell.style.fontFamily; - preview.style.fontStyle = acell.style.fontStyle; - preview.style.fontWeight = acell.style.fontWeight; - preview.style.display = "table-cell"; - preview.style.verticalAlign = acell.style.verticalAlign; - preview.parentNode.align = acell.align; - - - var tmps = ""; - if (acell.style.fontStyle != "" && acell.style.fontStyle != "normal") - tmps += "Italic"; - - if (acell.style.fontWeight != "" && acell.style.fontWeight != "normal") - { - if (tmps != "") - tmps += " Bold"; - else - tmps = "Bold"; - } - - if (tmps == "") - tmps = "Regular"; - - txtStyle.value = tmps; - - preview.style.fontSize = txtSize.value = acell.style.fontSize; - preview.style.color = btnFC.style.backgroundColor = acell.orgColor; - preview.style.backgroundColor = btnBG.style.backgroundColor = acell.orgBgColor; - - for (var op1 = 0; op1 < selHalign.options.length; op1++) - { - if (selHalign.options[op1].value == acell.align) - { - selHalign.selectedIndex = op1; - break; - } - } - for (var op1 = 0; op1 < selValign.options.length; op1++) - { - if (selValign.options[op1].value == acell.style.verticalAlign) - { - selValign.selectedIndex = op1; - break; - } - } - - preview.style.textDecorationUnderline = chkUnderline.checked = acell.style.textDecoration.indexOf("underline") != -1; - preview.style.textDecorationLineThrough = chkStrike.checked = acell.style.textDecoration.indexOf("line-through") != -1; - - var itext = acell.innerText; - if (itext != null && itext != "") - preview.innerText = itext; - - selValign.onchange = function () { - preview.style.verticalAlign = this.value; - - }; - selHalign.onchange = function () { - preview.parentNode.align = this.value; - }; - -} - -function copyStyles() -{ - acell.style.textDecoration = "none"; - for (var s1 = 0; s1 < acell.ownerDocument.styleSheets.length; s1++) - { - var styleSheet = acell.ownerDocument.styleSheets[s1]; - for (var s2 = 0; s2 < styleSheet.cssRules.length; s2++) - { - var rule = styleSheet.cssRules[s2]; - if (rule.selectorText == "."+acell.className) - { - acell.style.fontFamily = rule.style.fontFamily; - acell.style.fontStyle = rule.style.fontStyle; - acell.style.fontWeight = rule.style.fontWeight; - acell.style.fontSize = rule.style.fontSize; - acell.orgColor = rule.style.color; - acell.orgBgColor = rule.style.backgroundColor; - acell.style.textAlign = rule.style.textAlign; - acell.style.verticalAlign = acell.vAlign; - acell.style.textDecoration = rule.style.textDecoration; - - s1 = acell.ownerDocument.styleSheets.length; - break; - } - } - } -} - -function getSystemFonts() -{ - var fArray = new Array("System","Terminal","Fixedsys","Roman","Script","Modern","Small Fonts","MS Serif","WST_Czec","WST_Engl","WST_Fren","WST_Germ","WST_Ital","WST_Span","WST_Swed","Courier","MS ,ans Serif","Marlett","Arial","Courier New","Lucida Console","Lucida Sans Unicode","Times New ,oman","Wingdings","Symbol","Verdana","Arial Black","Comic Sans MS","Impact","Georgia","Franklin ,othic Medium","Palatino Linotype","Tahoma","Trebuchet MS","Webdings","Estrangelo Edessa","Gautami","Latha","Mangal","MV Boli","Raavi","Shruti","Tunga","Sylfaen","Microsoft Sans ,erif","MS Mincho","MS PMincho","MS Gothic","MS PGothic","MS UI Gothic","Gulim","GulimChe","Dotum","DotumChe","Batang","BatangChe","Gungsuh","GungsuhChe","MingLiU","PMingLiU","Agency FB","Algerian","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Baskerville Old Face","Bauhaus 93","Bell MT","Berlin Sans FB","Bernard MT Condensed","Blackadder ITC","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster ,ompressed","Book Antiqua","Bookman Old Style","Bradley Hand ITC","Britannic Bold","Broadway","Brush Script MT","Californian FB","Calisto MT","Castellar","Centaur","Century","Century Gothic","Century Schoolbook","Chiller","Colonna MT","Cooper Black","Copperplate Gothic Bold","Copperplate Gothic Light","Curlz MT","Edwardian ,cript ITC","Elephant","Engravers MT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ,TC","Felix Titling","Footlight MT Light","Forte","Franklin Gothic Book","Franklin Gothic Demi","Franklin Gothic Demi Cond","Franklin Gothic Heavy","Franklin Gothic Medium Cond","Freestyle ,cript","French Script MT","Garamond","Gigi","Gill Sans MT Ext Condensed Bold","Gill Sans MT","Gill ,ans MT Condensed","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gloucester MT Extra ,ondensed","Goudy Old Style","Goudy Stout","Haettenschweiler","Harlow Solid Italic","Harrington","High Tower Text","Imprint MT Shadow","Jokerman","Juice ITC","Kristen ITC","Kunstler Script","Lucida Bright","Lucida Calligraphy","Lucida Fax","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","MS Outlook","Magneto","Maiandra GD","Matura MT ,cript Capitals","Mistral","Modern No. 20","Monotype Corsiva","Niagara Engraved","Niagara Solid","OCR A Extended","Old English Text MT","Onyx","Palace Script MT","Papyrus","Parchment","Perpetua","Perpetua Titling MT","Playbill","Poor Richard","Pristina","Rage Italic","Ravie","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Informal Roman","Script MT Bold","Showcard Gothic","Snap ITC","Stencil","Tw Cen MT","Tw Cen ,T Condensed","Tempus Sans ITC","Viner Hand ITC","Vivaldi","Vladimir Script","Wide Latin","Wingdings 2","Wingdings 3","Berlin Sans FB Demi","MS Reference Sans Serif","MS Reference ,pecialty","Tw Cen MT Condensed Extra Bold","MT Extra","Bookshelf Symbol 7","Kingsoft Phonetic ,lain","Basemic","Basemic Symbol","Basemic Times","Addled","Calligraphic","DicotMedium","Geotype ,T","Harvest","HarvestItal","Lissen","PalentItal","Palent","Unpact","Whimsy TT"); - var oDropDown = selFont; - for (var i = 0;i < fArray.length;i++) - { - var oOption = document.createElement("OPTION"); - oDropDown.appendChild(oOption); - oOption.text = fArray[i]; - oOption.Value = i; - } -} - -function chooseColor() { - var url = window.location.pathname; - var lastIndex = url.lastIndexOf("/"); - var colordlghtml = url.substr(0, lastIndex) + "/colordlg.htm"; - window.colorElement = btnFC; - window.colorChanged = OnForeColorChange; - window.open(colordlghtml, "colordlg", "chrome,dependent,dialog,modal"); -} - -function chooseBgColor() { - var url = window.location.pathname; - var lastIndex = url.lastIndexOf("/"); - var colordlghtml = url.substr(0, lastIndex) + "/colordlg.htm"; - window.colorElement = btnBG; - window.colorChanged = OnBGColorChange; - window.open(colordlghtml, "colordlg", "chrome,dependent,dialog,modal"); -} - -function chooseBorderColor() { - var url = window.location.pathname; - var lastIndex = url.lastIndexOf("/"); - var colordlghtml = url.substr(0, lastIndex) + "/colordlg.htm"; - window.colorElement = btnBorderColor; - window.colorChanged = OnBorderColorChange; - window.open(colordlghtml, "colordlg", "chrome,dependent,dialog,modal"); -} - -function OnForeColorChange() -{ - preview.style.color = btnFC.style.backgroundColor; -} - -function OnBGColorChange() -{ - preview.style.backgroundColor = btnBG.style.backgroundColor; -} - -function OnBorderColorChange() -{ -} - -function OnFontChange() -{ - txtFont.value = selFont.options[selFont.selectedIndex].text; - OnFontChange1(); -} - -function OnFontChange1() -{ - preview.style.fontFamily = txtFont.value; -} - -function OnStyleChange() -{ - txtStyle.value = selStyle.options[selStyle.selectedIndex].text; - switch (txtStyle.value) - { - case "Regular": - preview.style.fontStyle="normal"; - preview.style.fontWeight="normal"; - break; - case "Italic": - preview.style.fontStyle="italic"; - preview.style.fontWeight="normal"; - break; - case "Bold": - preview.style.fontStyle="normal"; - preview.style.fontWeight="bold"; - break; - case "Italic Bold": - preview.style.fontStyle="italic"; - preview.style.fontWeight="bold"; - break; - } -} - -function OnSizeChange() -{ - txtSize.value = selSize.options[selSize.selectedIndex].text; - OnSizeChange1(); -} - -function OnSizeChange1() -{ - preview.style.fontSize = txtSize.value; -} - -function OnUnderline() -{ - preview.style.textDecorationUnderline = chkUnderline.checked; -} - -function OnLineThrough() -{ - preview.style.textDecorationLineThrough = chkStrike.checked; -} - -function FontOk() -{ - if (setborder != null) - setBorders(); - - if (getattr(acell, "protected") == "1") - acell = document.createElement("TD"); - acell.styleStr = acell.style.fontFamily = txtFont.value; - acell.styleStr += "|"; - switch (txtStyle.value) - { - case "Regular": - acell.style.fontStyle = "normal"; - acell.style.fontWeight = "normal"; - acell.styleStr += "r|"; - break; - - case "Italic": - acell.style.fontStyle = "italic"; - acell.style.fontWeight = "normal"; - acell.styleStr += "i|"; - break; - - case "Bold": - acell.style.fontStyle = "normal"; - acell.style.fontWeight = "bold"; - acell.styleStr += "b|"; - break; - - case "Italic Bold": - acell.style.fontStyle = "italic"; - acell.style.fontWeight = "bold"; - acell.styleStr += "ib|"; - break; - - default: - acell.style.fontStyle = "normal"; - acell.style.fontWeight = "normal"; - acell.styleStr += "r|"; - break; - } - acell.style.fontSize = txtSize.value; - - if (chkUnderline.checked) - acell.style.textDecoration = "underline"; - else - acell.style.textDecoration = ""; - if (chkStrike.checked) - { - if (chkUnderline.checked) - acell.style.textDecoration += " line-through"; - else - acell.style.textDecoration = "line-through"; - } - - if (!chkUnderline.checked && !chkStrike.checked) - acell.style.textDecoration = "none"; - - var color = acell.orgColor = btnFC.style.backgroundColor; - var bcolor = acell.orgBgColor = btnBG.style.backgroundColor; - if (color != null && color != "" && color.charAt(0) != "#") - color = transColor(color); - if (bcolor != null && bcolor != "" && bcolor.charAt(0) != "#") - bcolor = transColor(bcolor); - //acell.style.textAlign = selHalign.options[selHalign.selectedIndex].value; - acell.style.verticalAlign = selValign.options[selValign.selectedIndex].value; - //new added - acell.align =selHalign.options[selHalign.selectedIndex].value; - acell.styleStr += txtSize.value + "|" + chkUnderline.checked + "|" - + chkStrike.checked + "|" + color + "|" + bcolor - + "|" + selHalign.options[selHalign.selectedIndex].value + "|" + selValign.options[selValign.selectedIndex].value; - - if (olist != null) - { - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - for (var c = range.startCol; c <= range.endCol; c++) - { - var cell = olist.g.getCell(r, c); - if (cell != null && cell != acell && getattr(cell, "protected") != "1") - { - cell.styleStr = acell.styleStr + "|" + (cell.tbstr!=null?cell.tbstr:"") + "|" + (cell.bbstr!=null?cell.bbstr:"") + "|" + (cell.lbstr!=null?cell.lbstr:"") + "|" + (cell.rbstr!=null?cell.rbstr:""); - cell.style.fontFamily = acell.style.fontFamily; - cell.style.fontStyle = acell.style.fontStyle; - cell.style.fontWeight = acell.style.fontWeight; - cell.style.fontSize = acell.style.fontSize; - cell.style.textDecoration = acell.style.textDecoration; - cell.orgColor = acell.orgColor; - cell.orgBgColor = acell.orgBgColor; - //cell.style.textAlign = acell.style.textAlign; - cell.align = acell.align; - cell.style.verticalAlign = acell.style.verticalAlign; - } - } - } - } - } - acell.styleStr = acell.styleStr + "|" + (acell.tbstr!=null?acell.tbstr:"") + "|" + (acell.bbstr!=null?acell.bbstr:"") + "|" + (acell.lbstr!=null?acell.lbstr:"") + "|" + (acell.rbstr!=null?acell.rbstr:""); - _element.closeFontDialog(); - window.returnValue = true; - window.close(); -} - -function showFont() -{ - btnFont.style.border = "1px inset white"; - btnBorders.style.border = "1px outset white"; - table1.style.display = "block"; - table2.style.display = "none"; -} - -function showBorders() -{ - btnBorders.style.border = "1px inset white"; - btnFont.style.border = "1px outset white"; - table1.style.display = "none"; - table2.style.display = "block"; -} - -function clickBorderBtn(ev) -{ - var o = ev.target; - var id = o.id; - var i; - for (i = 1; i<=8; i++) - { - eval("b"+i+".style.border='3px ridge white';"); - } - o.style.border = "3px inset white"; - setborder = id; -} - -function transColor(color) -{ - var rx = /^rgb\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)$/; - var matches = rx.exec(color); - if (matches != null) - { - var sColor = Number(Number(matches[1])*65536+Number(matches[2])*256+Number(matches[3])); - sColor = sColor.toString(16); - var sTempString = "#000000".substring(0,7-sColor.length); - sColor = sTempString.concat(sColor); - return sColor; - } - return ""; -} - -function setBorders() -{ - var bcolor = btnBorderColor.style.backgroundColor; - if (bcolor != null && bcolor != "") - bcolor = transColor(bcolor); - var bstr = borderWidth.options[borderWidth.selectedIndex].text + " " + borderStyle.options[borderStyle.selectedIndex].text + " " + bcolor; - if (olist == null) - { - switch (setborder) - { - case "b1": - acell.style.borderTop = "none"; - acell.style.borderBottom = "none"; - acell.style.borderLeft = "none"; - acell.style.borderRight = "none"; - acell.tbstr = acell.bbstr = acell.lbstr = acell.rbstr = "none"; - break; - - case "b2": - acell.style.borderBottom = bstr; - acell.bbstr = bstr; - break; - - case "b3": - acell.style.borderLeft = bstr; - acell.lbstr = bstr; - break; - - case "b4": - acell.style.borderRight = bstr; - acell.rbstr = bstr; - break; - - case "b5": - acell.style.borderTop = bstr; - acell.tbstr = bstr; - break; - - case "b6": - case "b7": - acell.style.borderBottom = bstr; - acell.style.borderLeft = bstr; - acell.style.borderRight = bstr; - acell.style.borderTop = bstr; - acell.tbstr = acell.bbstr = acell.lbstr = acell.rbstr = bstr; - break; - - case "b8": - acell.style.borderTop = bstr; - acell.style.borderBottom = bstr; - acell.tbstr = acell.bbstr = bstr; - break; - } - } - else - { - switch (setborder) - { - case "b1": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - for (var c = range.startCol; c <= range.endCol; c++) - { - var o = olist.g.getCell(r, c); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderTop = "none"; - o.style.borderBottom = "none"; - o.style.borderLeft = "none"; - o.style.borderRight = "none"; - o.tbstr = o.bbstr = o.lbstr = o.rbstr = "none"; - } - } - } - break; - - case "b2": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - var r = range.endRow; - for (var c = range.startCol; c <= range.endCol; c++) - { - var o = olist.g.getCell(r, c); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderBottom = bstr; - o.bbstr = bstr; - } - } - break; - - case "b3": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - var o = olist.g.getCell(r, range.startCol); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderLeft = bstr; - o.lbstr = bstr; - } - } - break; - - case "b4": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - var o = olist.g.getCell(r, range.endCol); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderRight = bstr; - o.rbstr = bstr; - } - } - break; - - case "b5": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var c = range.startCol; c <= range.endCol; c++) - { - var o = olist.g.getCell(range.startRow, c); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderTop = bstr; - o.tbstr = bstr; - } - } - break; - - case "b6": - for (var i = 0; i < olist.list.length; i++) - { - var range = olist.list[i]; - for (var r = range.startRow; r <= range.endRow; r++) - { - for (var c = range.startCol; c <= range.endCol; c++) - { - var o = olist.g.getCell(r, c); - if (o == null || getattr(o, "protected") == "1") continue; - o.style.borderTop = bstr; - o.style.borderBottom = bstr; - o.style.borderLeft = bstr; - o.style.borderRight = bstr; - o.tbstr = o.bbstr = o.lbstr = o.rbstr = bstr; - } - } - } - break; - - case "b7": - setborder = "b2"; - setBorders(); - setborder = "b3"; - setBorders(); - setborder = "b4"; - setBorders(); - setborder = "b5"; - setBorders(); - break; - - case "b8": - setborder = "b2"; - setBorders(); - setborder = "b5"; - setBorders(); - break; - } - } -} - -function disableEvent(ele) -{ - _omd = ele.onmousedown; - _omu = ele.onmouseup; - _oc = ele.onclick; - _omo = ele.onmouseover; - _odc = ele.ondblclick; - _omm = ele.onmousemove; - _ocm = ele.oncontextmenu; - ele.onmousedown = null; - ele.onmouseup = null; - ele.onclick = null; - ele.onmouseover = null; - ele.ondblclick = null; - ele.onmousemove = null; - ele.oncontextmenu = null; -} - -function enableEvent(ele) -{ - ele.onmousedown = _omd; - ele.onmouseup = _omu; - ele.onclick = _oc; - ele.onmouseover = _omo; - ele.ondblclick = _odc; - ele.onmousemove = _omm; - ele.oncontextmenu = _ocm; -} - -function closeDlg() -{ - window.opener.acwDialogWindow = null; -} - -function getattr(o, name) -{ - if (o.attributes[name] != null) - return o.attributes[name].nodeValue; - return o.attributes[name]; -} diff --git a/Examples.GridWeb/src/main/webapp/grid/acw_client/form.gif b/Examples.GridWeb/src/main/webapp/grid/acw_client/form.gif deleted file mode 100644 index 162ad151..00000000 Binary files a/Examples.GridWeb/src/main/webapp/grid/acw_client/form.gif and /dev/null differ diff --git a/Examples.GridWeb/src/main/webapp/grid/acw_client/gridwebform.js b/Examples.GridWeb/src/main/webapp/grid/acw_client/gridwebform.js deleted file mode 100644 index dc34affe..00000000 --- a/Examples.GridWeb/src/main/webapp/grid/acw_client/gridwebform.js +++ /dev/null @@ -1,371 +0,0 @@ -//Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved. - -/***************************************************** - * Aspose.Cells.GridWeb Component Script File - * Copyright 2003-2011, All Rights Reserverd. - * V2.4.0 - *****************************************************/ -function onselectchange(o) -{ - o.parentNode.firstChild.value=o.options[o.selectedIndex].value; -} - -function oncheckboxclick(o) -{ - o.parentNode.firstChild.value = o.checked? "TRUE":"FALSE"; -} - -function savePos(gform) -{ - var pos = document.getElementById(gform.id + "_POS"); - pos.value = document.body.scrollLeft + "|" + document.body.scrollTop; -} - -function initPos(gform) -{ - if (getattr(gform, "bodyleft") != null) - document.body.scrollLeft = getattr(gform, "bodyleft"); - if (getattr(gform, "bodytop") != null) - document.body.scrollTop = getattr(gform, "bodytop"); -} - -function formValidateAll(gform) -{ - var vresult = true; - var ftab = document.getElementById(gform.id + "_ETAB"); - var decimalpoint = getattr(gform, "decimalpoint"); - for (var r=0; r0 ? m[2] : "0") + "." + m[4]; - num = parseFloat(cleanInput); - return (isNaN(num) ? null : num); - } - else if (dataType == "Date") { - var yearFirstExp = /^(\d{4})-(\d{2})-(\d{2})$/; - m = op.match(yearFirstExp); - var day, month, year; - if (m != null) { - year = m[1]; - month = m[2]; - day = m[3]; - } - else { - return null; - } - month-=1; - var date = new Date(year, month, day); - return (typeof(date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate()) ? date.valueOf() : null; - } - else if (dataType == "DateTime") { - var yearFirstExp = /^(\d{4})-(\d{2})-(\d{2}) (\d+)\:(\d+)\:(\d+)$/; - m = op.match(yearFirstExp); - var day, month, year, hour, minu, sec; - if (m != null) { - year = m[1]; - month = m[2]; - day = m[3]; - hour = m[4]; - minu = m[5]; - sec = m[6]; - } - else { - return null; - } - month-=1; - var date = new Date(year, month, day, hour, minu, sec); - return (typeof(date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate() && hour == date.getHours() && minu == date.getMinutes() && sec == date.getSeconds()) ? date.valueOf() : null; - } - else { - return op.toString(); - } -} - -function setValid(o) -{ - o.style.border = ""; -} - -function setInvalid(o) -{ - o.style.border = "1px dotted red"; -} - -function dateBtnClick(gform, o) -{ - var Calendar = o.calendar; - if (Calendar != null) - { - o.calendar = null; - Calendar.removeNode(true); - } - else - { - Calendar = document.createElement("SPAN"); - document.body.appendChild(Calendar); - Calendar.dateBtn = o; - Calendar.style.position = "absolute"; - Calendar.style.display = "block"; - Calendar.style.width = 280; - Calendar.style.height = 150; - Calendar.style.zIndex = 99999999; - o.calendar = Calendar; - - Calendar.style.posLeft = document.body.scrollLeft + event.clientX; - Calendar.style.posTop = document.body.scrollTop + event.clientY; - var left = Calendar.offsetLeft - event.offsetX - 1; - if (left < 0) - left = 0; - var top = Calendar.offsetTop + o.offsetHeight - event.offsetY - 1; - if (top < 0) - top = 0; - Calendar.style.posLeft = left; - Calendar.style.posTop = top; - - Calendar.addBehavior(gform.acw_client_path+"calendar.htc"); - if (Calendar.readyState == "complete") - Calendar.attachEvent("onpropertychange", onCalendarChange); - else - Calendar.onreadystatechange = onCalendarReady; - } -} - -function onCalendarReady() -{ - var Calendar = event.srcElement; - if (Calendar.readyState == "complete") - Calendar.attachEvent("onpropertychange", onCalendarChange); -} - -function onCalendarChange() -{ - var Calendar = event.srcElement; - var ActiveCell = Calendar.dateBtn.parentElement.firstChild; - if (event.propertyName == "day") - { - var day = Calendar.day.toString(); - if (day.length == 1) - day = '0' + day; - var month = Calendar.month.toString(); - if (month.length == 1) - month = '0' + month; - var datestr = Calendar.year.toString() + '-' + month + '-' + day; - ActiveCell.value = datestr; - Calendar.dateBtn.calendar = null; - Calendar.removeNode(true); - } -} - -function enableAll(gform) -{ - var eles = gform.getElementsByTagName("INPUT"); - for (var i=0; ia?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ -return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("