Added a build version
This commit is contained in:
parent
35d70d4b1d
commit
842fd2c66f
19
modules/gwtorganise/.externalToolBuilders/New_Builder.launch
Normal file
19
modules/gwtorganise/.externalToolBuilders/New_Builder.launch
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
|
||||
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/gwtorganise/build.xml"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="gwtorganise"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/gwtorganise/build.xml}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/gwtorganise}"/>
|
||||
</launchConfiguration>
|
@ -30,6 +30,16 @@
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>LaunchConfigHandle</key>
|
||||
<value><project>/.externalToolBuilders/New_Builder.launch</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#Thu Feb 11 15:27:06 NZDT 2010
|
||||
#Fri Mar 26 11:43:34 NZDT 2010
|
||||
eclipse.preferences.version=1
|
||||
entryPointModules=
|
||||
filesCopiedToWebInfLib=gwt-servlet.jar
|
||||
|
21
modules/gwtorganise/build.xml
Normal file
21
modules/gwtorganise/build.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generate a java class with the current svn revision number -->
|
||||
<project>
|
||||
<echo>Generate build info class...</echo>
|
||||
<tstamp>
|
||||
<format property="TODAY" pattern="EEE, d-MMMM-yyyy HH:mm:ss z" locale="ENGLISH, GERMANY"/>
|
||||
</tstamp>
|
||||
<echo>Virtual PVT Cell Revision: ${svn.revision}</echo>
|
||||
<echo>Time stamp ${TODAY}</echo>
|
||||
<echo>Write build info to file ${basedir}\helpers\BuildInfo.java</echo>
|
||||
<!-- the source code of the java class -->
|
||||
<echo file="${basedir}\helpers\revision.php">
|
||||
<?php defined("SYSPATH") or die("No direct script access.");
|
||||
class revision_Core {
|
||||
static function getTimeStamp(){
|
||||
return "${TODAY}";
|
||||
}
|
||||
}
|
||||
|
||||
</echo>
|
||||
</project>
|
@ -73,13 +73,21 @@ class Json_Album_Controller extends Controller {
|
||||
access::verify_csrf();
|
||||
|
||||
$target_album = ORM::factory("item", $target_album_id);
|
||||
access::required("view", $target_album);
|
||||
access::required("add", $target_album);
|
||||
|
||||
$source_album = null;
|
||||
|
||||
$js = json_decode($_REQUEST["sourceids"]);
|
||||
|
||||
$i = 0;
|
||||
$source_album = null;
|
||||
foreach ($js as $source_id) {
|
||||
$source = ORM::factory("item", $source_id);
|
||||
if (empty($source_album)) { // get the source_album
|
||||
$source_album = $source->parent();
|
||||
}
|
||||
if (!$source->contains($target_album)) {
|
||||
access::required("edit", $source);
|
||||
item::move($source, $target_album);
|
||||
}
|
||||
$i++;
|
||||
@ -226,12 +234,7 @@ class Json_Album_Controller extends Controller {
|
||||
print json_encode(array("result" => "success"));
|
||||
}
|
||||
|
||||
public function rotate($id, $dir) {
|
||||
access::verify_csrf();
|
||||
$item = model_cache::get("item", $id);
|
||||
access::required("view", $item);
|
||||
access::required("edit", $item);
|
||||
|
||||
public function p_rotate($item, $dir){
|
||||
$degrees = 0;
|
||||
switch($dir) {
|
||||
case "ccw":
|
||||
@ -262,6 +265,63 @@ class Json_Album_Controller extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
public function delete_many($id) {
|
||||
|
||||
access::verify_csrf();
|
||||
|
||||
$js = json_decode($_REQUEST["sourceids"]);
|
||||
|
||||
$i = 0;
|
||||
$toreturn = array();
|
||||
foreach ($js as $item_id) {
|
||||
$item = ORM::factory("item", $item_id);
|
||||
access::required("view", $item);
|
||||
access::required("edit", $item);
|
||||
if ($item->is_album()) {
|
||||
$msg = t("Deleted album <b>%title</b>", array("title" => html::purify($item->title)));
|
||||
} else {
|
||||
$msg = t("Deleted photo <b>%title</b>", array("title" => html::purify($item->title)));
|
||||
}
|
||||
$parent = $item->parent();
|
||||
$item->delete();
|
||||
message::success($msg);
|
||||
}
|
||||
|
||||
print json_encode(array("result" => "success"));
|
||||
|
||||
}
|
||||
|
||||
public function rotate_many($dir) {
|
||||
access::verify_csrf();
|
||||
|
||||
$js = json_decode($_REQUEST["sourceids"]);
|
||||
|
||||
$i = 0;
|
||||
$toreturn = array();
|
||||
foreach ($js as $item_id) {
|
||||
$item = ORM::factory("item", $item_id);
|
||||
access::required("view", $item);
|
||||
access::required("edit", $item);
|
||||
$item = $this->p_rotate($item, $dir);
|
||||
$toreturn[$item_id] = self::child_json_encode($item);
|
||||
$i++;
|
||||
}
|
||||
|
||||
print json_encode($toreturn);
|
||||
}
|
||||
|
||||
|
||||
public function rotate($id, $dir) {
|
||||
access::verify_csrf();
|
||||
$item = model_cache::get("item", $id);
|
||||
access::required("view", $item);
|
||||
access::required("edit", $item);
|
||||
|
||||
$item = $this->p_rotate($item, $dir);
|
||||
|
||||
print json_encode(self::child_json_encode($item));
|
||||
}
|
||||
|
||||
|
9
modules/gwtorganise/helpers/revision.php
Normal file
9
modules/gwtorganise/helpers/revision.php
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
<?php defined("SYSPATH") or die("No direct script access.");
|
||||
class revision_Core {
|
||||
static function getTimeStamp(){
|
||||
return "Fri, 16-April-2010 14:55:28 NZST";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ import com.google.gwt.user.client.ui.MenuBar;
|
||||
import com.google.gwt.user.client.ui.MenuItem;
|
||||
import com.google.gwt.user.client.ui.PopupPanel;
|
||||
import com.google.gwt.user.client.ui.TreeItem;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
/**
|
||||
* encapsulates an album
|
||||
@ -189,7 +190,6 @@ public class Album extends TreeItem {
|
||||
popupMenuBar.addItem(addAlbum);
|
||||
popupMenuBar.addItem(userPermissions);
|
||||
|
||||
|
||||
popupMenuBar.setVisible(true);
|
||||
popupPanel.add(popupMenuBar);
|
||||
|
||||
|
@ -28,19 +28,7 @@ public class AlbumItemDropContainer implements DropController{
|
||||
|
||||
@Override
|
||||
public void onDrop(DragContext context) {
|
||||
JSONArray jsa = new JSONArray();
|
||||
|
||||
int i = 0;
|
||||
for (Widget widget : context.selectedWidgets){
|
||||
if (widget instanceof Item){
|
||||
jsa.set(i, new JSONNumber(((Item)widget).getID()));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
m_Album.moveTo(jsa);
|
||||
// context.
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
m_Album.moveTo(Utils.extractIds(context));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,73 @@
|
||||
package com.gloopics.g3viewer.client;
|
||||
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.http.client.RequestBuilder;
|
||||
import com.google.gwt.http.client.RequestException;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.DialogBox;
|
||||
import com.google.gwt.user.client.ui.DockPanel;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
|
||||
|
||||
public class ConfirmDialogBox extends DialogBox {
|
||||
|
||||
public ConfirmCallBack m_Callback;
|
||||
private final HTML m_Dialog;
|
||||
|
||||
public interface ConfirmCallBack{
|
||||
void ok();
|
||||
}
|
||||
|
||||
public ConfirmDialogBox(G3Viewer a_Parent){
|
||||
m_Dialog = new HTML("Empty");
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public void initComponents(){
|
||||
setModal(true);
|
||||
addStyleName("dialog");
|
||||
setAnimationEnabled(true);
|
||||
setText("Confirm");
|
||||
|
||||
Button close = new Button("Cancel", new ClickHandler() {
|
||||
|
||||
public void onClick(ClickEvent event) {
|
||||
ConfirmDialogBox.this.hide();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Button ok = new Button("ok", new ClickHandler() {
|
||||
|
||||
public void onClick(ClickEvent event) {
|
||||
if (m_Callback!=null)
|
||||
{
|
||||
m_Callback.ok();
|
||||
}
|
||||
|
||||
ConfirmDialogBox.this.hide();
|
||||
}
|
||||
});
|
||||
|
||||
FlowPanel fp = new FlowPanel();
|
||||
fp.add(ok);
|
||||
fp.add(close);
|
||||
fp.addStyleName("dButtons");
|
||||
DockPanel dp = new DockPanel();
|
||||
dp.add(m_Dialog , DockPanel.CENTER);
|
||||
dp.add(fp, DockPanel.SOUTH);
|
||||
dp.addStyleName("dContents");
|
||||
add(dp);
|
||||
|
||||
}
|
||||
|
||||
public void doDialog(String a_Message, ConfirmCallBack a_Callback){
|
||||
m_Callback = a_Callback;
|
||||
m_Dialog.setHTML(a_Message);
|
||||
show();
|
||||
}
|
||||
|
||||
}
|
@ -17,6 +17,8 @@ package com.gloopics.g3viewer.client;
|
||||
|
||||
|
||||
import com.allen_sauer.gwt.dnd.client.PickupDragController;
|
||||
import com.gloopics.g3viewer.client.ConfirmDialogBox.ConfirmCallBack;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Document;
|
||||
import com.google.gwt.dom.client.InputElement;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
@ -133,11 +135,22 @@ public class G3Viewer {
|
||||
*/
|
||||
public static final String ROTATE_URL = BASE_URL + "index.php/json_album/rotate/";
|
||||
|
||||
/**
|
||||
* rotate url
|
||||
*/
|
||||
public static final String ROTATE_ALL_URL = BASE_URL + "index.php/json_album/rotate_many/";
|
||||
|
||||
/**
|
||||
* Resize details URL
|
||||
*/
|
||||
public static final String RESIZE_DETAILS_URL = BASE_URL + "index.php/json_album/resize_config";
|
||||
|
||||
/**
|
||||
* Resize details URL
|
||||
*/
|
||||
public static final String DELETE_ALL_URL = BASE_URL + "index.php/json_album/delete_many/";
|
||||
|
||||
|
||||
/*
|
||||
* tree
|
||||
*/
|
||||
@ -158,6 +171,11 @@ public class G3Viewer {
|
||||
*/
|
||||
private final HttpDialogBox m_HttpDialogBox= new HttpDialogBox(this);
|
||||
|
||||
/**
|
||||
* the only confirmation dialog box
|
||||
*/
|
||||
private final ConfirmDialogBox m_ConfirmDialogBox = new ConfirmDialogBox(this);
|
||||
|
||||
private class SimplePanelEx extends SimplePanel
|
||||
{
|
||||
public SimplePanelEx()
|
||||
@ -223,7 +241,7 @@ public class G3Viewer {
|
||||
/**
|
||||
* the drag controller
|
||||
*/
|
||||
private final PickupDragController m_DragController;
|
||||
private final MyPickupDragController m_DragController;
|
||||
|
||||
/**
|
||||
* the upload control
|
||||
@ -235,7 +253,7 @@ public class G3Viewer {
|
||||
*/
|
||||
|
||||
public G3Viewer(){
|
||||
m_DragController = new PickupDragController(RootPanel.get(),false);
|
||||
m_DragController = new MyPickupDragController(RootPanel.get(),false);
|
||||
m_DragController.setBehaviorMultipleSelection(true);
|
||||
m_DragController.setBehaviorDragStartSensitivity(5);
|
||||
m_DragController.setBehaviorDragProxy(true);
|
||||
@ -307,7 +325,7 @@ public class G3Viewer {
|
||||
/**
|
||||
* returns the drag controller
|
||||
*/
|
||||
public PickupDragController getDragController(){
|
||||
public MyPickupDragController getDragController(){
|
||||
return m_DragController;
|
||||
}
|
||||
|
||||
@ -328,6 +346,11 @@ public class G3Viewer {
|
||||
m_HttpDialogBox.doDialog(BASE_URL + a_Url, a_Handler);
|
||||
}
|
||||
|
||||
public void doConfirm(String a_Text, ConfirmCallBack a_Handler)
|
||||
{
|
||||
m_ConfirmDialogBox.doDialog(a_Text, a_Handler);
|
||||
}
|
||||
|
||||
public void showImage(String a_Url)
|
||||
{
|
||||
m_ImageDialogBox.doDialog( a_Url);
|
||||
|
@ -20,8 +20,9 @@ import com.google.gwt.user.client.ui.DockPanel;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.FormPanel;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
|
||||
|
||||
public class HttpDialogBox extends DialogBox{
|
||||
public class HttpDialogBox extends DialogBox {
|
||||
|
||||
private FormPanel m_FormPanel = null;
|
||||
|
||||
@ -30,13 +31,13 @@ public class HttpDialogBox extends DialogBox{
|
||||
private final HTML m_Dialog;
|
||||
private final G3Viewer m_Parent;
|
||||
|
||||
public HttpDialogBox(G3Viewer a_Parent){
|
||||
public HttpDialogBox(G3Viewer a_Parent) {
|
||||
m_Parent = a_Parent;
|
||||
m_Dialog = new HTML("Empty");
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public void initComponents(){
|
||||
public void initComponents() {
|
||||
setModal(true);
|
||||
addStyleName("dialog");
|
||||
setAnimationEnabled(true);
|
||||
@ -51,18 +52,11 @@ public class HttpDialogBox extends DialogBox{
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Button ok = new Button("ok", new ClickHandler() {
|
||||
|
||||
public void onClick(ClickEvent event) {
|
||||
if (m_FormPanel!=null)
|
||||
{
|
||||
submitForm();
|
||||
}
|
||||
|
||||
HttpDialogBox.this.hide();
|
||||
Loading.getInstance().loading("Please Wait..");
|
||||
}
|
||||
});
|
||||
|
||||
FlowPanel fp = new FlowPanel();
|
||||
@ -70,7 +64,7 @@ public class HttpDialogBox extends DialogBox{
|
||||
fp.add(close);
|
||||
fp.addStyleName("dButtons");
|
||||
DockPanel dp = new DockPanel();
|
||||
dp.add(m_Dialog , DockPanel.CENTER);
|
||||
dp.add(m_Dialog, DockPanel.CENTER);
|
||||
dp.add(fp, DockPanel.SOUTH);
|
||||
dp.addStyleName("dContents");
|
||||
add(dp);
|
||||
@ -83,12 +77,13 @@ public class HttpDialogBox extends DialogBox{
|
||||
|
||||
private final String m_URL;
|
||||
|
||||
public RequestCallbackImpl(String a_URL){
|
||||
public RequestCallbackImpl(String a_URL) {
|
||||
m_URL = a_URL;
|
||||
}
|
||||
|
||||
public void onError(Request request, Throwable exception) {
|
||||
showDialog("Could not get " + m_URL + " Exception thrown " + exception.toString());
|
||||
showDialog("Could not get " + m_URL + " Exception thrown "
|
||||
+ exception.toString());
|
||||
}
|
||||
|
||||
public void onResponseReceived(Request request, Response response) {
|
||||
@ -101,7 +96,6 @@ public class HttpDialogBox extends DialogBox{
|
||||
}
|
||||
|
||||
public native static String createData(Element form) /*-{
|
||||
|
||||
var fieldValue = function(el, successful) {
|
||||
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
|
||||
if (typeof successful == 'undefined') successful = true;
|
||||
@ -166,10 +160,10 @@ public class HttpDialogBox extends DialogBox{
|
||||
}
|
||||
|
||||
return a;
|
||||
|
||||
}-*/;
|
||||
|
||||
private void submitForm(){
|
||||
private void submitForm() {
|
||||
if (m_FormPanel != null) {
|
||||
String url = m_FormPanel.getAction();
|
||||
|
||||
String data = createData(m_FormPanel.getElement());
|
||||
@ -179,42 +173,46 @@ public class HttpDialogBox extends DialogBox{
|
||||
@Override
|
||||
public void success(JSONValue aValue) {
|
||||
JSONObject object = aValue.isObject();
|
||||
if (object != null){
|
||||
if (object != null) {
|
||||
JSONValue result = object.get("result");
|
||||
if (result != null)
|
||||
{
|
||||
if (result.isString().stringValue().equals("success")){
|
||||
if (result != null) {
|
||||
if (result.isString().stringValue().equals(
|
||||
"success")) {
|
||||
m_Callback.success(aValue.toString());
|
||||
Loading.getInstance().endLoading();
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
JSONValue resul = object.get("form");
|
||||
showDialog(resul.isString().stringValue());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
G3Viewer.displayError("result was null ", aValue.toString() );
|
||||
} else {
|
||||
G3Viewer.displayError("result was null ", aValue
|
||||
.toString());
|
||||
}
|
||||
} else {
|
||||
G3Viewer.displayError("Only JSON Value Returned ", aValue.toString() );
|
||||
G3Viewer.displayError("Only JSON Value Returned ",
|
||||
aValue.toString());
|
||||
}
|
||||
}
|
||||
}, false ,false, data);
|
||||
}, false, false, data);
|
||||
}
|
||||
|
||||
private void showDialog(String a_Text){
|
||||
HttpDialogBox.this.hide();
|
||||
Loading.getInstance().loading("Please Wait..");
|
||||
|
||||
}
|
||||
|
||||
private void showDialog(String a_Text) {
|
||||
|
||||
m_Dialog.setHTML(a_Text);
|
||||
|
||||
// hide all submits
|
||||
NodeList<Element> inputs = this.getElement().getElementsByTagName("input");
|
||||
NodeList<Element> inputs = this.getElement().getElementsByTagName(
|
||||
"input");
|
||||
Element input;
|
||||
for (int i = 0; i < inputs.getLength(); i++){
|
||||
for (int i = 0; i < inputs.getLength(); i++) {
|
||||
input = inputs.getItem(i);
|
||||
|
||||
if (input.getAttribute("type").equals("submit"))
|
||||
{
|
||||
if (input.getAttribute("type").equals("submit")) {
|
||||
input.setAttribute("style", "display:none");
|
||||
}
|
||||
}
|
||||
@ -223,32 +221,41 @@ public class HttpDialogBox extends DialogBox{
|
||||
show();
|
||||
|
||||
// find forms if it exists
|
||||
NodeList<Element> forms = this.getElement().getElementsByTagName("form");
|
||||
if (forms.getLength() > 0)
|
||||
{
|
||||
Element element = this.getElement().getElementsByTagName("form").getItem(0);
|
||||
setText(element.getElementsByTagName("legend").getItem(0).getInnerText());
|
||||
NodeList<Element> forms = this.getElement()
|
||||
.getElementsByTagName("form");
|
||||
if (forms.getLength() > 0) {
|
||||
Element element = this.getElement().getElementsByTagName("form")
|
||||
.getItem(0);
|
||||
setText(element.getElementsByTagName("legend").getItem(0)
|
||||
.getInnerText());
|
||||
|
||||
m_FormPanel = FormPanel.wrap(element, true);
|
||||
m_FormPanel.addSubmitHandler(new FormPanel.SubmitHandler() {
|
||||
|
||||
@Override
|
||||
public void onSubmit(SubmitEvent event) {
|
||||
event.cancel();
|
||||
submitForm();
|
||||
}
|
||||
else
|
||||
{
|
||||
setText(this.getElement().getElementsByTagName("legend").getItem(0).getInnerText());
|
||||
});
|
||||
} else {
|
||||
setText(this.getElement().getElementsByTagName("legend").getItem(0)
|
||||
.getInnerText());
|
||||
m_FormPanel = null;
|
||||
}
|
||||
|
||||
setPopupPosition(Window.getClientWidth() / 2 - this.getOffsetWidth() / 2,
|
||||
Window.getClientHeight() / 2 - this.getOffsetHeight() / 2);
|
||||
setPopupPosition(Window.getClientWidth() / 2 - this.getOffsetWidth()
|
||||
/ 2, Window.getClientHeight() / 2 - this.getOffsetHeight() / 2);
|
||||
|
||||
Timer t = new Timer(){
|
||||
public void run(){
|
||||
Timer t = new Timer() {
|
||||
public void run() {
|
||||
|
||||
// find any scripts if they exist
|
||||
NodeList<Element> scripts = HttpDialogBox.this.getElement().getElementsByTagName("script");
|
||||
for (int i = 0; i < scripts.getLength(); i++ )
|
||||
{
|
||||
NodeList<Element> scripts = HttpDialogBox.this.getElement()
|
||||
.getElementsByTagName("script");
|
||||
for (int i = 0; i < scripts.getLength(); i++) {
|
||||
Element script = scripts.getItem(i);
|
||||
script.removeFromParent();
|
||||
// script.removeFromParent();
|
||||
Element nscript = DOM.createElement("script");
|
||||
nscript.setAttribute("type", script.getAttribute("type"));
|
||||
nscript.setAttribute("src", script.getAttribute("src"));
|
||||
@ -264,7 +271,9 @@ public class HttpDialogBox extends DialogBox{
|
||||
/**
|
||||
* Gets an element by its tag name; handy for single elements like HTML,
|
||||
* HEAD, BODY.
|
||||
* @param tagName The name of the tag.
|
||||
*
|
||||
* @param tagName
|
||||
* The name of the tag.
|
||||
* @return The element with that tag name.
|
||||
*/
|
||||
public native static Element getElementByTagName(String tagName) /*-{
|
||||
@ -272,7 +281,7 @@ public class HttpDialogBox extends DialogBox{
|
||||
return elem ? elem[0] : null;
|
||||
}-*/;
|
||||
|
||||
public void doDialog(String url, HttpDialogHandler a_Callback){
|
||||
public void doDialog(String url, HttpDialogHandler a_Callback) {
|
||||
m_Callback = a_Callback;
|
||||
Loading.getInstance().loading("Please Wait");
|
||||
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
|
||||
@ -280,9 +289,9 @@ public class HttpDialogBox extends DialogBox{
|
||||
try {
|
||||
builder.sendRequest(null, new RequestCallbackImpl(url));
|
||||
} catch (RequestException e) {
|
||||
showDialog("Could not call " + url + " Exception thrown " + e.toString());
|
||||
showDialog("Could not call " + url + " Exception thrown "
|
||||
+ e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.gloopics.g3viewer.client;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.gloopics.g3viewer.client.dnddesktop.DesktopDropFile;
|
||||
import com.gloopics.g3viewer.client.dnddesktop.DesktopDroppableWidget;
|
||||
@ -27,6 +28,7 @@ import com.google.gwt.event.logical.shared.CloseEvent;
|
||||
import com.google.gwt.event.logical.shared.CloseHandler;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.google.gwt.gears.client.desktop.File;
|
||||
import com.google.gwt.json.client.JSONArray;
|
||||
import com.google.gwt.json.client.JSONNumber;
|
||||
import com.google.gwt.json.client.JSONObject;
|
||||
import com.google.gwt.json.client.JSONString;
|
||||
@ -161,7 +163,7 @@ public class Item extends Composite implements HasAllMouseHandlers, DesktopDropp
|
||||
}
|
||||
}
|
||||
|
||||
private void updateImages(JSONValue a_Value){
|
||||
public void updateImages(JSONValue a_Value){
|
||||
JSONObject jso = a_Value.isObject();
|
||||
|
||||
if (jso != null) {
|
||||
@ -189,21 +191,22 @@ public class Item extends Composite implements HasAllMouseHandlers, DesktopDropp
|
||||
m_LinkedAlbum = a_Album;
|
||||
}
|
||||
|
||||
public void showPopupMenu(ContextMenuEvent event){
|
||||
Iterator<Widget> iter = m_Container.getDragController().getSelectedWidgets().iterator();
|
||||
|
||||
// show views popup menu if items are selected
|
||||
if (iter.hasNext())
|
||||
public void removeLinkedAlbum()
|
||||
{
|
||||
iter.next();
|
||||
if (iter.hasNext())
|
||||
if (m_LinkedAlbum != null){
|
||||
m_LinkedAlbum.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void showPopupMenu(ContextMenuEvent event){
|
||||
// show views popup menu if items are selected
|
||||
if (m_Container.getDragController().getSelectedWidgetcount() > 1)
|
||||
{
|
||||
m_View.showPopupMenu(event);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.addStyleName("popped");
|
||||
final PopupPanel popupPanel = new PopupPanel(true);
|
||||
popupPanel.setAnimationEnabled(true);
|
||||
@ -267,7 +270,7 @@ public class Item extends Composite implements HasAllMouseHandlers, DesktopDropp
|
||||
MenuItem rotateCW = new MenuItem("Rotate Clockwise", true, new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
m_ThumbImage.setUrl(Loading.URL);
|
||||
setLoadingThumb();
|
||||
m_Container.doJSONRequest(G3Viewer.ROTATE_URL + m_ID + "/cw", new HttpSuccessHandler() {
|
||||
|
||||
public void success(JSONValue aValue) {
|
||||
@ -283,7 +286,7 @@ public class Item extends Composite implements HasAllMouseHandlers, DesktopDropp
|
||||
MenuItem rotateCCW = new MenuItem("Rotate Couter-Clockwise", true, new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
m_ThumbImage.setUrl(Loading.URL);
|
||||
setLoadingThumb();
|
||||
m_Container.doJSONRequest(G3Viewer.ROTATE_URL + m_ID + "/ccw", new HttpSuccessHandler() {
|
||||
|
||||
public void success(JSONValue aValue) {
|
||||
@ -299,6 +302,7 @@ public class Item extends Composite implements HasAllMouseHandlers, DesktopDropp
|
||||
|
||||
|
||||
|
||||
|
||||
popupMenuBar.setVisible(true);
|
||||
popupPanel.add(popupMenuBar);
|
||||
|
||||
@ -317,6 +321,10 @@ public class Item extends Composite implements HasAllMouseHandlers, DesktopDropp
|
||||
popupPanel.show();
|
||||
}
|
||||
|
||||
public void setLoadingThumb()
|
||||
{
|
||||
m_ThumbImage.setUrl(Loading.URL);
|
||||
}
|
||||
|
||||
public boolean isAlbum(){
|
||||
return m_IsAlbum;
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.gloopics.g3viewer.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.allen_sauer.gwt.dnd.client.DragContext;
|
||||
import com.allen_sauer.gwt.dnd.client.PickupDragController;
|
||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public class MyPickupDragController extends PickupDragController{
|
||||
|
||||
public MyPickupDragController(AbsolutePanel boundaryPanel, boolean allowDroppingOnBoundaryPanel) {
|
||||
super(boundaryPanel, allowDroppingOnBoundaryPanel);
|
||||
}
|
||||
|
||||
public DragContext getDragContext()
|
||||
{
|
||||
return context;
|
||||
}
|
||||
|
||||
public List<Widget> getSelectedWidgets()
|
||||
{
|
||||
return context.selectedWidgets;
|
||||
}
|
||||
|
||||
public int getSelectedWidgetcount()
|
||||
{
|
||||
return context.selectedWidgets.size();
|
||||
}
|
||||
|
||||
}
|
@ -126,6 +126,7 @@ public class UploadFile extends Composite{
|
||||
{
|
||||
m_Label.setText("Upload Error");
|
||||
addStyleName("upload-error");
|
||||
G3Viewer.displayError("Error Uploading", request.getResponseText());
|
||||
}
|
||||
removeCapture(RS, m_Name);
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
package com.gloopics.g3viewer.client;
|
||||
|
||||
import com.allen_sauer.gwt.dnd.client.DragContext;
|
||||
import com.google.gwt.json.client.JSONArray;
|
||||
import com.google.gwt.json.client.JSONNumber;
|
||||
import com.google.gwt.json.client.JSONValue;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public class Utils {
|
||||
public static int extractId(JSONValue a_Value){
|
||||
@ -15,4 +18,17 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
public static JSONArray extractIds(DragContext context) {
|
||||
JSONArray jsa = new JSONArray();
|
||||
|
||||
int i = 0;
|
||||
for (Widget widget : context.selectedWidgets){
|
||||
if (widget instanceof Item){
|
||||
jsa.set(i, new JSONNumber(((Item)widget).getID()));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return jsa;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,10 +13,13 @@ import com.google.gwt.event.dom.client.ContextMenuEvent;
|
||||
import com.google.gwt.event.logical.shared.CloseEvent;
|
||||
import com.google.gwt.event.logical.shared.CloseHandler;
|
||||
import com.google.gwt.gears.client.desktop.File;
|
||||
import com.google.gwt.json.client.JSONArray;
|
||||
import com.google.gwt.json.client.JSONObject;
|
||||
import com.google.gwt.json.client.JSONValue;
|
||||
import com.google.gwt.user.client.Command;
|
||||
import com.google.gwt.user.client.DOM;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.ui.DialogBox;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.MenuBar;
|
||||
@ -140,17 +143,26 @@ public class View extends FlowPanel implements DesktopDroppableWidget{
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
/*
|
||||
m_Container.doDialog("index.php/quick/form_delete/" + m_ID, new HttpDialogHandler() {
|
||||
public void success(String aResult) {
|
||||
m_View.removeFromView(Item.this);
|
||||
if (m_LinkedAlbum != null){
|
||||
m_LinkedAlbum.remove();
|
||||
popupPanel.hide();
|
||||
|
||||
m_Container.doConfirm("Are you sure you wish to delete selected items?", new ConfirmDialogBox.ConfirmCallBack() {
|
||||
|
||||
public void ok() {
|
||||
JSONArray jsa = Utils.extractIds(m_Container.getDragController().getDragContext());
|
||||
|
||||
m_Container.doJSONRequest(G3Viewer.DELETE_ALL_URL + "?sourceids=" + jsa.toString() , new HttpSuccessHandler() {
|
||||
public void success(JSONValue aValue) {
|
||||
final List<Widget> widgets = m_Container.getDragController().getSelectedWidgets();
|
||||
Item i;
|
||||
for (Widget widget: widgets){
|
||||
i = (Item)widget;
|
||||
removeFromView(i);
|
||||
i.removeLinkedAlbum();
|
||||
}
|
||||
|
||||
}}, true, true);
|
||||
}
|
||||
});
|
||||
*/
|
||||
popupPanel.hide();
|
||||
|
||||
}
|
||||
});
|
||||
@ -160,6 +172,62 @@ public class View extends FlowPanel implements DesktopDroppableWidget{
|
||||
popupMenuBar.setVisible(true);
|
||||
popupPanel.add(popupMenuBar);
|
||||
|
||||
MenuItem rotateAllCW = new MenuItem("Rotate All Clockwise", true, new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
// change all thumbs into loading
|
||||
final List<Widget> widgets = m_Container.getDragController().getSelectedWidgets();
|
||||
|
||||
for (Widget widget: widgets){
|
||||
final Item i = ((Item)widget);
|
||||
if (i.isPhoto())
|
||||
{
|
||||
i.setLoadingThumb();
|
||||
}
|
||||
|
||||
m_Container.doJSONRequest(G3Viewer.ROTATE_URL + i.getID() + "/cw",
|
||||
new HttpSuccessHandler() {
|
||||
|
||||
public void success(JSONValue aValue) {
|
||||
i.updateImages(aValue);
|
||||
}
|
||||
},false,true);
|
||||
}
|
||||
popupPanel.hide();
|
||||
}
|
||||
});
|
||||
|
||||
rotateAllCW.addStyleName("popup-item");
|
||||
popupMenuBar.addItem(rotateAllCW);
|
||||
|
||||
|
||||
MenuItem rotateAllCCW = new MenuItem("Rotate All Counter-Clockwise", true, new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
// change all thumbs into loading
|
||||
final List<Widget> widgets = m_Container.getDragController().getSelectedWidgets();
|
||||
|
||||
for (Widget widget: widgets){
|
||||
final Item i = ((Item)widget);
|
||||
if (i.isPhoto())
|
||||
{
|
||||
i.setLoadingThumb();
|
||||
}
|
||||
m_Container.doJSONRequest(G3Viewer.ROTATE_URL + i.getID() + "/cw",
|
||||
new HttpSuccessHandler() {
|
||||
|
||||
public void success(JSONValue aValue) {
|
||||
i.updateImages(aValue);
|
||||
}
|
||||
},false,true);
|
||||
}
|
||||
popupPanel.hide();
|
||||
}
|
||||
});
|
||||
|
||||
rotateAllCW.addStyleName("popup-item");
|
||||
popupMenuBar.addItem(rotateAllCCW);
|
||||
|
||||
int x = DOM.eventGetClientX((Event)event.getNativeEvent());
|
||||
int y = DOM.eventGetClientY((Event)event.getNativeEvent());
|
||||
popupPanel.setPopupPosition(x, y);
|
||||
@ -167,6 +235,4 @@ public class View extends FlowPanel implements DesktopDroppableWidget{
|
||||
popupPanel.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,3 +4,4 @@
|
||||
?>
|
||||
<iframe src="<?=$url?>" style="width:100%; height:500px; border:8px solid #d2e1f6; margin:0; padding:0;">
|
||||
</iframe>
|
||||
GWT Organise version built on <?= revision::getTimeStamp()?>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user