Skip to content

Commit

Permalink
Added a build version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Smith authored and bharat committed Jun 20, 2010
1 parent 35d70d4 commit 842fd2c
Show file tree
Hide file tree
Showing 151 changed files with 22,657 additions and 229 deletions.
19 changes: 19 additions & 0 deletions modules/gwtorganise/.externalToolBuilders/New_Builder.launch
@@ -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>
10 changes: 10 additions & 0 deletions modules/gwtorganise/.project
Expand Up @@ -30,6 +30,16 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/New_Builder.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
Expand Down
@@ -1,4 +1,4 @@
#Thu Feb 11 15:27:06 NZDT 2010 #Fri Mar 26 11:43:34 NZDT 2010
eclipse.preferences.version=1 eclipse.preferences.version=1
entryPointModules= entryPointModules=
filesCopiedToWebInfLib=gwt-servlet.jar filesCopiedToWebInfLib=gwt-servlet.jar
Expand Down
21 changes: 21 additions & 0 deletions modules/gwtorganise/build.xml
@@ -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">
&#60;?php defined("SYSPATH") or die("No direct script access.");
class revision_Core {
static function getTimeStamp(){
return "${TODAY}";
}
}

</echo>
</project>
74 changes: 67 additions & 7 deletions modules/gwtorganise/controllers/json_album.php
Expand Up @@ -73,13 +73,21 @@ function move_to($target_album_id) {
access::verify_csrf(); access::verify_csrf();


$target_album = ORM::factory("item", $target_album_id); $target_album = ORM::factory("item", $target_album_id);
access::required("view", $target_album);
access::required("add", $target_album);


$js = json_decode($_REQUEST["sourceids"]); $source_album = null;


$js = json_decode($_REQUEST["sourceids"]);
$i = 0; $i = 0;
$source_album = null;
foreach ($js as $source_id) { foreach ($js as $source_id) {
$source = ORM::factory("item", $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)) { if (!$source->contains($target_album)) {
access::required("edit", $source);
item::move($source, $target_album); item::move($source, $target_album);
} }
$i++; $i++;
Expand Down Expand Up @@ -226,12 +234,7 @@ public function make_album_cover($id) {
print json_encode(array("result" => "success")); print json_encode(array("result" => "success"));
} }


public function rotate($id, $dir) { public function p_rotate($item, $dir){
access::verify_csrf();
$item = model_cache::get("item", $id);
access::required("view", $item);
access::required("edit", $item);

$degrees = 0; $degrees = 0;
switch($dir) { switch($dir) {
case "ccw": case "ccw":
Expand Down Expand Up @@ -262,6 +265,63 @@ public function rotate($id, $dir) {
} }
} }


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)); print json_encode(self::child_json_encode($item));
} }


Expand Down
9 changes: 9 additions & 0 deletions modules/gwtorganise/helpers/revision.php
@@ -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";
}
}


Expand Up @@ -27,6 +27,7 @@
import com.google.gwt.user.client.ui.MenuItem; import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.TreeItem; import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.Widget;


/** /**
* encapsulates an album * encapsulates an album
Expand Down Expand Up @@ -189,7 +190,6 @@ public void success(String aResult) {
popupMenuBar.addItem(addAlbum); popupMenuBar.addItem(addAlbum);
popupMenuBar.addItem(userPermissions); popupMenuBar.addItem(userPermissions);



popupMenuBar.setVisible(true); popupMenuBar.setVisible(true);
popupPanel.add(popupMenuBar); popupPanel.add(popupMenuBar);


Expand Down
Expand Up @@ -28,19 +28,7 @@ public Widget getDropTarget() {


@Override @Override
public void onDrop(DragContext context) { public void onDrop(DragContext context) {
JSONArray jsa = new JSONArray(); m_Album.moveTo(Utils.extractIds(context));

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

} }


@Override @Override
Expand Down
@@ -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();
}

}
29 changes: 26 additions & 3 deletions modules/gwtorganise/src/com/gloopics/g3viewer/client/G3Viewer.java
Expand Up @@ -17,6 +17,8 @@




import com.allen_sauer.gwt.dnd.client.PickupDragController; 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.Document;
import com.google.gwt.dom.client.InputElement; import com.google.gwt.dom.client.InputElement;
import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.Style.Unit;
Expand Down Expand Up @@ -133,11 +135,22 @@ public void onClick(ClickEvent event) {
*/ */
public static final String ROTATE_URL = BASE_URL + "index.php/json_album/rotate/"; 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 * Resize details URL
*/ */
public static final String RESIZE_DETAILS_URL = BASE_URL + "index.php/json_album/resize_config"; 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 * tree
*/ */
Expand All @@ -158,6 +171,11 @@ public void onClick(ClickEvent event) {
*/ */
private final HttpDialogBox m_HttpDialogBox= new HttpDialogBox(this); 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 private class SimplePanelEx extends SimplePanel
{ {
public SimplePanelEx() public SimplePanelEx()
Expand Down Expand Up @@ -223,7 +241,7 @@ public void onBrowserEvent(Event event) {
/** /**
* the drag controller * the drag controller
*/ */
private final PickupDragController m_DragController; private final MyPickupDragController m_DragController;


/** /**
* the upload control * the upload control
Expand All @@ -235,7 +253,7 @@ public void onBrowserEvent(Event event) {
*/ */


public G3Viewer(){ public G3Viewer(){
m_DragController = new PickupDragController(RootPanel.get(),false); m_DragController = new MyPickupDragController(RootPanel.get(),false);
m_DragController.setBehaviorMultipleSelection(true); m_DragController.setBehaviorMultipleSelection(true);
m_DragController.setBehaviorDragStartSensitivity(5); m_DragController.setBehaviorDragStartSensitivity(5);
m_DragController.setBehaviorDragProxy(true); m_DragController.setBehaviorDragProxy(true);
Expand Down Expand Up @@ -307,7 +325,7 @@ public static void displayError(String errorType, String errorMessage) {
/** /**
* returns the drag controller * returns the drag controller
*/ */
public PickupDragController getDragController(){ public MyPickupDragController getDragController(){
return m_DragController; return m_DragController;
} }


Expand All @@ -328,6 +346,11 @@ public void doDialog(String a_Url, HttpDialogHandler a_Handler)
m_HttpDialogBox.doDialog(BASE_URL + a_Url, a_Handler); 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) public void showImage(String a_Url)
{ {
m_ImageDialogBox.doDialog( a_Url); m_ImageDialogBox.doDialog( a_Url);
Expand Down

0 comments on commit 842fd2c

Please sign in to comment.